部署ASP.NET MVC项目 [英] Deploying ASP.NET MVC Project
问题描述
我想(从Visual Studio 2013年)到远程服务器上部署的默认MVC项目。他们需要的程序以中等信任模式,我有问题的运行。我已经添加了<信任级别=中originUrl =/>
到<的System.Web>
Web.config文件的部分。然后,当我尝试我的本地机器在运行该程序的,一个SecurityException由该行抛出:
I'm trying to deploy the default MVC project (from Visual Studio 2013) onto a remote server. They require the program to be running in Medium Trust mode, which I am having issues with. I've added <trust level="Medium" originUrl="" />
to the <system.web>
section of Web.config. Then when I try to run the program on my local machine, a SecurityException is thrown by this line:
@ Html.ActionLink(应用程序名称,索引,家,新{面积=},{新@class =Navbar的品牌})
这是位于_Layout.cshtml文件,我还没有从生成的模板修改(当你创建一个新的MVC项目5)。
This is located in the _Layout.cshtml file, which I haven't modified from the generated template (when you create a new MVC 5 project).
我的问题是:什么,我需要做的就是我的项目在中信任模式下运行。
My question is: what do I need to do to get my project to run in Medium Trust mode?
推荐答案
ASP.NET的当前版本现在只支持完全信任。 MS在发行说明:已知问题的ASP。 NET MVC 5不再支持部分信任......的。尤其是 [汇编:AllowPartiallyTrustedCallers]
属性已经从源头code删除。您可以阅读列维的回答更多关于ASP.NET的官方立场,以<一个href=\"http://stackoverflow.com/questions/16849801/is-trying-to-develop-for-medium-trust-a-lost-cause\">is-trying-to-develop-for-medium-trust-a-lost-cause,其中还包括进一步的链接为什么支持已被删除。
The current versions of ASP.NET now only support full trust. MS have stated in Release Notes: Known Issues that "ASP.NET MVC 5 no longer supports partial trust....". In particular the [assembly: AllowPartiallyTrustedCallers]
attribute has been removed from the source code. You can read more about ASP.NET's official position in Levi's answer to is-trying-to-develop-for-medium-trust-a-lost-cause, which also includes further links to why support has been removed.
这篇关于部署ASP.NET MVC项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!