none
Visual Studio 2017: Error when compiling project in MinimumRecommendedRules.ruleset file RRS feed

  • Question

  • I have a Visual Studio solution that includes a project when compiling it returns the following compilation error:

    CS8035 Error reading ruleset file C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Team Tools\Static Analysis Tools\Rule Sets\MinimumRecommendedRules.ruleset - Unable to load file or assembly 'System.Xml.ReaderWriter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The assembly manifest definition does not match the assembly reference. (Excepción de HRESULT: 0x80131040)

    I have no solution for this issue. I've been trying and searching in Google but I still haven't found what is happening with the project. Maybe is a framework installed problem?

    Thank you in advanced for your support.

    Regards


    Matt

    Wednesday, October 9, 2019 12:42 PM

Answers

  • I've installed Visual Studio 2019 now. Opening the solution with that IDE, works. So, for understanding this situation, what do you believe that it could be happening with my solution?

    Matt

    • Marked as answer by Levimatt 14 hours 55 minutes ago
    Monday, October 14, 2019 1:02 PM

All replies

  • Hi Levimatt,

    Welcome to the MSDN forum.

    What is the type of your project? What is the Framework version of your project? If your agent does not have Framework 4.0, you can download from here and install it.

    Or you can reinstall the package again by type this command under Package Manager Console. It is possible that there is another version in reference properties.

    update-package -Reinstall

    > >BTW, please check if there is a version other than xml.readerwriter 4.0 in the xxproj file, and change it to be consistent.

    In addition to this, you can provide more useful information such as the xxproj file ,app.config and packages.config in order to solve the problem more effectively.

    Any feedback will be expected.

    Best Regards,

    Perry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com




    Thursday, October 10, 2019 3:07 AM
  • My project is developed upon .NET Framework 4.5.1.

    It's a TFS project and I'm afraid that if I modify some library data or install a different framework from the one it has installed it could damage all the project.


    Matt

    Thursday, October 10, 2019 11:14 AM
  • Hi Levimatt,

    As you said, you download the project from TFS, did you update any nuget packages to the latest? Did you try my steps to troubleshoot your issue? You can double click the error on the error list and locate into the specific location to troubleshoot problems.

    If you do any changes to the project which are complex and irreversible, we suggest you should re-download the project from TFS. And do not forget to do these:   

      1. delete the bin and obj folder 

      2. delete .vs folder under the under the physical path of your solution and rebuild your solution several times.

      3. try to reinstall the nuget package and make sure that the versions of the related references are the same in proj file and packages.config. Or reinstall the nuget package as l said.

    You can refer to this document.

    >>If you have any concern or it does not work, please feel free to let us know.We will help you further.

    Best Regards,

    Perry

      

        

         


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com






    Friday, October 11, 2019 5:03 AM
  • What is the package related to System.Xml.ReaderWriter that I had to reinstall? I can't find that Nuget package in my solution. 

    Matt

    Friday, October 11, 2019 9:43 AM
  • Hi Levimatt,

    Right-click on your project and then click"Manage Nuget Packages" but the premise is that you have already installed nuget in the VS installer.

    Then you can see the nuget installed under your solution.Then you can check it version and reinstall it.

    >>input the command "update-package -Reinstall" under the Tools-->Nuget Package Manager-->Package Manager Console.

    Look forward to hearing from you.

    Best Regards,

    Perry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Friday, October 11, 2019 10:43 AM
  • Doing what you say I get a list of all package installed but I can't find the one related to System.Xml.ReaderWriter.

    Matt

    Monday, October 14, 2019 8:57 AM
  • Hi Levimatt,

    It seems that you have already missed the nuget package.(right-click on the solution on the Solution Explorer and click Restore Nuget Package).

    > >Or Please right-click on your project-->Manage Nuget Packages and then select Browse just and download the related nuget package as the picture shows:


    Any feedback will be expected.

    Best Regards,

    Perry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com



    Monday, October 14, 2019 10:24 AM
  • I've installed Visual Studio 2019 now. Opening the solution with that IDE, works. So, for understanding this situation, what do you believe that it could be happening with my solution?

    Matt

    • Marked as answer by Levimatt 14 hours 55 minutes ago
    Monday, October 14, 2019 1:02 PM
  • Hi Levimat,

    I'm sorry I misunderstood your question. Here I sincerely apologize to you. At the same time, congratulations on your success in solving the problem.

    At first, I didn't find the DLL locally, so I thought your project referenced it through nuget. Think of it as a package reference or versioning problem.

    But through your answer, I agree with you. This seems to be about the framework or vs installation. Maybe there was a problem during the installation process and code analysis could not find the DLL to call.

    Since your question has been solved, we suggest that you mark your reply as answer, so that it will help more community members search and discuss similar questions.

    Have a nice day!

    Best Regards,

    Perry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    17 hours 4 minutes ago