有一个长期存在的问题与ASP.NET MVC不正确地处理URL路径,如果有正斜杠,即使他们是URL编码的参数。ASP.NET - 无法找到视图
举例:
在默认安装,(根据需要调整端口)去这个网址
http://localhost:11541/Token/Create?
callback=http%3a%2f%2flocalhost%3a11491%2ftoken%2fcreatetoken%2fAddPrivateValues
注意,控制器是“令牌”和“创建”是要调用的方法。这是我得到的错误:
The view 'http://localhost:11491/token/createtoken/AddPrivateValues' or
its master was not found or no view engine supports the searched
locations. The following locations were searched:
~/Views/Token/http://localhost:11491/token/createtoken/AddPrivateValues.aspx
~/Views/Token/http://localhost:11491/token/createtoken/AddPrivateValues.ascx
~/Views/Shared/http://localhost:11491/token/createtoken/AddPrivateValues.aspx
~/Views/Shared/http://localhost:11491/token/createtoken/AddPrivateValues.ascx
请注意,它调用了“CreateToken/AddPrivateValues”。这是错误的。它应该调用Token.Create。
这个问题出现自2009年以来已经被打破(按照现有S.O.研究),所以我不会屏住了呼吸。我只需要解决此问题并将其移至Azure。
我尝试添加到我的控制器{* ID}路线,但是,这并不工作,因为有很多斜杠。该only way to fix this is to disable this parsing in the machine.config(web.config文件无效)
问题
如何设置Windows Azure中这个属性,而不使用RDP以便在Web.config文件的权限为安全和锁定,因为他们在我尝试做这件事之前?
您使用Azure网站或虚拟机的结果? –
@ DanielA.White我还没有决定哪种方法我会长期,但最初的网站。 – LamonteCristo
您无法更改这些machine.config。 –