Visual Studio 2017 published projects in Ubuntu run error *.deps.json is not found

Source: Internet
Author: User

Original website: 79039160

Today's strange phenomenon is that the ASP. NET Core app published on Windows is not a good place to deploy to Linux. The following error is indicated:

    Error:    Anwas not found:    package: ‘Microsoft.AspNetCore.Antiforgery’, version: ‘2.0.1’    path: ‘lib/netstandard2.0/Microsoft.AspNetCore.Antiforgery.dll’    This assembly was expected to be in the local runtime store as the application was published using the following target manifest files:    aspnetcore-store-2.0.3.xml

This is the error I showed when I ran my own post on Ubuntu.

Error:  Anwas not found:    package‘Microsoft.AspNetCore.Antiforgery‘‘2.0.3‘    path‘lib/netstandard2.0/Microsoft.AspNetCore.Antiforgery.dll‘  This assembly was expected to be in the local runtime store as the application was published using the following target manifest files:    aspnetcore-store-2.0.8.xml

Copy the source code to the Linux machine, can compile, can be run in the development mode, (as if in debug mode is also successful), and later released in release mode, you can not run, prompt the above error.

After a day of Daoteng, finally, finally, is a small problem. The problem is that ASP. NET does not publish all the packages the server needs, it thinks the target system is with it, and actually does not have it in the target system.

Workaround:

Add the following line to the Csjproj file:

<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>

The final csjproj file looks like this:

<Project Sdk="Microsoft.NET.Sdk.Web">  <PropertyGroup>    <TargetFramework>netcoreapp2.0</TargetFramework>    <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>  </PropertyGroup>

Visual Studio 2017 published projects in Ubuntu run error *.deps.json is not found

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.