在Visual Studio中更改asp.net项目的输出目录

问题描述:

我对asp.net(不是c#)非常陌生,并且正在尝试将输出目录从\ bin移至.. \ Build \ debug.我已经在build属性中完成了此操作,它可以很好地构建并将其放入正确的输出目录中.但是,当我尝试运行该应用程序时,出现以下错误:

I am very new to asp.net (but not c#) and I am trying to move my output directory from \bin to ..\Build\debug. I have done this in the build properties and it builds fine and puts it into the correct output directory. However, when I try to run the application I receive the following error:

"/"应用程序中的服务器错误.

Server Error in '/' Application.

解析器错误

描述:解析服务该请求所需的资源期间发生错误.请查看以下特定的解析错误详细信息,并适当地修改您的源文件.

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.

解析器错误消息:无法加载类型'MyApp.Backend.WebApiApplication'.

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

源错误:

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

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

源文件:/global.asax行:1

Source File: /global.asax Line: 1

版本信息:Microsoft .NET Framework版本:4.0.30319;ASP.NET版本:4.0.30319.18045.

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

与Visual Studio托管网站的方式有关吗?任何帮助将不胜感激.

Is it something to do with the way Visual Studio hosts the website? Any help would be appreciated.

它与asp.net查找网站的dll文件的方式有关,该文件执行后位于bin文件夹中.

It has something to do with the way asp.net looks for the dll files of your website, which it exects to be in the bin folder.

您需要进行一些额外的配置:

You need to make some extra configurations:

在您的web.config中添加:

In your web.config add:

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

我是从较早的帖子中得到的: http://forums.asp.net/t/1303052.aspx .还要检查一下.

I got this from an older post: http://forums.asp.net/t/1303052.aspx. Check that out as well.