转换netcore2.2-> netstandard2:未定义runco mmand属性

问题描述 投票:0回答:1

我正在将我的netcore2.2应用程序转换为netstandard2.0;net472

这是我的主项目的csproj文件:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFrameworks>netstandard2.0;net472</TargetFrameworks>
    <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
    <Platforms>AnyCPU;x64</Platforms>
    <StartupObject></StartupObject>
    <ApplicationIcon />
    <OutputType>WinExe</OutputType>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <PlatformTarget>AnyCPU</PlatformTarget>
  </PropertyGroup>

  <ItemGroup>
        <PackageReference Include="JWT" Version="5.3.1" />
        <PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
        <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.2.0" />
        <PackageReference Include="Microsoft.AspNetCore.CookiePolicy" Version="2.2.0" />
        <PackageReference Include="Microsoft.AspNetCore.Hosting.WindowsServices" Version="2.2.0" />
        <PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="2.2.0" />
        <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
        <PackageReference Include="Microsoft.AspNetCore.Session" Version="2.2.0" />
        <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
        <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.2.0" />
        <PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="2.2.0" />
        <PackageReference Include="Microsoft.Extensions.Options" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="2.2.6" />
    <PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.5.0" />
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
    <PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.2.0" />
    <PackageReference Include="swashbuckle.aspnetcore" Version="4.0.1" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\mvaasa.repository\mvaasa.repository.csproj" />
    <ProjectReference Include="..\mvaasa.services\mvaasa.services.csproj" />
  </ItemGroup>

</Project>

这里是我的Application Settings

enter image description here

[每当尝试使用Start Debugging (IIS Express)时,都会弹出以下错误消息:

enter image description here

我该如何设置?

更新

我尝试如下将OutputType设置为Exe

<OutputType>Exe</OutputType>
c# visual-studio .net-core visual-studio-2019
1个回答
0
投票
。NET Standard不是将生成可运行程序集的目标框架。目标是.NET Core,而是可以在实际运行时上运行。

定位netstandard2.0仅对库有用,对您要运行的程序无用。

© www.soinside.com 2019 - 2024. All rights reserved.