microsoft / MSBuildSdks

MSBuild project SDKs
MIT License
456 stars 81 forks source link

Latest VS does not work with Microsoft.Build.CentralPackageVersions ASP.NET Classic v.NET 4.8 #195

Closed opejanovic closed 2 years ago

opejanovic commented 4 years ago

Hi, I have been using Microsoft.Build.CentralPackageVersions for 2-3 years without problem, but the latest VS versions (16.6 - 16.6.5, including 16.7 preview 5.0) seems to have problems with it. I cannot build it. Neither of mine collogues can. I even reported to M$ https://developercommunity.visualstudio.com/content/problem/1101682/systemaggregateexception-project-system-data-flow-1.html - but still no luck.

Do you guys have Microsoft.Build.CentralPackageVersions working with latest VS versions, and if so, can you share your project file? Please take a look into attached log files 147535-vsprojectfault-6252c7b8-2d71-408b-aad8-b581afaef50.txt 147534-vsprojectfault-8d4668cf-2184-4efe-bca3-6a69f6918f2.txt 145125-vsprojectfault-e59f1da9-8467-4d02-a5b2-021c9f7506b.txt

bddckr commented 4 years ago

I'm on 16.6.4 and do not have any issues.

This is with using the following in global.json

"Microsoft.Build.CentralPackageVersions": "2.0.79"

and using

<Sdk Name="Microsoft.Build.CentralPackageVersions" />

at the end of Directory.Build.targets.

opejanovic commented 4 years ago

I suppose that your project is .NET Core? Have you tried with classic .NET v4.8 and ASP.NET

bddckr commented 4 years ago

My solution is using (new SDK-style) csprojs for .NET Standard class libraries as well as a few .NET Core executable projects. Additionally there's a Xamarin.Android app project and multiple .NET Standard class libraries targeting monoandroid10.0 via MSBuild.Sdk.Extras. There is not a single project on .NET Framework, nor ASP.NET (nor ASP.NET Core) in this solution.

opejanovic commented 4 years ago

Here are the steps to reproduce in VS 16.6.x:

vchirikov commented 4 years ago

repro without VS: https://github.com/vchirikov/msbuild_issue_repro Linked issue: https://github.com/dotnet/msbuild/issues/5600

jeffkl commented 4 years ago

I'm unable to repro the issue. I've created this repository: https://github.com/jeffkl/msbuildsdks-195

When I load it in Visual Studio 16.6.5, the projects load correctly and build successfully. Can you identify what I'm doing wrong to reproduce the issue or set up a repository that reproduces the issue for you that I can clone?

vchirikov commented 4 years ago

@jeffkl thank you for your time, comment this line and run issue1 project.

https://github.com/vchirikov/msbuild_issue_repro/blob/30ce422c10ae77e3cbec0279f868737eb4cc9e3d/issue1/Program.cs#L1

also answered how to reproduce another issue.

opejanovic commented 4 years ago

@jeffkl I have created a sample project using Microsoft.Build.CentralPackageVersions. If you open it in VS 16.4 it will work without problems but if you try using VS 16.7 you will get "DataflowBlockSlim" exception. https://github.com/opejanovic/Microsoft.Build.CentralPackageVersions-VisualStudio_16.7-problem

jeffkl commented 4 years ago

@opejanovic I cloned your repo but wasn't able to get the DataflowBlockSlim exception. It wouldn't quite build either so I made these changes:

https://github.com/opejanovic/Microsoft.Build.CentralPackageVersions-VisualStudio_16.7-problem/compare/master...jeffkl:jeffkl-test?expand=1

And it builds for me. Can you try this branch and let me know what happens?

https://github.com/jeffkl/Microsoft.Build.CentralPackageVersions-VisualStudio_16.7-problem/tree/jeffkl-test

jeffkl commented 2 years ago

Closing due to inactivity, feel free to reopen if its still not working