While fiddling with Naudio, I found this code. I am compiling it as:
csc.exe /reference:Naudio.dll play.cs
and getting the error:
play.cs(3,14): error CS0234: The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?)
The version of csc is: C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.EXE
While searching for it, I found a thread which says I need to add System.core
reference, but doing something like: /reference:System.core.dll
or /reference:System.core
is not solving the problem.
version v2.0.50727
does not natively supports Linq
. To solve your issue, you can try these two methods:
Linq
if possible (as already suggested by SS Kain).If removing Linq
is not desirable for you, use the higher version.
Instead of using csc from C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.EXE
, I would suggest upgrading to the latest .NET version (provided your deployment doesn't have issues with that) and try using csc.exe
from there.
I use C:\Windows\Microsoft.NET\Framework\v4.0.30319\
and that works fine for me.
Also note that if you are using Visual Studio 2010 command prompt, this path is not added by default to your PATH env variable and so you will have to add it manually.
set PATH=%PATH%;C:\Windows\Microsoft.NET\Framework\v4.0.30319\
I believe that 2.0.50727
does not support Linq
, remove Linq
from references and from "usings" and hope that there are no Linq
statements in the code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With