Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / May 2008

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
brentbackup@gmail.com - 10 May 2008 20:59 GMT
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 - 10 May 2008 21:53 GMT
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 - 11 May 2008 08:02 GMT
> 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

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 - 11 May 2008 08:49 GMT
And just checking: are you using the 1.1 version of csc, or the 2.0
one?

Marc
Brent - 11 May 2008 18:28 GMT
> And just checking: are you using the 1.1 version of csc, or the 2.0
> one?
>
> 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
Pavel Minaev - 11 May 2008 22:50 GMT
> 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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.