After the last set of changes, I was dismayed to find that Visual Studio builds were failing with a very odd error. Strangely, builds run from the commandline were working fine - here’s how I resolved the issue.
When building in Visual Studio, the build failed with errors like these:
Error: Roslyn compiler server reports different hash version than build task.
WordTutor.Core.Tests
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets
Error: CS0006
Metadata file 'C:\GitHub\wordtutor\src\WordTutor.Core\bin\Debug\netcoreapp3.0\WordTutor.Core.dll' could not be found
WordTutor.Desktop(Messages reformatted for clarity.)
A thorough Google search didn’t reveal any obvious answers, so I started looking into whether there were any pending updates that might make the problem go away.
Updating to .NET Core 3.1
Since I was running on .NET Core 3.0, I tried updating to the latest version of the runtime to see if my issue was caused by running on a prerelease version.
That changed the errors … but didn’t fix the problem.
Severity Code Description Project File Line Suppression State Error CS0006 Metadata file ‘C:\GitHub\wordtutor\src\WordTutor.Core\bin\Debug\netcoreapp3.0\WordTutor.Core.dll’ could not be found WordTutor.Desktop C:\GitHub\wordtutor\src\WordTutor.Desktop\CSC 1 Active Warning MC3074 The tag ‘Interaction.Triggers’ does not exist in XML namespace ‘http://schemas.microsoft.com/xaml/behaviors’. Line 48 Position 14. WordTutor.Desktop C:\GitHub\wordtutor\src\WordTutor.Desktop\VocabularyBrowserView.xaml 48 Error NETSDK1005 Assets file ‘C:\GitHub\wordtutor\src\WordTutor.Core\obj\project.assets.json’ doesn’t have a target for ‘.NETCoreApp,Version=v3.1’. Ensure that restore has run and that you have included ‘netcoreapp3.1’ in the TargetFrameworks for your project. WordTutor.Core C:\Program Files\dotnet\sdk\3.1.100-preview3-014645\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 234 Error NETSDK1005 Assets file ‘C:\GitHub\wordtutor\tests\WordTutor.Core.Tests\obj\project.assets.json’ doesn’t have a target for ‘.NETCoreApp,Version=v3.1’. Ensure that restore has run and that you have included ‘netcoreapp3.1’ in the TargetFrameworks for your project. WordTutor.Core.Tests C:\Program Files\dotnet\sdk\3.1.100-preview3-014645\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 234 Error NETSDK1005 Assets file ‘C:\GitHub\wordtutor\src\WordTutor.Desktop\obj\project.assets.json’ doesn’t have a target for ‘.NETCoreApp,Version=v3.1’. Ensure that restore has run and that you have included ‘netcoreapp3.1’ in the TargetFrameworks for your project. WordTutor.Desktop C:\Program Files\dotnet\sdk\3.1.100-preview3-014645\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 234 Error NETSDK1005 Assets file ‘C:\GitHub\wordtutor\tests\WordTutor.Desktop.Tests\obj\project.assets.json’ doesn’t have a target for ‘.NETCoreApp,Version=v3.1’. Ensure that restore has run and that you have included ‘netcoreapp3.1’ in the TargetFrameworks for your project. WordTutor.Desktop.Tests C:\Program Files\dotnet\sdk\3.1.100-preview3-014645\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 234
—–=====*****=====—–
No good. Roll back the changes.
—–=====*****=====—–
What version of Visual Studio?
—–=====*****=====—–
Microsoft Visual Studio Enterprise 2019 Preview Version 16.4.0 Preview 6.0 VisualStudio.16.Preview/16.4.0-pre.6.0+29519.161 Microsoft .NET Framework Version 4.8.04070
—–=====*****=====—–
Dotnet version
—–=====*****=====—–
C:\Users\Bevan
⌧ 1 20:22:48 PS> dotnet –version
3.1.100-preview3-014645
—–=====*****=====—–
Check the version of Visual studio - we have an update to 16.5.0 Preview 1
—–=====*****=====—–
Microsoft Visual Studio Enterprise 2019 Preview Version 16.5.0 Preview 1.0 VisualStudio.16.Preview/16.5.0-pre.1.0+29521.150 Microsoft .NET Framework Version 4.8.04070
—–=====*****=====—–
Reload and build




Comments
blog comments powered by Disqus