asp.net – VirtualPath位于当前应用程序根目录之外

背景:
ASP.NET Webforms应用程序与VB.NET后端。

我刚刚从Visual Studio 2010升级到Visual Studio 2013和.NET 4.5.1。这段代码以前工作,因为我们在Visual Studio 2005和.NET 2.0。但自从升级我得到这个错误

在ASCX用户控制中。

<script language="javascript" type="text/javascript">
<!--
function SetItem_<%response.Write(m_strJSAlias)%>(strValue) {
     $("#<%response.Write(txtShop.ClientID)%>").attr('value',strValue);
    __doPostBack('frmCorpPortal_Form','');
    void FocusOnNext_<%response.Write(m_strJSAlias)%>;
}

我们现在得到这个错误,我们从来没有得到:

VirtualPath was outside the current application root.
Parameter name: virtualPath 
Description: An unhandled exception occurred during the execution of the current web request.    Please review the stack trace for more @R_428_4045@ion about the error and where it originated in the code. 

Exception Details: System.ArgumentException: VirtualPath was outside the current application root.
Parameter name: virtualPath


Line 4:  <script language="javascript" type="text/javascript">
Line 5:  <!--
Line 6:  function SetItem_<%response.Write(m_strJSAlias)%>(strValue) {
Line 7:       $("#<%response.Write(txtShop.ClientID)%>").attr('value',strValue);
Line 8:      __doPostBack('frmCorpPortal_Form','');

如果我玩的文件,并进行无意义的更改,错误消失。示例:在第4行和第5行之间添加空行。然后稍后再返回。

可能是什么原因?

解决方法

我有一个旧的应用程序在iis和从visual studio运行时的相同的问题。禁用浏览器链接在visual studio 2013似乎修复这个。这个功能注入一些javascript到您的页面,并导致这个问题为我至少。因为我禁用它现在它在IIS和Visual Studio工作。

http://techatplay.wordpress.com/2013/10/24/vs2013-asp-net-application-error-virtualpath-was-outside-the-current-application-root/

这里有关于功能的更多细节

http://blogs.msdn.com/b/webdev/archive/2013/06/28/browser-link-feature-in-visual-studio-preview-2013.aspx

干杯,Crocked

相关文章

### 创建一个gRPC服务项目(grpc服务端)和一个 webapi项目(...
一、SiganlR 使用的协议类型 1.websocket即时通讯协议 2.Ser...
.Net 6 WebApi 项目 在Linux系统上 打包成Docker镜像,发布为...
一、 PD简介PowerDesigner 是一个集所有现代建模技术于一身的...
一、存储过程 存储过程就像数据库中运行的方法(函数) 优点:...
一、Ueditor的下载 1、百度编辑器下载地址:http://ueditor....