dotnet / NuGet.BuildTasks

The build tasks used to pick up package content from project.lock.json.
MIT License
45 stars 61 forks source link

Improving error messages for non project.json based projects #47

Closed mishra14 closed 6 years ago

mishra14 commented 6 years ago

Fixes: https://github.com/NuGet/Home/issues/6959

This PR improves the error experience for non project.json based projects. Primarily improves the error message for missing RID from -

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.targets(186,5): error : Your project.json doesn't have a runtimes section. You should add '"runtimes": { "win": { } }' to your project.json and then re-run NuGet restore.

to -

C:\Program Files (x86)\Microsoft Visual Studio\2017Stable\Enterprise\MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.targets(186,5): error : Your project csproj file doesn't list 'win' as a targeted runtime. You should add 'win' to the "RuntimeIdentifiers" property in your project csproj file and the n re-run NuGet restore. [E:\NuGet.BuildTasks\src\Microsoft.NuGet.Build.Tasks.Tests\Microsoft.NuGet.Build.Tasks.Tests.csproj]

Plus addimng tests for non project.json based scenarios.

mishra14 commented 6 years ago

@tmeschter can you please review?

tmeschter commented 6 years ago

Remember that once the changes are merged in here, they'll need to be copied over to the VS repo. Ping me if you need help with that.

mishra14 commented 6 years ago

@jainaashish @nkolev92 🔔