简体   繁体   English

Ubuntu上的ASP.NET Core:显然未引用mscorlib

[英]ASP.NET Core on ubuntu: mscorlib apparently not referenced

I am trying to get a ASP.NET Core App running on my ubuntu 14.04 server. 我试图在我的ubuntu 14.04服务器上运行一个ASP.NET Core应用程序。 However, when I try to reach the website, I get an "Internal Server Error", and it says that types System.Object, System.Void etc. are not referenced. 但是,当我尝试访问该网站时,出现“内部服务器错误”,并指出未引用类型System.Object,System.Void等。

The strange thing is that on my Windows PC it works fine. 奇怪的是,在我的Windows PC上,它工作正常。 On my server I have mono-complete installed and dotnet 1.0.0-preview1-002702 (latest version according to https://www.microsoft.com/net/core#ubuntu ). 在我的服务器上,我已经安装了mono-complete和dotnet 1.0.0-preview1-002702(根据https://www.microsoft.com/net/core#ubuntu的最新版本)。

My project.json file: https://gist.github.com/leodeuhh/4fd937e94cf0f0279c6f93988c2e7220 我的project.json文件: https : //gist.github.com/leodeuhh/4fd937e94cf0f0279c6f93988c2e7220

Error message as shown in browser: https://gist.github.com/leodeuhh/3a33fd721fc19c769acc033b26066764 如浏览器中所示的错误消息: https : //gist.github.com/leodeuhh/3a33fd721fc19c769acc033b26066764

Any help how to fix this would be greatly appreciated. 任何帮助如何解决此问题将不胜感激。

Found the solution - I had to publish it via 'dotnet publish', copy the file 'libhostpolicy.so' to publish directory from sdk dir and then run it via 'mono App.exe'. 找到了解决方案-我必须通过'dotnet publish'发布它,将文件'libhostpolicy.so'复制到sdk目录中的发布目录,然后通过'mono App.exe'运行它。 Now it works fine.. Just weird that 'dotnet run' doesn't do the job.. 现在它可以正常工作了。只是奇怪的是,'dotnet run'不能完成任务。

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

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