none
Build errors only when sources open

    Question

  • I have a large project moved from VS2013 now on 2015 community. If I build with not source files open, the build is successful. If I open an aspx  or apx.cs file, multiple errors show up in the error list (see below). The same occurs if  I build with the file(s) open:

    The web site runs without any issues. ... any suggestions?

    Abott


    Severity


    Code


    Description


    Project


    File


    Line


    Error


    CS0012


    The type '_Global' is defined in an assembly that is not referenced. You must add a reference to assembly 'App_Code.bglwmezy, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.


    KBO.Web-951


    E:\1Data\1DSI\1KBO_GIT\KBO\KBO.Web-951\default.aspx


    1


    Error


    CS0030


    Cannot convert type 'System.Web.HttpApplication' to 'ASP.global_asax'


    KBO.Web-951


    E:\1Data\1DSI\1KBO_GIT\KBO\KBO.Web-951\default.aspx


    1


    Error


    CS0012


    The type 'SkinBase' is defined in an assembly that is not referenced. You must add a reference to assembly 'App_Code.bglwmezy, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.


    KBO.Web-951


    E:\1Data\1DSI\1KBO_GIT\KBO\KBO.Web-951\default.aspx.cs


    45

    Friday, October 30, 2015 5:36 PM

Answers

  • Hi Abbott Fleur,

    Is this problem just occurred in Visual Studio 2015? Please create a new project with Visual Studio to troubleshoot whether this problem is related to Visual Studio 2015 or this specific web site.

    If it just occurred with a specific  web site. Please remove the .suo file in solution folder which saves user settings for current solution. Then check the dlls that errors mentioned not find, whether this dlls in the correct location first. You also can create a new web site in Visual Studio 2015, and then move the items from Visual Studio 2013 web site through "Add Existing Items".

    If it occurred with all type project in Visual Studio 2015, please troubleshooting this problem with below steps.

    1. Open Visual Studio 2015 as Administrator and please make sure your computer is not busy (such as CUP, Memory and so on).
    2. Run Visual Studio 2015 in safe mode with "Deven.exe /SafeMode" command to prevents all third-party VSPackages from loading when Visual Studio starts, thus ensuring stable execution.
    3. Reset all settings through Tools -> Options -> Import and Export settings -> Reset all settings.
    4. Try Repair Visual Studio 2015 in Control Panel -> Visual Studio 2015 -> Change -> Repair.

    If possible, please provide a sample project which has this problem on OneDrive and share the link here to help us reproduce the problem and figure out the problem.

    Best Regards,
    Weiwei


     

    Monday, November 2, 2015 9:47 AM
    Moderator

All replies

  • Hi Abbott Fleur,

    Is this problem just occurred in Visual Studio 2015? Please create a new project with Visual Studio to troubleshoot whether this problem is related to Visual Studio 2015 or this specific web site.

    If it just occurred with a specific  web site. Please remove the .suo file in solution folder which saves user settings for current solution. Then check the dlls that errors mentioned not find, whether this dlls in the correct location first. You also can create a new web site in Visual Studio 2015, and then move the items from Visual Studio 2013 web site through "Add Existing Items".

    If it occurred with all type project in Visual Studio 2015, please troubleshooting this problem with below steps.

    1. Open Visual Studio 2015 as Administrator and please make sure your computer is not busy (such as CUP, Memory and so on).
    2. Run Visual Studio 2015 in safe mode with "Deven.exe /SafeMode" command to prevents all third-party VSPackages from loading when Visual Studio starts, thus ensuring stable execution.
    3. Reset all settings through Tools -> Options -> Import and Export settings -> Reset all settings.
    4. Try Repair Visual Studio 2015 in Control Panel -> Visual Studio 2015 -> Change -> Repair.

    If possible, please provide a sample project which has this problem on OneDrive and share the link here to help us reproduce the problem and figure out the problem.

    Best Regards,
    Weiwei


     

    Monday, November 2, 2015 9:47 AM
    Moderator
  • I met the same issue in VS2015 and found that the code-behind Global.asx.cs is the cause and moving Global.asax.cs logic to Global.asax as inline code can solve the problem.

    After reporting to Microsoft Connect and getting feedback from support team, after some tests, I believe it is a bug of Productivity Power Tools 2015.

    More detail is in my blog post (in Chinese).


    Saturday, November 14, 2015 12:18 AM