背景资料: 具有VB.NET后端的ASP.NET WebForms应用程序.
我最近刚从Visual Studio2010升级到Visual Studio2013和.NET 4.5.1.自从我们使用Visual Studio2005和.NET2.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 information 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行之间添加一个空行.然后它会回来.
这可能是什么原因造成的?