收到“错误 ASPPARSE:无法加载类型...” MVC Web 应用程序上的 msbuild 错误

发布于 2024-12-22 21:32:38 字数 869 浏览 3 评论 0原文

我们有 CCNET 和 msbuild 创建我们的常规版本。我正在尝试更新我们的流程,以便 msbuild 创建压缩的部署包,然后 msdeploy 将它们发送到目标 IIS7 Web 服务器。我在执行端到端解决方案时遇到了麻烦,因此为了进行测试,我现在尝试从命令行调用 msbuild。我执行此语句:

msbuild /target:Build;Package /P:Configuration=Staging;OutDir=D:\Builds\Viper.ProdSupport\MSDeployPkg\ /verbosity:diagnostic D:\builds\ViperPortal.ProdSupport\Code\Viper\Viper.UI.MVC\Viper.UI.MVC.csproj

并收到此错误:

/temp/global.asax(1): error ASPPARSE: Could not load type 'Viper.UI.MVC.MvcApplication'。 [D:\builds\ViperPortal.ProdSupport\Code\Viper\Viper.UI.MVC\Viper.UI.MVC.csproj]

哦,对于我们的规格:用于 Web 服务器的 .NET4、MVC3、IIS7/Win2k8 64 位。构建服务器也是 Win2k8,但我正在使用 ccnet 和本地完整的开发配置管理环境设置的 win 7 32 位机器上本地测试脚本。

有谁知道我为什么会收到此错误?我读到一些消息抱怨 aspnet 编译器或更改 bin 部署程序集的位置,但这些似乎都不适用于此处。我只是想调用 msbuild,它一直工作到现在。我们的解决方案有一个自定义的 msbuild 脚本。我尝试使用该文件和 mvc csproj 文件作为构建配置文件。请帮忙!谢谢!

We have CCNET and msbuild creating our regular builds. I am trying to update our process so msbuild creates zipped deployment packages and msdeploy sends them out to the target IIS7 web servers. I was having trouble doing the end to end solution, so for testing I'm trying to just call msbuild from the command line for now. I execute this statement:

msbuild /target:Build;Package /P:Configuration=Staging;OutDir=D:\Builds\Viper.ProdSupport\MSDeployPkg\ /verbosity:diagnostic D:\builds\ViperPortal.ProdSupport\Code\Viper\Viper.UI.MVC\Viper.UI.MVC.csproj

and I get this error:

/temp/global.asax(1): error ASPPARSE: Could not load type 'Viper.UI.MVC.MvcApplication'. [D:\builds\ViperPortal.ProdSupport\Code\Viper\Viper.UI.MVC\Viper.UI.MVC.csproj]

Oh, and for our specs: .NET4, MVC3, IIS7/Win2k8 64bit for web server. Build server is Win2k8 as well, but I'm testing the scripts locally on a win 7 32bit box with ccnet and a full dev config mgmt environment setup locally.

Does anyone have any ideas why I'm getting this error? I read some messages complaining about the aspnet compiler or changing where your bin deploys assemblies to, but none of those seemed to really apply here. I am simply trying to call msbuild, which has been working all along til now. We have a custom msbuild script for our solution. I tried using both that and the mvc csproj file as the build configuration file. Please help! Thanks!

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

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

发布评论

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

评论(1

枫林﹌晚霞¤ 2024-12-29 21:32:38

如果您已设置为预编译视图,即您将:更改

<MvcBuildViews>false</MvcBuildViews>

<MvcBuildViews>true</MvcBuildViews>

:这是因为 MSBuild 将输出抛出到与 Visual Studio 可能不同的位置,因此您应该将运行预编译的文件夹从:更改

<AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)" />

为:

<AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />

this happens if you've set to precompile views, i.e. you changed:

<MvcBuildViews>false</MvcBuildViews>

to

<MvcBuildViews>true</MvcBuildViews>

This is because MSBuild throws the output to different places than Visual Studio might, so you should change the folder on which the precompiling runs on from:

<AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)" />

to:

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