I downloaded and installed the 2.0 framework. As I understand it, 1.1
and 2.0 are supposed to play nice with each other. However, now when I
go about compiling a class using CSC.exe, I get this error (among
others):
---------------------
warning CS1595: 'System.TimeSpan' is defined in multiple places; using
definition from c:\WINDOWS\Microsoft.NET\Framework
\v1.1.4322\mscorlib.dll
---------------------
Despite "only" being a warning, the compilation doesn't seem to take,
such that the DLL is not produced.
I've done an exhaustive search on the machine for multiple
mscorlib.dll files. There are four, in these locations:
1) c:\I386\netfx.cab
2) c:\windows\servicepackfiles\i386
3) c:\windows\Microsoft.Net\framework\v.1.1.4322
4) c:\windows\Microsoft.Net\framework\v.2.0.50717
If necessary, I will uninstall 2.0. That will probably fix it. Short
of that, however, is there any other solution?
Thanks for any pointers.
--Brent
Marc
Thanks for the heads up, Marc. My CSC command looks like this (sans
line feeds):
C:\[PathToCSC]\csc.exe
/t:library
/out:C:\[PathToBin]\bin\toolbox.dll
C:\[PathToCSFile]\toolbox.cs
/r:c:\windows\Microsoft.NET\Framework\v1.1.4322\System.Web.dll
/r:c:\windows\Microsoft.NET\Framework\v1.1.4322\mscorlib.dll
/r:c:\windows\Microsoft.NET\Framework\v1.1.4322\System.Data.dll
/r:c:\windows\Microsoft.NET\Framework\v1.1.4322\system.dll
/r:c:\windows\Microsoft.NET\Framework\v1.1.4322\system.web.dll
/r:c:\windows\Microsoft.NET\Framework\v1.1.4322\system.xml.dll
Weird stuff...
Marc
This is a good question. Actually, I'm using a csc.exe located in the
same folder as the .CS file. When I pointed to the CSC.exe file
located in c:\windows\Microsoft.NET\Framework\v1.1.4322\ , the
compiling works fine! Could it be that the absence of a csc.exe.config
in the local folder causes the csc to look all over the place for the
referenced namespaces, and come up with conflicts?
Whatever the case, I'm back on track.
Thanks, Marc.
--Brent
Not really. It's just that csc always references some assemblies (in
particular, mscorlib) from the corresponding version of .NET
Framework, and then also those that you explicitly specify. In your
case, it would seem that this results in both mscorlib from 1.1 and
mscorlib from 2.0 being referenced, hence the clash.
.NET 1.1 and 2.0 do play nice with each other in a sense that they can
be installed side by side, and programs will run using whatever
version of .NET they were built with. But if you're compiling with csc
2.0, you should really be referencing 2.0 assemblies, not 1.1 ones.