c# – 警告尝试构建Service Fabric AspNetCore2项目
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了c# – 警告尝试构建Service Fabric AspNetCore2项目,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2726字,纯文字阅读大概需要4分钟。
内容图文
使用最新的Service Fabric SDK(5.7.198)和Visual Studio Professional 15.3.1
我只是试图调试或部署aspnetcore2.0无状态服务时遇到问题.除了添加新控制器之外,我在项目创建向导之后没有对项目进行任何更改.
我已经尝试重新安装.Net Core SDK的x64和x86版本.该项目设置为x64.下面是整个.csproj
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
<IsServiceFabricServiceProject>True</IsServiceFabricServiceProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.ViewCompilation" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.0" />
<PackageReference Include="Microsoft.ServiceFabric" Version="5.7.198" />
<PackageReference Include="Microsoft.ServiceFabric.AspNetCore.Kestrel" Version="2.7.198" />
<PackageReference Include="Microsoft.ServiceFabric.Data" Version="2.7.198" />
<PackageReference Include="Microsoft.ServiceFabric.Services" Version="2.7.198" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="2.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.0" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
</ItemGroup>
There was a mismatch between the processor architecture of the project
being built “AMD64” and the processor architecture of the reference
“C:\Program
Files\dotnet\sdk\NuGetFallbackFolder\microsoft.visualstudio.web.codegeneration.design\2.0.0\lib\net461\dotnet-aspnet-codegenerator-design.exe”,
“x86”. This mismatch may cause runtime failures. Please consider
changing the targeted processor architecture of your project through
the Configuration Manager so as to align the processor architectures
between your project and references, or take a dependency on
references with a processor architecture that matches the targeted
processor architecture of your project. MyApi C:\Program Files
(x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets 1987
可能与此问题有关.Github issue
我已经发布了我的复制代码GitHub Repo
解决方法:
我有一个解决方案.您需要从项目中删除Microsoft.VisualStudio.Web.CodeGeneration.Design包.您可以通过.csproj文件或NuGet包管理器来执行此操作.一旦你删除了它,它将构建并运行正常.
内容总结
以上是互联网集市为您收集整理的c# – 警告尝试构建Service Fabric AspNetCore2项目全部内容,希望文章能够帮你解决c# – 警告尝试构建Service Fabric AspNetCore2项目所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。