【发布时间】:2019-10-21 00:36:34
【问题描述】:
我正在将我的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 时无法输出
Exe。你必须输出一个库。
标签: visual-studio .net-standard