Closed 33kelder closed 5 years ago
@oakrefactory is your .vcxproj project referenced by the test project?
Also is this actually causing your build to fail?
The build doesn't fail, it just gives an error message in the output section. I get the error message if I reference the project directly, but also if I don't reference it.
This issue is happening when the project is being opened with Roslyn. Probably Roslyn having trouble dealing with the reference to the .vcxproj project. Given that the problem is happening when the test project is being opened with workspace.OpenProjectAsync(testProjectPath)
, I would expect to only see the issue if the .vcxproj project is referenced by the test project.
Maybe try moving the stubs to a different project as describe in the Tips and Tricks section and let me know if that fixes the issue.
Good thing that it's not failing your build.
I also encourage you to try to debug it and maybe fix it yourself. SimpleStubs code is not much more complicated that any other C# code and the code base is quite small actually. The Dev Docs should get you started quickly.
I debugged the project. The diagnostic message is created when MSBuildWorkspace.OpenProjectAsync is called. It is not a message generated by SimpleStubs code. Supressing this message might have some unwanted side-effects. Since it is not failing the build, my suggesting is to leave it as it is.
In my solution there is a '.vcxproj' file. When compiling the unit test project with Etg.SimpleStubs, I get the error message: 1> Simplestubs encountered errors when opening the workspace; Stubs will be generated only for projects that successfully opened. Errors: [Failure] Cannot open project '.vcxproj' because the file extension '.vcxproj' is not associated with a language.
Adding the name of the project to the 'SimpleStubs.json' file in the 'IgnoredProjects' node, does not solve the error.