2013-08-21 49 views
5

我對asp.net(但不是c#)非常陌生,我試圖將輸出目錄從\ bin移動到.. \ Build \ debug。我已經在構建屬性中完成了這項工作,它可以很好地構建並將其放入正確的輸出目錄中。但是,當我嘗試運行該應用程序時,我收到以下錯誤:在Visual Studio中更改asp.net項目的輸出目錄

Server Error in '/' Application.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'MyApp.Backend.WebApiApplication'.

Source Error:

Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="MyApp.Backend.WebApiApplication" Language="C#" %>

Source File: /global.asax Line: 1

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18045.

是否與Visual Studio託管網站的方式有關?任何幫助,將不勝感激。

回答

3

它與asp.net查找您的網站的dll文件的方式有關,它會將其執行到bin文件夾中。

你需要做一些額外的配置:

在你的web.config中添加:

<runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
    <probing privatePath="/Build/debug" /> 
    </assemblyBinding> 
</runtime> 

我得到這個從舊後:http://forums.asp.net/t/1303052.aspx。檢查一下。

+1

謝謝你的建議,但我繼續得到同樣的錯誤,增加。我認爲他們在帖子中說這是爲了工作,但實際上並沒有工作。 – Theo

相關問題