When i want to build my solution in Visual studio I often (4 of the 5 build tries) get the error message:
System.AggregateException: One or more errors occurred. ---> Microsoft.Build.Shared.InternalErrorException: MSB0001: Internal MSBuild Error: MSB0001: Internal MSBuild Error: Request 0 refers to configuration 18 which is not known to the engine.
configuration 18 can be an other number.
If i try to build several times i see that its saying: " -> Using default config". then the build runs fine.
Done:
- I compared the .SLN and the .PROJC files. they are in sync.
- I also tied to play with different configurations
- Searched the internet, but without something i understand
does anyone know how i can make it always to use the default config?
thanks in advance
You can try the below methods:
1, Clean and Rebuild:
Sometimes, lingering files from previous builds can cause issues. Try cleaning the solution (right-click on the solution in Solution Explorer and choose Clean Solution) and then rebuilding it (right-click on the solution and choose Rebuild Solution).
2, Clear .vs folder:
The .vs folder under the solution folder sometimes broken and you may encounter some strange issue. You can delete the .vs folder under the solution folder, and then you can restart the Visual Studio, the .vs folder will be regenerated.
3, Try Building from Command Line:
This is a very important method, By using this you can narrow down the issue and know this issue is a VS issue or a compiler issue.
Try building your solution from the command line using MSBuild to see if the issue persists. This can sometimes give more detailed error messages which can help diagnose the issue.
4, Reset the settings:
You can refer to this answer about how to reset settings of VS:
Visual Studio cw snippet works, but then doesn't when I do it again