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.

Publishing from Windows to Linux no longer working after upgrading to VS2017 / csproj

See original GitHub issue

Steps to reproduce

I have a website powered by ASP.NET Core 1.1.1: https://github.com/Daniel15/Website. I’m trying to upgrade from VS2015 to VS2017. To publish the site, I’m running a command like this:

dotnet publish . -o "c:\TempPublish\site" -c Release -r debian-x64

And then rsyncing the directory to my Linux server. I specify the target runtime as debian-x64 to avoid Windows-specific binaries in the output dir (eg. libuv.so instead of libuv.dll)

Expected behavior

Build works. This works fine with the old project.json format.

Actual behavior

When I try it with the converted csproj I get:

C:\Program Files\dotnet\sdk\1.0.0\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.targets(92,5): error : Assets file ‘C:\src\dan.cx\Daniel15.Web\obj\project.assets.json’ doesn’t have a target for ‘.NETFramework,Version=v4.5.2/debian-x64’. Ensure you have restored this project for TargetFramework=‘net452’ and RuntimeIdentifier=‘debian-x64’. [C:\src\dan.cx\Daniel15.Web\Daniel15.Web.csproj]

When I remove -r debian-x64 from the publish command, the resulting built site doesn’t actually run on Mono any more - I get Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.. It looks like it’s copying a Windows build of System.Runtime.InteropServices.RuntimeInformation rather than a Linux build, at least judging by the paths in the PDBs (D:\A\_work\39\s\bin\obj\Windows_NT.AnyCPU.Release\... vs D:\A\_work\39\s\bin\obj\Unix.AnyCPU.Release...).

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0)

Product Information:
 Version:            1.0.0
 Commit SHA-1 hash:  e53429feb4

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.15031
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\1.0.0

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Daniel15commented, Mar 21, 2017

I’m the person that opened https://github.com/aspnet/MvcPrecompilation/issues/102, I forgot to close this issue. Let’s track it there 😃

0reactions
pranavkmcommented, Mar 21, 2017

I think there’s a couple issues around the tool failing in the precompilation repo:

We can use these to track the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Publishing from Windows to Linux no longer working after ...
To publish the site, I'm running a command like this: dotnet publish . ... Linux no longer working after upgrading to VS2017 /...
Read more >
VS2017 15.3.2 Web Publish no longer works
Open the solution in Visual Studio · Exclude the publishprofiles directory (under properties) from the solution · Open the parent properties ...
Read more >
Ask Question
On "Hosted VS2017" and self-hosted build agent (Windows Server 2012 R2), running dotnet publish with a publish profile specified fails with: C:\ ...
Read more >
Project migration and upgrade reference for Visual Studio
Project migration and upgrade reference for Visual Studio ... require that you update a project so that it's no longer backwards-compatible.
Read more >
Announcing .NET Core, .NET Native and NuGet Updates in ...
Select the Microsoft.NETCore.UniversalWindowsPlatform NuGet package. Change the version to 5.3.0. Click the Update button. vsnugetupdate. If you ...
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