.NET v1.1 csc.exe compiler bug?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I first thought I had some compiler setting wrong in VC# 2003 but it turns
out that it has something to do with .NET framework v1.1 itself.
If I understand correctly, .NET installer also installs a csc.exe C#
compiler. And VC# 2003 is using this csc.exe compiler.

Uninstalled an reinstalled both the .NET v1.0 and v1.1 framework multiple
times now.
I also repaired, uninstalled and installed VC# 2002 and 2003 and the full
trial version, no sollution.

What happened? Wel this:

I took a stupidly simple console program (with no unsafe code or any
modifications).
And I compile using the command line compiler like this:

----
D:\Source\Scratch\Managed\Testing\ConsoleApplication1>csc.exe /out:clas
:exe /r:MSCorLib.dll class1.cs
----

This is the result that I get, and the exe is there and works fine:

----
Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.
----

Now I add one simple additional command "/unsafe+"

----
D:\Source\Scratch\Managed\Testing\ConsoleApplication1>csc.exe /out:clas
:exe /r:MSCorLib.dll /unsafe+ class1.cs

Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

error CS1577: Assembly generation failed -- Unexpected exception
proces
attribute -- System.ArgumentException: Invalid directory on URL
----

So it seems that this *System.ArgumentException* is an error from the
csc.exe compiler??? No exec code exists.

One odd thing is that when I use "/unsafe-" (minus) then it compiles
without problems.

This works fine using the VC# 2002!!!!! And it also works fine using VC#
2003 at a different computer installed from the same installation disk.

One final test I did was using the C# csc.exe from framework 1.0 and this
one DID compile with "/unsafe+" !!!!!
See below:

D:\Source\Scratch\Managed\Testing\ConsoleApplication1>C:\WINNT\Microsoft.NET
\Fra
mework\v1.0.3705\csc /out:test.exe /unsafe+ class1.cs
Microsoft (R) Visual C# .NET Compiler version 7.00.9466
for Microsoft (R) .NET Framework version 1.0.3705
Copyright (C) Microsoft Corporation 2001. All rights reserved.

Mysteries, mysteries,....
Do we have here some .NET 1.1 csc.exe bug???
 
No problem here running V1.1

Note that csc.exe is the command line front-end the "real" compiler is cscomp.dll. VS uses the cscomp.dll directly.

Willy.
 
No problem here running V1.1
Note that csc.exe is the command line front-end the "real" compiler is
cscomp.dll. VS uses the cscomp.dll directly.Yesterday I tried to compile this on my home computer and it worked fine.

Only the computer here at my work gives problems and it must be some .NET
configuration setting that is wrong.
One time I had a big problem with an alink error, and that turned out to be
environment variable space that was too small and one of the paths got
trunctated.
This time I checked this environment space and all paths are there and
correct. Maybe some other configuration file?

I give up, and revert back to VC# 2002 because that one worked without
problems except for deployment problems when I use multiple dll's.

In my opinion, I love the .NET and C# but it is not ready yet to replace the
conventionaly exe files yet in a commercial way.
I just use this for small projects that are to be created fast and only used
internally.

You did give me an interesting ide about this cscomp.dll, I will have to
check this.
Thanks. :-)
 
Back
Top