Login

Problems with mscorlib.dll

Versions: n/a, FAQ number: 54, Old FAQ number: 992

Q: Problems with mscorlib.dll

A:

This article describes solutions to problems causing one of the following error messages:

  • Compiler Error Message: CS1595: 'System.Collections.ArrayList' is defined in multiple places; using definition from 'c:\winnt\microsoft.net\framework\v1.0.3705\mscorlib.dll'
  • Compiler Error Message: CS1595: 'System.Runtime.CompilerServices.CompilerGlobalScopeAttribute' is defined in multiple places; using definition from 'c:\windows\microsoft.net\framework\v1.0.3705\mscorlib.dll'

 

Include the /nostdlib Option in the C# Compiler Definition.

First check the following:
  1. Open the Machine.config file, and then locate the <compilers> section.
  2. In the <compiler> definition for C#, add the compilerOptions attribute with a value of /nostdlib.

    For example:

    <compiler language="c#;cs;csharp"
             extension=".cs"
             type="Microsoft.CSharp.CSharpCodeProvider, System,
             Version=1.0.3300.0,
             Culture=neutral,
             PublicKeyToken=b77a5c561934e089"
             warningLevel="1"
             compilerOptions="/nostdlib" />
NOTE: You cannot use this method for applications that use the XmlSerializer class or Web services because the compiler invocation that XmlSerializer uses does not inherit these options. In that case you must grant read/list permissions to the ASPNET account on the folder
%windir%\Microsoft.NET\Framework\Version.

For a thorough explanation of the solutions described above, see the Microsoft MSDN article at http://support.microsoft.com/default.aspx?scid=kb;en-us;Q318274.

 

Solve caching problems

If the above does not help you may have a caching problem, which means that there are cached ASPNET assemblies that conflicts with the assembly you are trying to build. This FAQ-article explains how to solve caching problems.

 

EPiTrace logger