Visual Studio“转换为 Web 应用程序” 和“无法加载类型” 错误

发布于 2024-08-01 21:07:29 字数 527 浏览 2 评论 0原文

我目前收到一条“无法加载类型 UI.Administration.Site.master”错误消息,我不太确定为什么。

我有一个带有 UI 命名空间的 ASP.NET MVC 项目。 在项目的结构中,我有一个 Admin 文件夹。 我右键单击 Admin 文件夹并选择“转换为 Web 应用程序”,但我的母版页收到“无法加载类型”错误。

在这些情况下是否必须发生任何特殊的事情才能使其发挥作用?

下面的错误信息

解析器错误 描述:解析服务此请求所需的资源时发生错误。 请查看以下特定解析错误详细信息并适当修改您的源文件。

解析器错误消息:无法加载类型“UI.Administration.Site”。

源错误:

第 1 行:<%@ Master Language="C#" CodeBehind="Site.master.cs" Inherits="UI.Administration.Site" %>

I'm currently getting a "Could not load type UI.Administration.Site.master" error message and I'm not really sure as to why.

I have an ASP.NET MVC Project with the UI namespace. Within the project's structure, I have an Admin folder. I right clicked on the Admin folder and chose "Convert to Web Application", but am getting a Could Not Load Type error for my master page.

Are there any special things that must occur in these situations for this to work?

ERROR INFO BELOW

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 'UI.Administration.Site'.

Source Error:

Line 1: <%@ Master Language="C#" CodeBehind="Site.master.cs" Inherits="UI.Administration.Site" %>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情仇皆在手 2024-08-08 21:07:29

确保您的命名空间与您的文件夹结构以及 Inherits 子句和 CodeBehind 属性相匹配。 我遇到了同样的问题,这是因为转换时 Inherits 属性中的命名空间不匹配。

Make sure your namespaces match up with your folder structure as well as in your Inherits clause and your CodeBehind attributes. I had the same problem and it was because the namespace in the Inherits attribute didn't match up when I converted.

淤浪 2024-08-08 21:07:29

我一直想知道这个命令是做什么的。 我确信我已经尝试过但没有看到结果。 我最后只是查了一下:

“转换为Web应用程序”与你的场景无关。 它用于将 Visual Studio .NET 和 Visual Studio .NET 2003 转换为 Visual Studio .NET 2008。

请参阅“演练:将 Visual Studio 2002 或 2003 Web 项目转换为 Visual Studio 2008 Web 应用程序项目”。

I had always wondered what this command did. I'm sure I've tried it and seen no result. I finally just looked it up:

"Convert to Web Application" has nothing to do with your scenario. It's for converting Visual Studio .NET and Visual Studio .NET 2003 to Visual Studio .NET 2008.

See "Walkthrough: Converting a Visual Studio 2002 or 2003 Web Project to a Visual Studio 2008 Web Application Project".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文