转换 netcore2.2 -> netstandard2:未定义运行命令 属性
Converting netcore2.2 -> netstandard2: The runcommand property is not defined
我正在将我的 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
:
每当我尝试 Start Debugging (IIS Express)
时,都会弹出以下错误消息:
如何设置?
更新
我尝试将 OutputType
设置为 Exe
,如下所示:
<OutputType>Exe</OutputType>
.NET Standard 不是将生成 运行nable 程序集的目标框架。以 .NET Core 为目标,以便能够 运行 在实际 运行 时间。
定位 netstandard2.0
仅对库有用,对您想要 运行 的程序无用。
当您以多个框架为目标时,还要确保将预期的 运行时间传递给 运行 on:
dotnet run -f netcoreapp2.2
我正在将我的 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
:
每当我尝试 Start Debugging (IIS Express)
时,都会弹出以下错误消息:
如何设置?
更新
我尝试将 OutputType
设置为 Exe
,如下所示:
<OutputType>Exe</OutputType>
.NET Standard 不是将生成 运行nable 程序集的目标框架。以 .NET Core 为目标,以便能够 运行 在实际 运行 时间。
定位 netstandard2.0
仅对库有用,对您想要 运行 的程序无用。
当您以多个框架为目标时,还要确保将预期的 运行时间传递给 运行 on:
dotnet run -f netcoreapp2.2