aspnet_compiler ASPParse 无法加载类型

发布于 2024-07-08 14:43:19 字数 515 浏览 10 评论 0原文

我无法在我们的构建环境中构建我的 Web 应用程序(不是网站)。 我们在构建环境中使用 DMAKE(不幸的是,这是不可协商的,因此不允许使用 MSBUILD )以及通过

C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler -d -nologo 调用 asp.net 预编译器时-p Site -f -fixednames -errorstack -v / Debug

我们收到以下错误

ASPPARSE: Could not load type 'XYAdmin.Site.Global

如果我从 ide 编译它是成功的。 如果我然后用 aspnet_compiler 编译它就成功了。 因此,只有当我尝试编译的目标 dll 位于我正在编译的 Web 应用程序的 bin 中时,我才能使用 aspnet_compiler 成功编译。

我不断遇到谈论使用 MSBUILD 解决方案的帖子,不幸的是我无法尝试。

任何帮助,将不胜感激

I am unable to build my Web Application (not Web Site) in our build environement. We use DMAKE in our build environment (this unfortunately is non negotiable, therefore using MSBUILD is not permitted ) and when invoking the asp.net precompiler through

C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler -d -nologo -p Site -f -fixednames -errorstack -v / Debug

We get the following error

error ASPPARSE: Could not load type 'X.Y.Admin.Site.Global

If I compile from the ide it is successful. If i then compile with aspnet_compilier it is successful. So i only get a successful compile with aspnet_compiler when the target dll i am trying to compile is in the bin of the web application i am compiling.

I keep running into postings that talk about solutions using MSBUILD which unfortunately I cant try.

Any help would be appreciated

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

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

发布评论

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

评论(8

記憶穿過時間隧道 2024-07-15 14:43:19

我们的网络应用程序也遇到了同样的问题:
错误 ASPPARSE:无法加载类型“...”

问题是我们在磁盘上(在项目文件夹中)有该文件,但它没有包含在我们的应用程序项目中(在 .csproj 中)文件)。 我们通过将该文件包含在项目中解决了问题:)

We had the same problem on our web application:
error ASPPARSE: Could not load type '...'

The problem was that we had the file on disk (on the project folder) but it wasn't included in our application project (in the .csproj file). We solved the problem by including the file in the project :)

遗弃M 2024-07-15 14:43:19

我在使用 NANT 时遇到了类似的问题。 诀窍是将 Web 应用程序代码文件编译成 dll,然后在使用 aspnet_compiler 时包含该文件。

使用命令行编译器 csc.exe (c#) 或 vbc.exe (Visual Basic) 来编译具有类型库输出的 Web 应用程序。 这将创建一个可以在 aspnet_compiler 任务中使用的 dll

I ran into a similar problem using NANT. The trick was to compile the web applications code files into a dll then include that when using aspnet_compiler.

use the command line compiler,either csc.exe (c#) or vbc.exe (visual basic), to compile your web application with an output of type library. This will create a dll that you can use in your aspnet_compiler task

泪是无色的血 2024-07-15 14:43:19

您是否尝试过使用 -p 指定路径? 在我看来,它找不到那种类型/程序集。

http://msdn.microsoft.com/en-us /library/ms229863(VS.80).aspx

Have you tried specifying the path using -p? Sounds to me like it can't find that type / assembly.

http://msdn.microsoft.com/en-us/library/ms229863(VS.80).aspx

九公里浅绿 2024-07-15 14:43:19

对于 Web 应用程序,您必须将 .vb 文件构建为 dll,并将其放入 bin 文件夹中,然后再运行 aspnet 编译器。 检查 Visual Studio 中的输出窗口,您将看到 VB 编译器的命令行。 在运行 aspnet 编译器之前先运行它,然后 asp 页面应该能够找到缺失的类型。

For web applications, you have to build the .vb files into a dll and put that in the bin folder before you run the aspnet compiler. Check the output window in visual studio and you'll see the command line for the VB compiler. Run that first before you run the aspnet compiler, and the asp pages should be able to find the missing types.

陌路黄昏 2024-07-15 14:43:19

通过简单地删除所有 binobj 文件夹,我就解决了这个问题。 看来他们的状态有些不好。 我还删除了 .sou 文件,但我不认为这是问题所在。

This problem was resolved for me by simply deleting all bin and obj folders. Seems like they were in a bad state somehow. I also deleted the the .sou file, but I don't think that was the issue.

万劫不复 2024-07-15 14:43:19

我收到了同样的问题。

我通过将 web 应用程序的 DLL 从 OBJ/DEBUG 文件夹复制到 BIN 文件夹来修复它。

I received the same problem.

I fixed it by copying my webapp's DLL from the OBJ/DEBUG folder to the BIN folder.

留蓝 2024-07-15 14:43:19

我刚刚遇到了这个错误,找到了两种修复它的方法:

  • 将 global.asax 文件中的 Codebehind 属性更改为 CodeFile 并将“partial”添加到类声明中
  • 在部署项目的属性页中,设置“版本输出程序集”并提供版本号

我真的不知道为什么两者都有效,但它确实有效。

I just had this error and found 2 ways to fix it, either:

  • Change the Codebehind attribute in the global.asax file to CodeFile and add "partial" to the class declaration
  • In the deployment project's property pages, set "Version output assemblies" and provide a version number

I don't really know why either worked, but it did.

岁月静好 2024-07-15 14:43:19

解决方案:

-p 站点路径必须具有 .csproj 文件位置的目录路径。

前任 :-

aspnet_compiler -p D:\Projects\MGM\mgm\mgm -v / D:\Projects\MGM-deploy\mgm_compiled

solution :

-p Site path must have the directory path of .csproj file location.

ex :-

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