Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

After upgrade to 2.0, Error CS1595 System.TimeSpan is defined in multiple places

1 view
Skip to first unread message

brent...@gmail.com

unread,
May 10, 2008, 3:59:51 PM5/10/08
to
I know I'm some years behind, but I just have the go-ahead to start
developing on .Net 2.0. While the development process goes ahead, I'm
to maintain the .Net 1.1 stuff on the same machine.

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 Gravell

unread,
May 10, 2008, 4:53:22 PM5/10/08
to
Are you intentionally referencing both 1.1 and 2.0? What csc command
are you using? Call me lazy, but I do like using tools like VS, which
will sort out this type of issue for us...

Marc

Brent

unread,
May 11, 2008, 3:02:59 AM5/11/08
to

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 Gravell

unread,
May 11, 2008, 3:49:47 AM5/11/08
to
And just checking: are you using the 1.1 version of csc, or the 2.0
one?

Marc

Brent

unread,
May 11, 2008, 1:28:45 PM5/11/08
to

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

Pavel Minaev

unread,
May 11, 2008, 5:50:26 PM5/11/08
to
On May 11, 9:28 pm, Brent <writebr...@gmail.com> wrote:
> 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?

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.

0 new messages