虚拟路径XX映射到另一个应用程序,这是不允许的。

时间:2021-06-27 09:25:22

I have copied one website to another folder and tried to run it in Visual Studio using IIS, but for some reason it is giving me a compile error in the following lines in the web.config file:

我已经将一个网站复制到另一个文件夹并尝试使用IIS在Visual Studio中运行它,但由于某种原因,它在web.config文件中的以下行中给出了编译错误:

    <add tagPrefix="QuickBuck" tagName="RecentlyModified" src="/Controls/RecentlyModified.ascx" />
    <add tagPrefix="QuickBuck" tagName="Sitemap" src="/Controls/Sitemap.ascx" />

There is also another line underneath them which doesn't error, making this even stranger:

在它们下面还有另一条线没有错误,这使得它更奇怪:

    <add tagPrefix="QuickBuck" tagName="Menu" src="/Controls/Menu.ascx" />

The controls are there, why is this happening? The exact errors are like so:

控件在那里,为什么会发生这种情况?确切的错误是这样的:

The virtual path '/Controls/RecentlyModified.ascx' maps to another application, which is not allowed.       

The virtual path '/Controls/Menu.ascx' maps to another application, which is not allowed.   

There isn't actually a line number next to the errors so I assume it is from the web.config. Please help this is driving me crazy!

错误旁边实际上没有行号,因此我假设它来自web.config。请帮助这让我发疯!

2 个解决方案

#1


15  

I don't know what happened but I was able to get it to work by putting ~ in front of the path. Hope this helps someone.

我不知道发生了什么,但我能够通过把〜放在路径前来让它工作。希望这有助于某人。

#2


2  

Ts is due to you may have two copies of the .aspx file in some other location of your Solution. So it may refer that too, So try delete the duplicate file from the Solution and try it (Note : May be that file has not included in the project, but that reside in the Solution, So find that & delete it )

Ts是由于您可能在解决方案的其他位置有两个.aspx文件的副本。因此它也可以引用它,所以尝试从解决方案中删除重复文件并尝试它(注意:可能该文件未包含在项目中,但是它位于解决方案中,因此找到并删除它)

#1


15  

I don't know what happened but I was able to get it to work by putting ~ in front of the path. Hope this helps someone.

我不知道发生了什么,但我能够通过把〜放在路径前来让它工作。希望这有助于某人。

#2


2  

Ts is due to you may have two copies of the .aspx file in some other location of your Solution. So it may refer that too, So try delete the duplicate file from the Solution and try it (Note : May be that file has not included in the project, but that reside in the Solution, So find that & delete it )

Ts是由于您可能在解决方案的其他位置有两个.aspx文件的副本。因此它也可以引用它,所以尝试从解决方案中删除重复文件并尝试它(注意:可能该文件未包含在项目中,但是它位于解决方案中,因此找到并删除它)