DEL*_*zed 6 c# msbuild satellite-assembly
是否有可能告诉MSBuild不要为某个组件或所有组件复制卫星组件?
我有一个nuget包,其中包含资源程序集,但我不想将它们包含在我的输出中.
谢谢.
小智 0
您可以有一个单独的文件夹用于部署,例如 \\Build_Archive,其中输出也被复制 - 并向构建脚本添加一些行以复制您的程序集,但不将卫星程序集复制到这些文件夹 - 这样,Build_Archive 始终只有部署所需的文件。
\n\n即我当前的脚本复制到 build# 标记的文件夹和 Current 文件夹 - 因此 Current 始终具有最新版本,并且我们维护先前构建的历史记录 - 例如:
\n\nC:\\Build_Archive\\AppName\\Current\nC:\\Build_Archive\\AppName\\1.0.0.1\nC:\\Build_Archive\\AppName\\1.0.0.2\nRun Code Online (Sandbox Code Playgroud)\n\n所以在你的构建脚本的末尾有这样的东西(替换<values>你的东西。我们的脚本使用外部 DLL 来管理版本号等,所以不包括在这里):
<!-- . . . -->\n <DropLocation>\\\\<serverName>\\Build_Archive\\${BuildDefinition}</DropLocation>\n <!-- . . . -->\n\n <!-- Version numbers major and build are replaced by outside calls not shown -->\n <PropertyGroup>\n <VersionMajor>1</VersionMajor>\n <VersionMinor>0</VersionMinor>\n <VersionService>0</VersionService>\n <VersionBuild>0</VersionBuild>\n </PropertyGroup>\n\n <Target Name="BuildNumberOverrideTarget">\n <!-- Create a custom build number, matching the assembly version -->\n <!-- . . . -->\n <!-- \xe2\x80\xa6 custom version code call \xe2\x80\x93 returns / sets VersionMajor and VersionBuild -->\n <PropertyGroup>\n <BuildNumber>$(BuildDefinitionName)_$(VersionMajor).$(VersionMinor).$(VersionService).$(VersionBuild)</BuildNumber>\n </PropertyGroup>\n <Message Text="Build number set to "$(BuildNumber)"" />\n <Message Text="$(SolutionRoot)"/>\n </Target>\n\n\n <Target Name="AfterCompile">\n <!-- Call Copy process after the build -->\n <CallTarget Targets="CleanUp"/>\n <CallTarget Targets="StageBuild"/>\n <CallTarget Targets="CopyFiles"/>\n </Target>\n\n <!-- Target : Clean Current Folder for next build -->\n <Target Name="CleanUp">\n <Message Text="**** Entering::CleanUp ****"/>\n <CreateItem Include="\\\\<server name>\\Build_Archive\\<appName>\\Current\\**\\*.*">\n <Output ItemName="PreviousFiles" TaskParameter="Include" />\n </CreateItem>\n <Delete Files="@(PreviousFiles)" ContinueOnError="true" />\n </Target>\n\n <!-- Target:StageBuild -->\n <Target Name="StageBuild">\n <ItemGroup>\n <BldCurrent Include="\\\\<server name>\\Build_Archive\\<appName>\\Current\\"/>\n </ItemGroup>\n <Message Text="@(BldCurrent)"/>\n <Message Text="$(SolutionRoot)"/>\n <!\xe2\x80\x94 Here \xe2\x80\x93 replace next line with commands to copy only the files you want to deploy -->\n <Exec Command="xcopy /y /r /e $(SolutionRoot)\\..\\bin\\*.* @(BldCurrent)"/>\n </Target>\n\n <!-- Target : Copy files from Current to BuildNum folder -->\n <Target Name="CopyFiles">\n <Exec Command="xcopy /y /r /e $(DropLocation)\\Current\\Debug\\*.* $(DropLocation)\\$(BuildNumber)\\Debug\\"/>\n\n <Exec Command="Del /Q $(DropLocation)\\Current\\Debug\\*.config"/>\n <Exec Command="Del /Q $(DropLocation)\\Current\\Debug\\*.dll"/>\n <Exec Command="Del /Q $(DropLocation)\\Current\\Debug\\*.exe"/>\n <Exec Command="Del /Q $(DropLocation)\\Current\\Debug\\*.application"/>\n <Exec Command="Del /Q $(DropLocation)\\Current\\Debug\\*.pdb"/>\n <Exec Command="Del /Q $(DropLocation)\\Current\\Debug\\*.txt"/>\n <Exec Command="Del /Q $(DropLocation)\\Current\\Debug\\*.xml"/>\n </Target>\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
835 次 |
| 最近记录: |