try-convert
try-convert copied to clipboard
Consider how to handle a solution with a mix of SDK-style and non-SDK-style solutions
Are we doing anything wrong? Needs more investigation
I reported the original issue here: https://developercommunity.visualstudio.com/content/problem/1147329/mix-of-old-style-and-new-sdk-style-csproj-files-in.html I was on holiday for 3 weeks, hence the lack of response there. Afterwards I was unable to make further comments to the original post. I'm still not clear under what account was my original issue saved, I only got a GUID as identifier: edd484c5-ca31-6838-a311-9162dd56dded
I had not realised this could be a general issue when mixing old-style with the new SDK-style projects since this was my first attempt with the new system. I stumbled upon the same GitHub issue (https://github.com/dotnet/msbuild/issues/4303) but since I had used none of the switches mentioned there plus it was over a year old, I thought it's unrelated.
"It would be great if you could engage there and share any projects (or code) if you like. Any shared example project/solution would help narrow things down a lot."
Can you not use the code I uploaded for the issue? It's only empty projects in a solution with no code. I could upload it to GitHub myself if there's a policy against this. Just please tell me how.
"Engage on github with you to see if there are deficiencies with try-convert that can be solved in a straightforward way"
Unfortunately since I have zero experience with the SDK-style system, I'm not sure what I could do to help. Before I started working on this, I had made a list with available tools for this .csproj conversion and ended up with these:
Microsoft : https://github.com/dotnet/try-convert CsprojToVs2017 : https://github.com/hvanbakel/CsprojToVs2017 Brian Lagunas : https://github.com/brianlagunas/ConvertProjectToCore3
Since try-convert was mentioned in the official MS posts regarding .NET Core updates, I did not look into the other ones further. Maybe I could try the same conversion to see if the same solution works with any of the other ones and report back here. But this will take a while...
We ran into the same problem today and we were able to identify the root problem to some extent. The problem only comes up when there are Project Dependencies
setup between a different projects.
Example
ProjectA (net472)
Depends on:
ProjectB (net472,net5.0)
Important: With "Depends on:" I'm not referring to normal project references but to the project dependencies you can setup for the whole solution.
I think the correct issue on this topic is this: https://github.com/dotnet/msbuild/issues/2274
This is an interesting article on what those project dependencies actually do when building via msbuild: https://www.cazzulino.com/project-dependencies-as-project-references.html