VS2017 15.8.2 publishing error (.NET Core 2.1)

心已入冬 提交于 2019-12-18 06:13:07

问题


Last week it was working perfectly!!!

Now, after download and install the update "15.8.2", when I try to publish my app the final step is failing. I mean, while the build process is carried out with no problem, the publish process is returning with the following error:

"NETSDK1061: The project was restored using Microsoft.NETCore.App version 2.1.3, but with current settings, version 2.1.3-servicing-26724-03 would be used instead. To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore. For more information, see https://aka.ms/dotnet-runtime-patch-selection.".

Note: If I move to another PC with Vs2017 (15.8.1) everything works as expected.

Please, do not mark this question as duplicated, because it is not. I have already read all the post, blogs, answers out there, but none of them give a real solution. I haven't upgraded any package to 2.1.2 nor 2.1.3, all my packages are referencing 2.1.1, with no exception. I have double checked all my configurations and everything seems to be okay , I've followed all the guidelines out there and nothing seems to be the real solution.

Note: My publishing settings are the following:

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <WebPublishMethod>FileSystem</WebPublishMethod>
        <PublishProvider>FileSystem</PublishProvider>
        <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
        <LastUsedPlatform>Any CPU</LastUsedPlatform>
        <SiteUrlToLaunchAfterPublish />
        <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
        <ExcludeApp_Data>False</ExcludeApp_Data>
        <ProjectGuid>73d9d7f6-a8ff-4543-99e0-6af66bba4509</ProjectGuid>
        <publishUrl>bin\Release\netcoreapp2.1\publish\</publishUrl>
        <DeleteExistingFiles>True</DeleteExistingFiles>
        <TargetFramework>netcoreapp2.1</TargetFramework>
        <SelfContained>false</SelfContained>
        <_IsPortable>true</_IsPortable>
        <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    </PropertyGroup>
</Project>

As you can see, my deployment is not Self-Contained. It is framework dependand


回答1:


Uninstall Microsoft .NET Core SDK 2.1.401 (x64) then reinstall.

This is a bug in 15.8.2.

You can download the Core SDK for the reinstall here.



来源:https://stackoverflow.com/questions/52098812/vs2017-15-8-2-publishing-error-net-core-2-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!