简体   繁体   English

在Asp.Net Core 2.0中运行Asp.Net 4.6.1应用程序

[英]Running Asp.Net 4.6.1 applications in Asp.Net Core 2.0

I cannot find a definitive answer on this but is it possible to run an Asp.Net Core (2.0) application as .Net 4.6.1 full-framework in order to reference a library that has not been ported yet (In this particular case Spire.Office although I am not sure that detail is relevant)? 我找不到确切的答案,但是可以将Asp.Net Core(2.0)应用程序作为.Net 4.6.1完整框架运行,以引用尚未移植的库(在这种情况下为Spire .Office,但我不确定细节是否相关)? I have updated all my csproj files to <TargetFramework>net461</TargetFramework> and that works great locally. 我已经将所有csproj文件更新为<TargetFramework>net461</TargetFramework> ,在本地效果很好。 As soon as I deploy to our IIS server the problems start. 一旦部署到IIS服务器,问题就会开始。 I get the following white error page 我得到以下白色错误页面

错误页面502.5

I checked the event viewer and this is what I find: 我检查了事件查看器,这是我发现的内容:

Application 'MACHINE/WEBROOT/APPHOST/XXX' with physical root 
'C:\xxx\xxx\' failed to start process with commandline 
'"C:\xxx\xxx\xxx.exe" ', ErrorCode = '0x80004005 : ff.

I also see another information event in our viewer as follows 我还在查看器中看到了另一个信息事件,如下所示

Fault bucket , type 0
Event Name: CLR20r3
Response: Not available
Cab Id: 0

Problem signature:
P1: xxx.exe
P2: 1.0.0.0
P3: a7384df0
P4: mscorlib
P5: 4.6.1590.0
P6: 5787ee1b
P7: 8f6
P8: 2b
P9: System.Reflection.AmbiguousMatch
P10: 

We have other Asp.Net core applications on this box that are running without issue. 我们在此盒子上还有其他的Asp.Net核心应用程序正在运行,没有任何问题。 Our dev ops guy has us deploying with a bundled runtime per our csproj 我们的开发运营人员让我们根据csproj部署了捆绑的运行时

<RuntimeFrameworkVersion>2.0.0</RuntimeFrameworkVersion>
<RuntimeIdentifiers>win7-x64</RuntimeIdentifiers>

Any ideas or things I could look at? 有什么想法或我可以看的东西吗?

I discovered the fix. 我找到了解决方法。 The issue was due to swagger/swashbuckle not core/4.6.1/iis. 该问题是由于挥霍/小wash而不是core / 4.6.1 / iis。 The xml documentation file generated when opted into was not part of my deployment package. 选择加入时生成的xml文档文件不是我的部署包的一部分。 The error was not revealed until running the exe manually on the command line. 在命令行上手动运行exe之前,不会显示该错误。 Hope this helps someone. 希望这对某人有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM