Open rakatyal opened 6 years ago
A very similar issue: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/615683
netcoreapp2.0
to netcoreapp2.1
netcoreapp.2.1
to netcoreapp2.0
Expected: No error
Actual: Error
Error: Assets file 'C:\Users\javia\source\repos\ConsoleApp5\ConsoleApp5\obj\project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.0'. Ensure that restore has run and that you have included 'netcoreapp2.0' in the TargetFrameworks for your project.
Build needs to be blocked while nuget restore is ongoing.
@davkean - you said you understand this issue. Can you describe an approach for how to fix it for @jmarolf ?
I expect there's two issues;
In the first case, we're not getting initialized or data faster enough from design-time build to block build. We only block build after we get data from design-time build. In the second case, we're not getting called back quick enough to block the build until we've processed the change. I suspect we'd need to block the build after the project file has changed but before we've processed the change.
FYI, there is a feedback issue regarding this. https://developercommunity.visualstudio.com/content/problem/250035/new-project-system-does-not-update-state-appropria.html
Happens for simple .NET Framework projects, too. Why not default the build command to "disabled", enable once dependent features are available?
I am seeing an issue with our automated tests where sometimes the test projects we create (ASP.Net Core MVC Application) fail to build with the attached error:
I am also able to repro this on a new project with the MVC template if I build the solution very quickly right after loading the solution. Note that the solution builds fine on retrying or after waiting a while.
Looks like the build is not waiting for the restore to finish.