得到错误<位置allowOverride =“假">.在Hostgator中托管WEB API 2时 [英] Getting Error <location allowOverride="false"> while hosting WEB API 2 in Hostgator

查看:51
本文介绍了得到错误<位置allowOverride =“假">.在Hostgator中托管WEB API 2时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地系统中使用的是WEB API 2,但是当在Hostgator Windows服务器中运行WEB API 2时,下面给我的错误是我的错误屏幕截图

I am using WEB API 2 its working in my local system,but when WEB API 2 run in Hostgator windows server its given me error below is my error screenshot

http://prntscr.com/bc5ihv

推荐答案

正如我所评论的,在共享主机上托管Web api时遇到了类似的问题. 解决方案是删除Microsoft.CodeDom.Providers.DotNetCompilerPlatform软件包并清理并构建

As I commented, I got similar problem while hosting web api on shared hosting. The solution is to remove Microsoft.CodeDom.Providers.DotNetCompilerPlatform package and clean and build

您甚至可以在没有Roslyn的情况下进行部署,而无需更改代码.打开NuGet软件包管理器窗口,然后卸载Microsoft.CodeDom.Providers.DotNetCompilerPlatform软件包,然后重新构建&重新发布.此卸载还会从web.config文件中删除CodeDom配置.这将解决您的目的.基本上,这不会在bin文件夹中生成任何csc.exe,vbc.exe文件.

You can deploy even without Roslyn with no change in code. Open NuGet Package Manager window and uninstall Microsoft.CodeDom.Providers.DotNetCompilerPlatform package and rebuild & republish. This uninstallation also removes CodeDom configuration from web.config file. This will solve your purpose. Basically this will not generate any csc.exe, vbc.exe files inside bin folder.

我从此处

这篇关于得到错误<位置allowOverride =“假">.在Hostgator中托管WEB API 2时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆