locked
FxCop error on Vsix project VS2015 RRS feed

  • Question

  • With VS2015 Enterprise I have created a new "Analyzer with Code Fix (NuGet + VSIX)" project. It works fine, but when I run the Microsoft FxCop rules on the solution I always got the following exceptions:

    Warning    CA0001    CA0001 : Resolved system assembly 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\Facades\System.Runtime.dll' doesn't define type 'System.Object'. Are you sure you have provided the correct system assembly?. Provided system assembly might be a facade assembly targeting another platform, such that it has only metadata and no IL. You can verify this by executing 'ildasm.exe' on this assembly.

                
    Error    CA0055    CA0055 : Could not load C:\Users\evovape3\Documents\Visual Studio 2015\Projects\Analyzer3\Analyzer3\Analyzer3.Vsix\bin\Debug\Analyzer3.dll. The following error was encountered while reading module 'System.Runtime': Assembly reference cannot be resolved: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.      

    There was a similar problem (https://support.microsoft.com/en-us/kb/2971005), but here the build failed. After installing Microsoft .NET Framework 4.5.2 Developer Pack the errors disappeared, but a new error appeared:

    Error    CA0055    CA0055 : Could not load c:\...\visual studio 2015\Projects\Analyzer4\Analyzer4\Analyzer4.Vsix\bin\Debug\Analyzer4.dll. The following error was encountered while reading module 'mscorlib': Security attribute type does not have a default constructor: System.Security.Permissions.HostProtectionAttribute, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.    

    I think this look a .NET issue. Do anyone has an idea how to solve this problem?

    Thanks and Regards,

    Peter

    Monday, August 10, 2015 7:50 AM

All replies

  • Error    CA0055    CA0055 : Could not load c:\...\visual studio 2015\Projects\Analyzer4\Analyzer4\Analyzer4.Vsix\bin\Debug\Analyzer4.dll. The following error was encountered while reading module 'mscorlib': Security attribute type does not have a default constructor: System.Security.Permissions.HostProtectionAttribute, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.    

    Hi Peter,

    Could you please show us the code?

    >>With VS2015 Enterprise I have created a new "Analyzer with Code Fix (NuGet + VSIX)" project.

    I'm not sure how to create such kind of project, can you show me how?


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Caillen Friday, August 14, 2015 6:05 AM
    Friday, August 14, 2015 6:03 AM
  • Hi Caillen,

    You need to download the .NET Platform Compiler SDK:

    https://visualstudiogallery.msdn.microsoft.com/2ddb7240-5249-4c8c-969e-5d05823bcb89

    Then the "Analyzer with Code Fix (NuGet + VSIX)" template appears.

    The problem can be reproduced creating a project from that template.


    * My new blog about VSX: http://www.visualstudioextensibility.com * Twitter: https://twitter.com/VSExtensibility * MZ-Tools productivity extension for Visual Studio: http://www.mztools.com.

    Friday, August 14, 2015 11:37 AM
  • Yes I do it in the same way. I could solve the problem, but it is only a huge workaround: I created a simple project instead of the portable one. And if I do not use the portable libraries the errors are disappearing.

    Monday, August 31, 2015 8:47 AM