Skip to content

Commit

Permalink
Update CONTRIBUTION.md with MEF error diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
gasparnagy authored Jun 14, 2024
1 parent 06b3c01 commit 0c08f15
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CONTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,9 @@ Starting Visual Studio every time to just check if a button is at a right positi
* Once you have selected the proper run settings (see above), all tests should pass locally. The tests in the `Reqnroll.VisualStudio.Specs` might take longer for the first time, but they cache the necessary packages so for the subsequent runs they are fast.

* Doing test-driven development might require to build the project regularly, but the installation of the package to the Visual Studio Experimental Instance takes quite much time. To overcome that, you can switch from the "Debug" configuration to "TestDebug" that does not compile the `Reqnroll.VisualStudio.Package` project by default. Since this project does only packaging and does not contain testable logic, you can run the tests locally without building this project. Once you are ready to test it in Visual Studio Experimental Instance, you can build the `Reqnroll.VisualStudio.Package` project explicitly by invoking the "Build" command from the project node in solution explorer.

## Diagnosing MEF Composition Errors

Visual Studio and also our plugin uses [Managed Extensibility Framework (MEF)](https://learn.microsoft.com/en-us/dotnet/framework/mef/) for managing the dependencies. Unfortunately diagnosing MEF problems is hard, because the error messages are not very descriptive.

For diagnosing MEF composition errors, you can check the [article by Daniel Plaisted](https://learn.microsoft.com/en-us/archive/blogs/dsplaisted/how-to-debug-and-diagnose-mef-failures) that contains a lot of useful ideas. Unfortunately we could not figure out how to enable logging in Visual Studio, but in case of any errors, **you should check the component cache error log file**. The file is a text file with name `Microsoft.VisualStudio.Default.err` and it is located in the `ComponentModelCache` folder of the Visual Studio user configuration folder. For the Visual Studio Experimental Instance, this is `C:\Users\<your-user>\AppData\Local\Microsoft\VisualStudio\17.0_921b0c10Exp\ComponentModelCache\Microsoft.VisualStudio.Default.err`. You can search for "Reqnroll" in this file and you might find information about the composition error causes the problems.

0 comments on commit 0c08f15

Please sign in to comment.