Web 部署项目团队构建错误

发布于 2024-08-07 22:23:34 字数 1576 浏览 2 评论 0原文

Visual Studio 2008 Web 部署项目团队构建 ASPPARSE 错误

我似乎有一个常见问题;一种正在出现但没有明确解决方案的问题。

我有一个 Visual Studio 2008 项目结构,其中包含几个项目,即类库、一个 Web 应用程序项目和一个最近添加的 Web 部署项目。我听说过 MVC 设置的这个问题。另外,我见过的解决方案假设正在使用 MVC。

我已经从 IDE 验证了构建工作正常。除了由于单个程序集合并而生成的程序集名称之外,我没有更改 Web 部署项目的默认设置。

我已将解决方案设置为仅在为“发布”构建解决方案时才构建 Web 部署项目。我有一个自定义构建脚本,可以获取此代码分支和代码开发分支。构建脚本正确构建了此代码的发布版本和开发分支的调试版本。

构建发行版本时会出现问题。除 Web 部署项目外,所有项目均已成功构建。构建此项目时出现 TFS 构建错误,并出现以下错误:

/xx.csproj/global.asax(1): error ASPPARSE: Could not load type 'xxx.xx.Global'.

xx.csproj 是 Web 应用程序项目,“xxx.xx.Global”是 Global.asax 代码隐藏类。

根据我的阅读,TFS Build 似乎可能存在一些复制问题。我在这里阅读了一些有关 MVC 的回复。这不是 MVC 设置,但我相信它有类似的问题。我不确定复制代码应该去哪里。我尝试将一些建议的代码放入 TFSBuild.proj 文件中的 AfterBuild 目标中,但发现代码并未更改此错误。

<!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.WebDeployment.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="BeforeMerge">
  </Target>
  <Target Name="AfterMerge">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->

上面的代码出现在注释掉的项目文件中。我的想法是,“BeforeMerge”目标可以让我复制所需的二进制文件。我不知道如何编写任何脚本来执行此操作。我查阅了几本 TFS 书籍,但它们都不包含有关 Web 部署项目的信息。 (令我懊恼的是,我似乎也无法从 Microsoft 找到有关此问题的太多信息)。

鉴于我只看到了引用 MVC 解决方案的解决方案,我应该说我已经研究过在 AfterBuild 目标中做一些事情。上面的构建脚本直接来自deploy_csproj,我在 TSBuild 脚本中尝试过它。尝试在任一位置复制二进制文件有区别吗?

谁能解释一下发生了什么事吗?我是否必须为每个项目编写单独的构建脚本,以便它们将二进制文件复制到正确的目录以进行合并执行?

Visual Studio 2008 Web Deployment Project Team Build ASPPARSE Error

I seem to have a common problem; one that is showing up but does not have a clear solution.

I have a Visual Studio 2008 project structure that contains several projects that are class libraries, a web application project, and a recently added web deployment project. I've heard of this issue with MVC setups. Also, the solutions that I've seen assume that MVC is being used.

I have verified that the build works correctly from the IDE. I have not changed the defaults of the web deployment project except for the name of the assembly it produces as a result of the single assembly merge.

I've set my solution to build the web deployment project only when the solution is built for "Release". I have a custom build script that grabs this branch of code and a development branch of code. The build script correctly builds the release version of this code and the debug version of the development branch.

The problem comes when building the release version. All the projects build sucessfully except for the web deployment project. TFS Build errors when building this project with the following error:

/xx.csproj/global.asax(1): error ASPPARSE: Could not load type 'xxx.xx.Global'.

The xx.csproj is the web application project and the 'xxx.xx.Global' is the Global.asax code behind class.

From my reading it seems like there may be some copying issue with TFS Build. I've read several responses here regarding MVC. This is not a MVC setup, but I believe it is of a similar issue. I'm not sure where any copying code should go. I've tried placing some suggested code in my AfterBuild target in the TFSBuild.proj file but found code didn't change this error.

<!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.WebDeployment.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="BeforeMerge">
  </Target>
  <Target Name="AfterMerge">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->

The code above appears int the project file commented out. My thinking is that the 'BeforeMerge' target would let me copy those binaries that are needed. I do not know how to write any script to do this. I've consulted a couple of TFS books but neither of them contain information regarding web deployment projects. (Much to my chagrin it seems that I cannot find much information from Microsoft in regards to this issue as well).

Seeing that I've only seen solutions that reference MVC solutions I should say that I've looked into doing stuff in the AfterBuild target. The build script above is directly from the deploy_csproj where I've tried it in the TSBuild script. Is there a difference to attempting to copy binaries in either location?

Can anyone explain what is going on? Do I have to write individual build scripts for each project so that they copy their binaries to the correct directory for merge execution?

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

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

发布评论

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

评论(1

多情癖 2024-08-14 22:23:34

我认为您遇到了一个已知问题,该问题的核心是 TFS TeamBuild 将编译输出重定向到单个文件夹(而不是每个项目下的 bin\Release)。

我会向您指出 Aaron Hallberg 博客上的这篇文章,其中解释了该问题以及如何解决该问题:

http://blogs.msdn.com/aaronhallberg/archive/2007/07/02/team-build-and-web-deployment-项目.aspx

I think you're bumping into a known issue that centres on the fact that TFS TeamBuild redirects the compilation outputs into a single folder (rather than bin\Release under each project).

I would point you in the direction of this post on Aaron Hallberg's blog which explains the issue and how to workaround it:

http://blogs.msdn.com/aaronhallberg/archive/2007/07/02/team-build-and-web-deployment-projects.aspx

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