Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to package on dotnet sdk > 3.1.102 #148

Closed
areis422 opened this issue Apr 6, 2020 · 4 comments · Fixed by #155
Closed

Failure to package on dotnet sdk > 3.1.102 #148

areis422 opened this issue Apr 6, 2020 · 4 comments · Fixed by #155

Comments

@areis422
Copy link

areis422 commented Apr 6, 2020

Packaging seems to work when using dotnet msbuild /t:CreateDeb..... but NOT when running dotnet deb .....

dotnet deb runs fine on any dotnet 3.1 sdk <= 3.1.102, but any newer versions are throwing the following errors:

/usr/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018: The "ProcessFrameworkReferences" task failed unexpectedly.
/usr/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018: System.IO.FileNotFoundException: Could not load file or assembly 'NuGet.Frameworks, Version=5.5.0.4, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
/usr/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018:
/usr/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018: File name: 'NuGet.Frameworks, Version=5.5.0.4, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
/usr/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018:    at System.Linq.Enumerable.WhereEnumerableIterator`1.ToList()
/usr/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018:    at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
/usr/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018:    at Microsoft.NET.Build.Tasks.ProcessFrameworkReferences.ExecuteCore()
/usr/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018:    at Microsoft.NET.Build.Tasks.TaskBase.Execute()
/usr/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
/usr/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
/usr/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018:
/usr/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018:

System Specs:
Ubuntu 18.04
Kernel 5.3.0-45-generic
dotnet version: 3.1.201
dotnet-deb version: 0.1.155+9e4041d64a

@fori920
Copy link

fori920 commented Apr 13, 2020

You can try this workaround:

dotnet restore # first restore
dotnet deb --no-restore # then create the package

@areis422
Copy link
Author

areis422 commented Apr 13, 2020 via email

@atauenis
Copy link

atauenis commented Apr 26, 2020

Have similar problem on Win7 x64 (Russian)+Visual Studio 2019.
Probably localized error messages can be translated by Google (but it's not need, the errors are same as areis422 said).

D:\WebOne>dotnet zip -c Release
dotnet zip (0.1.155+9e4041d64a)
__________________________________________________
Проект "D:\WebOne\WebOne.csproj" (целевые объекты Restore):

__________________________________________________
Проект "D:\WebOne\WebOne.csproj" создает "D:\WebOne\WebOne.csproj"
 (целевые объекты _GenerateRestoreGraphProjectEntry):

C:\Program Files\dotnet\sdk\3.1.201\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET
.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018: непредвиденная о
шибка при выполнении задачи ProcessFrameworkReferences".
C:\Program Files\dotnet\sdk\3.1.201\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET
.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018: System.IO.FileNo
tFoundException: Could not load file or assembly 'NuGet.Frameworks, Version=5.5.
0.4, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Не удается найти указанн
ый файл.
C:\Program Files\dotnet\sdk\3.1.201\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET
.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018: File name: 'NuGe
t.Frameworks, Version=5.5.0.4, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

C:\Program Files\dotnet\sdk\3.1.201\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET
.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018:    at System.Lin
q.Enumerable.WhereEnumerableIterator`1.ToList()
C:\Program Files\dotnet\sdk\3.1.201\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET
.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018:    at System.Lin
q.Enumerable.ToList[TSource](IEnumerable`1 source)
C:\Program Files\dotnet\sdk\3.1.201\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET
.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018:    at Microsoft.
NET.Build.Tasks.ProcessFrameworkReferences.ExecuteCore()
C:\Program Files\dotnet\sdk\3.1.201\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET
.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018:    at Microsoft.
NET.Build.Tasks.TaskBase.Execute()
C:\Program Files\dotnet\sdk\3.1.201\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET
.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018:    at Microsoft.
Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execu
te()
C:\Program Files\dotnet\sdk\3.1.201\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET
.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018:    at Microsoft.
Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecuti
onHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket buc
ket, TaskExecutionMode howToExecuteTask)
C:\Program Files\dotnet\sdk\3.1.201\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET
.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018:
C:\Program Files\dotnet\sdk\3.1.201\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET
.Sdk.FrameworkReferenceResolution.targets(59,5): error MSB4018:
Сборка проекта "WebOne.csproj" завершена с ошибкой.
Failed to restore 'WebOne.csproj'. Please run dotnet restore, and try again.

D:\WebOne>dotnet restore
  Восстановление завершено в 60,22 ms для D:\WebOne\WebOne.csproj.

D:\WebOne>dotnet zip --no-restore -c Release
dotnet zip (0.1.155+9e4041d64a)
Microsoft (R) Build Engine версии 16.5.0+d4cbfca49 для .NET Core
(C) Корпорация Майкрософт (Microsoft Corporation). Все права защищены.

  WebOne -> D:\WebOne\bin\Release\netcoreapp3.1\WebOne.dll
  WebOne -> D:\WebOne\bin\Release\netcoreapp3.1\publish\
  Creating zip package D:\WebOne\bin\Release\netcoreapp3.1\WebOne.0.10.0.zip

D:\WebOne>

@qmfrederik
Copy link
Collaborator

This seems to be a regression in .NET Core 3.1, see microsoft/MSBuildLocator#86 . Let's see if the workaround works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants