3F / MvsSln

🧩 Customizable VisualStudio .sln parser with project support (.vcxproj, .csproj., …). Pluggable lightweight r/w handlers at runtime, and more …
MIT License
135 stars 27 forks source link

XProjectByFile() can destroy original properties that was prepared for solution #29

Closed 3F closed 3 years ago

3F commented 3 years ago

The essence of the error is as follows,

For some new instance of XProjectEnv with specific sln properties:

https://github.com/3F/MvsSln/blob/cd39a8dff3b526d2294be1c2de2fdf93f51ecb86/MvsSln/Core/XProjectEnv.cs#L470-L475

*Using slnProperties we assume exactly sln properties.

Then, if we try to load the project that was not yet presented in collection, it will cause call XProjectByFile() with properties Configuration|Platform specified for this project. That's ok. However, it will also consider Configuration|Platform as a new pair for sln properties too.

This moment is possible whenever we need a call XProjectByFile(). It happens only when a specific project with the specific configuration has not yet been loaded at this point

https://github.com/3F/MvsSln/blob/cd39a8dff3b526d2294be1c2de2fdf93f51ecb86/MvsSln/Core/XProjectEnv.cs#L560-L565

And will cause error only if different cfg between sln and prj.

3F commented 3 years ago

The error is already fixed in my local branch, let me just write some tests for it.