csc error

C

CSharper

When I try to compile a C# application using the command line code I
am getting the following error;

App.xaml.cs(line,column): error cs0246: The type or namespace name
'Application' could not be found

I tried looking for System.* under c:\windows\microsoft.net\framework
\v3.5 and there are no system.* dlls found, on the other hand I can
find them in v2.0

Am I suppose to use command line reference /r and specify all the dlls
required for this project against v2.0 or am I looking at wrong places
for v3.5?

Thanks.
 
B

Ben Voigt [C++ MVP]

CSharper said:
When I try to compile a C# application using the command line code I
am getting the following error;

App.xaml.cs(line,column): error cs0246: The type or namespace name
'Application' could not be found

I tried looking for System.* under c:\windows\microsoft.net\framework
\v3.5 and there are no system.* dlls found, on the other hand I can
find them in v2.0

Am I suppose to use command line reference /r and specify all the dlls
required for this project against v2.0 or am I looking at wrong places
for v3.5?

..NET 3.x uses the .NET 2.0 dlls plus some more (WCF, WPF, and so on).
 
W

Willy Denoyette [MVP]

CSharper said:
When I try to compile a C# application using the command line code I
am getting the following error;

App.xaml.cs(line,column): error cs0246: The type or namespace name
'Application' could not be found

I tried looking for System.* under c:\windows\microsoft.net\framework
\v3.5 and there are no system.* dlls found, on the other hand I can
find them in v2.0

Am I suppose to use command line reference /r and specify all the dlls
required for this project against v2.0 or am I looking at wrong places
for v3.5?

Thanks.


The V3 and V3.5 assemblies are located under "x:\Program Files\Reference
Assemblies\Microsoft\Framework\v3.0" and "x:\Program Files\Reference
Assemblies\Microsoft\Framework\v3.5" where x is your system drive.

Willy.
 
C

CSharper

The V3 and V3.5 assemblies are located under  "x:\Program Files\Reference
Assemblies\Microsoft\Framework\v3.0" and "x:\Program Files\Reference
Assemblies\Microsoft\Framework\v3.5" where x is your system drive.

Willy.

Thank you very much and quick question, so do I need to individually
include the reference or can I do a wild card with /r:c:\program files
\reference assemblies\Microsoft\Framework\v3.5\*.dll

thanks.
 
W

Willy Denoyette [MVP]

The V3 and V3.5 assemblies are located under "x:\Program Files\Reference
Assemblies\Microsoft\Framework\v3.0" and "x:\Program Files\Reference
Assemblies\Microsoft\Framework\v3.5" where x is your system drive.

Willy.

Thank you very much and quick question, so do I need to individually
include the reference or can I do a wild card with /r:c:\program files
\reference assemblies\Microsoft\Framework\v3.5\*.dll

thanks.

You need to reference the exact assembly, no wild cards allowed here.
You also need to make sure you are using the right csc.exe (the one from
...\framework\v3.5), that is, this path must be your home path or you need to
set this directory in the path environment variable before the V2.0
directory path. Failing to do so will use the wrong csc.rsp file needed to
locate the correct framework assemblies.


Willy.
 
C

CSharper

Thank you very much and quick question, so do I need to individually
include the reference or can I do a wild card with /r:c:\program files
\reference assemblies\Microsoft\Framework\v3.5\*.dll

thanks.

You need to reference the exact assembly, no wild cards allowed here.
You also need to make sure you are using the right csc.exe (the one from
..\framework\v3.5), that is, this path must be your home path or you need to
set this directory in the path environment variable before the V2.0
directory path. Failing to do so will use the wrong csc.rsp file needed to
locate  the correct framework assemblies.

Willy.- Hide quoted text -

- Show quoted text -

Excellent, thank you very much.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top