question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet publish -r only works for win10-x64

See original GitHub issue

For web and mvc projects, dotnet publish -r only works for win10-x64.

For osx-x64 or linux-arm for example, you get a hostpolicy.dll not found error.

*Does this mean we can’t build and publish for OTHER machines (not the local machine)?

C:\Users\scott\Desktop\rasppiwebempty>dotnet publish -r osx-x64
Microsoft (R) Build Engine version 15.3.406.54721 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  rasppiwebempty -> C:\Users\scott\Desktop\rasppiwebempty\bin\Debug\netcoreapp2.0\osx-x64\rasppiwebempty.dll
  Could not find required library hostpolicy.dll in 3 probing paths:

    C:\Users\scott\.nuget\packages

    C:\Users\scott\.dotnet\NuGetFallbackFolder

    C:\Program Files\dotnet\sdk\NuGetFallbackFolder

  A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Users\scott\Desktop\rasppiwebempty\bin\Debug\netcoreapp2.0\osx-x64\'.

C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.razor.viewcompilation\2.0.0-rtm-26343\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.targets(60,5): error MSB3073: The command ""C:\Program Files\dotnet\dotnet.exe" exec --runtimeconfig "C:\Users\scott\Desktop\rasppiwebempty\bin\Debug\netcoreapp2.0\osx-x64\rasppiwebempty.runtimeconfig.json" --depsfile "C:\Users\scott\Desktop\rasppiwebempty\bin\Debug\netcoreapp2.0\osx-x64\rasppiwebempty.deps.json" "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.razor.viewcompilation\2.0.0-rtm-26343\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.dll" @"obj\Debug\netcoreapp2.0\osx-x64\microsoft.aspnetcore.mvc.razor.viewcompilation.rsp"" exited with code -2147450749. [C:\Users\scott\Desktop\rasppiwebempty\rasppiwebempty.csproj]

C:\Users\scott\Desktop\rasppiwebempty>dotnet publish -r win10-x64
Microsoft (R) Build Engine version 15.3.406.54721 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  rasppiwebempty -> C:\Users\scott\Desktop\rasppiwebempty\bin\Debug\netcoreapp2.0\win10-x64\rasppiwebempty.dll
  rasppiwebempty -> C:\Users\scott\Desktop\rasppiwebempty\bin\Debug\netcoreapp2.0\win10-x64\publish\

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pranavkmcommented, Jul 19, 2017

@moozzyk

dotnet publish -o "C:\TempPublish\site_win" -c Release
dotnet publish -o "C:\TempPublish\site" -c Release -r debian-x64 /p:MvcRazorCompileOnPublish=false

copy c:\TempPublish\site_win\App.PrecompiledViews.dll c:\TempPublish\site\
0reactions
moozzykcommented, Jul 19, 2017

Interesting… I tried $env:MvcRazorCompileOnPublish="False" and could not make it work but /p:MvcRazorCompileOnPublish=false did the trick.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet publish -r only works for win10-x64 · Issue #2105
For web and mvc projects, dotnet publish -r only works for win10-x64. For osx-x64 or linux-arm for example, you get a hostpolicy.dll not ......
Read more >
Publish .NET apps with the .NET CLI
This article demonstrates how you can publish your .NET application from the command line. .NET provides three ways to publish your ...
Read more >
Can I shrink a dotnet publish package
I am using the CLI and as I am only interested in Win 10 deployments, tried dotnet publish -c release -r win10-x64. It...
Read more >
Too many dlls when publishing dotnet
dotnet publish -c Release -r win10-x64 --self-contained. It worked. However, the folder contained a huge amount of dlls even though I typed ...
Read more >
Publishing DotNET Core Apps
1\win10-x64\publish folder in Windows Explorer, we see whole lot of files, together, all these files are enough to run the app on another ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found