Compiler error CS0246
Author: rnewcomb
Creation Date: 4/17/2013 10:22 PM
profile picture

rnewcomb

#1
I have an unexpected error message and I do not how to proceed further
I followed the instructions about using Visual Studio (http://www2.wealth-lab.com/WL5Wiki/kbAskGlitchDebug.ashx) and I am running into the following build error message -

>C:\Users\Russ\Documents\Visual Studio 2012\Projects\TrendLineFinderV1\TrendLineFinderV1\Class1.cs(13,7,13,16): error CS0246: The type or namespace name 'WealthLab' could not be found (are you missing a using directive or an assembly reference?)
1>C:\Users\Russ\Documents\Visual Studio 2012\Projects\TrendLineFinderV1\TrendLineFinderV1\Class1.cs(18,31,18,43): error CS0246: The type or namespace name 'WealthScript' could not be found (are you missing a using directive or an assembly reference?)
1>C:\Users\Russ\Documents\Visual Studio 2012\Projects\TrendLineFinderV1\TrendLineFinderV1\Class1.cs(224,44,224,58): error CS0246: The type or namespace name 'StrategyHelper' could not be found (are you missing a using directive or an assembly reference?)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

When following the link http://www2.wealth-lab.com/WL5Wiki/kbAskGlitchDebug.ashx it says to add as a reference ◦Select Wealth-Lab.dll and click OK. The closest I could find was WealthLab.dll with no hypen in the name so I added that as the reference. The critical lines being highlighted are -

CODE:
Please log in to see this code.
profile picture

Eugene

#2
Compiler Error CS0246 is expected when a reference to WealthLab.dll is missing. It will be gone after adding a reference to the core library and recompiling.

I'd rather thought your TrendLineFinderV1 class should be public, but it's OK to be private.

And just to be on the safe side, make sure your solution targets .NET 4.0 (4.5 is chosen by default).

P.S. Thanks for spotting "Wealth-Lab.dll" in the Wiki article (fixed).
profile picture

rnewcomb

#3
Eugene -

Thanks for your help. I got a version to single step my wealthlab script.
profile picture

WEALTHPRO25

#4
i want to get macd reverese eng based on the RS value, with the following script getting CS0246 error, please help

CODE:
Please log in to see this code.
profile picture

Eugene

#5
TASC 2012-01 | Reversing MACD (Dough)

CODE:
Please log in to see this code.


See the difference? You have to include a using directive to the TASCIndicators library which contains RevEngMACDSignal.
profile picture

WEALTHPRO25

#6
ok i put the tascindicators and now it does not recognize MACDEx_Signal3 and MACDEx_Histogram, please help
profile picture

Eugene

#7
That's because these indicators reside in another indicator library (Community.Indicators). If it's not installed in WLP, install it from the Extensions section and restart WLP. Otherwise just look up their code examples here in the Wiki for the proper syntax of the using directive and you're good to go.
profile picture

WEALTHPRO25

#8
i have it in the indicator library but still get the error, i have attached a screen photo
profile picture

Eugene

#9
QUOTE:
i have it in the indicator library but still get the error,


Of course you do because you haven't followed my post #8 to the end, just taking its step one. Now it's time to carefully revisit it and post #5 too: the same procedure applies now for C.Indicators (which is the "home" for your new indicators). Keep this in mind every time you wish to use any indicator from an extension library.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).