C
C
CJDmitry2019-02-07 14:31:14
ASP.NET
CJDmitry, 2019-02-07 14:31:14

What is the error when publishing an ASP Net Core application?

Need to offline publish an ASP Net Core app to a local folder but throws an error (below). Though the publication dependent on a platform transits without problems. I'm using ASP Net Core version 2.2
Error:
Vhealth.WebClientCore2 -> D:\OneDrive\Net Framework Core\Vector Health Core\Vhealth.WebClientCore2\bin\Release\netcoreapp2.2\win-x64\Vhealth.WebClientCore2.dll
C:\ Program Files\dotnet\sdk\2.2.103\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(116,5): Error NETSDK1031: Building or publishing a standalone application without specifying a RuntimeIdentifier is not supported. Specify a RuntimeIdentifier or set the SelfContained property to "false".

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Satisfied IT, 2019-02-07
specialist @borisdenis

Specify a RuntimeIdentifier or set the SelfContained property to "false".

https://docs.microsoft.com/en-us/dotnet/core/deplo...
Visual Studio creates a separate publish profile (*.pubxml) for each target platform. For example, the linux profile file (linux.pubxml) looks like this:
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121. 
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <PublishProtocol>FileSystem</PublishProtocol>
    <Configuration>Release</Configuration>
    <Platform>Any CPU</Platform>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <PublishDir>bin\Release\netcoreapp2.1\publish\linux</PublishDir>
    <RuntimeIdentifier>win-x86</RuntimeIdentifier>
    <SelfContained>true</SelfContained>
    <_IsPortable>false</_IsPortable>
  </PropertyGroup>
</Project>

Open such a file and see what is indicated in <RuntimeIdentifier>win-x86</RuntimeIdentifier>, available identifier options here https://docs.microsoft.com/en-us/dotnet/core/rid-c...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question