gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 20:45:38 26 4
gpt4 key购买 nike

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

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 托管网站的方式有关吗?任何帮助,将不胜感激。

最佳答案

它与 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 .也检查一下。

关于asp.net - 在 Visual Studio 中更改 asp.net 项目的输出目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18359145/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com