none
The type exists in both App_Code & Website. RRS feed

  • Question

  • Hi,
    I have a website open in Visual Studio 2015 which were developed in Visual Studio 2005.

    I have build it and getting below error-
    The type ‘Log’ exists in both 1_App_code, version=0.0.0.0, Culture=neutral, PublicKeyToken=null’ and ‘WebMail, version5.0.0.0, Culture=neutral, PublicKeyToken=null’

    I am using Log.cs file for logging purpose and file available under App_Code folder.

    Please suggest.

    Thanks.
    Monday, May 23, 2016 1:04 PM

Answers

  • The Log class is found in two referenced assemblies, thus it's ambiguous and the compiler cannot tell what to use.

    So qualify out used Log class explicitly with a namespace.

    The problem is imho, that you're using general names in different places.

    • Proposed as answer by Albert_Zhang Thursday, June 2, 2016 4:10 PM
    • Marked as answer by DotNet Wang Monday, June 6, 2016 2:59 AM
    Monday, May 23, 2016 1:47 PM