VS2008 Web 部署项目在构建过程中修改
我们遇到一个问题,即我们的部署项目之一在构建过程中被修改。
我们有一个包含多个组件 Web 服务的大型应用程序,作为解决方案构建过程的一部分,我们的任务是将已编译的程序集和配置文件等复制到特定文件夹,然后将它们压缩以供部署。
我们的解决方案中有 5 个部署项目,但只有一个存在此问题。
5 个 Web 部署项目看起来都与此类似,通常:
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{GUID}</ProjectGuid>
<SourceWebPhysicalPath>..\..\WebService\X.Connectors\Component1\X.Connectors.Component1</SourceWebPhysicalPath>
<SourceWebProject>{GUID}|WebService\X.Connectors\Component1\X.Connectors.Component1\X.Connectors.Component1.csproj</SourceWebProject>
<SourceWebVirtualPath>/X.Connectors.Component1.csproj</SourceWebVirtualPath>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\Setups\Connectors\Component1\</OutputPath>
<EnableUpdateable>false</EnableUpdateable>
<UseMerge>true</UseMerge>
<SingleAssemblyName>OBE.Connectors.Component1.Deploy</SingleAssemblyName>
<DeleteAppDataFolder>true</DeleteAppDataFolder>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>false</DebugSymbols>
<OutputPath>..\Setups\Connectors\Component1\</OutputPath>
<EnableUpdateable>false</EnableUpdateable>
<UseMerge>false</UseMerge>
<SingleAssemblyName></SingleAssemblyName>
<UseFixedNames>true</UseFixedNames>
<DeleteAppDataFolder>true</DeleteAppDataFolder>
</PropertyGroup>
现在,时不时地,也许每 5 个构建左右,构建完成后,其中一个 .wdproj 文件会发生更改,如下所示:
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{GUID}</ProjectGuid>
<SourceWebPhysicalPath>..\..\WebService\X.Connectors\Component2\X.Connectors.Component2</SourceWebPhysicalPath>
<SourceWebProject>{GUID}|WebService\X.Connectors\Component1\X.Connectors.Component1\X.Connectors.Component1.csproj</SourceWebProject>
<SourceWebVirtualPath>/X.Connectors.Component1.csproj</SourceWebVirtualPath>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
此更改会导致接下来的构建会编译组件 2 的源代码,并将生成的程序集放入组件 1 的 bin 文件夹中,从而导致 bin 文件夹中存在错误的 dll。
我们唯一的构建任务是压缩目录中的文件,以及使用 SVN 修订号更新版本。我们使用的是VS2008。
任何人以前遇到过这个或能够阐明这一点吗?
We are experiencing an issue where one of our deployment projects gets modified during the build process.
We have a large application with several component webservices, and as part of the build process for the solution we have tasks to copy the compiled assemblies and configuration files etc to a specific folder, and then zip them ready for deployment.
We have 5 deployment projects in the solution, but only one has this issue.
The 5 web deployment projects all look similar to this, normally:
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{GUID}</ProjectGuid>
<SourceWebPhysicalPath>..\..\WebService\X.Connectors\Component1\X.Connectors.Component1</SourceWebPhysicalPath>
<SourceWebProject>{GUID}|WebService\X.Connectors\Component1\X.Connectors.Component1\X.Connectors.Component1.csproj</SourceWebProject>
<SourceWebVirtualPath>/X.Connectors.Component1.csproj</SourceWebVirtualPath>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\Setups\Connectors\Component1\</OutputPath>
<EnableUpdateable>false</EnableUpdateable>
<UseMerge>true</UseMerge>
<SingleAssemblyName>OBE.Connectors.Component1.Deploy</SingleAssemblyName>
<DeleteAppDataFolder>true</DeleteAppDataFolder>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>false</DebugSymbols>
<OutputPath>..\Setups\Connectors\Component1\</OutputPath>
<EnableUpdateable>false</EnableUpdateable>
<UseMerge>false</UseMerge>
<SingleAssemblyName></SingleAssemblyName>
<UseFixedNames>true</UseFixedNames>
<DeleteAppDataFolder>true</DeleteAppDataFolder>
</PropertyGroup>
Now, every now and then, maybe every 5th build or so, after the build has completed, one of the .wdproj files is changed, like this:
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{GUID}</ProjectGuid>
<SourceWebPhysicalPath>..\..\WebService\X.Connectors\Component2\X.Connectors.Component2</SourceWebPhysicalPath>
<SourceWebProject>{GUID}|WebService\X.Connectors\Component1\X.Connectors.Component1\X.Connectors.Component1.csproj</SourceWebProject>
<SourceWebVirtualPath>/X.Connectors.Component1.csproj</SourceWebVirtualPath>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
This change, causes the next build to compile the source code from Component 2 and put the generated assemblies into the bin folder for Component 1, thus resulting in the wrong dll's being in the bin folder.
The only build tasks we have in place are the ones to ZIP the files in the directory and one to update the version with SVN revision number. We are using VS2008.
Anyone encountered this before or able to shed any light on this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题的简单且非常烦人的解决方案。
.wdproj 文件中项目的 GUID 不正确。
该死的你复制了&粘贴。
Trivial and very annoying solution to the problem.
The GUID for the project was incorrect in the .wdproj file.
Damn you copy & paste.