这与我昨天提出的问题有关,但可能最好单独询问.
我有一个运行.csproj文件版本的TFS 2010服务器,以及一个安装了msdeploy的IIS6框.我希望构建自动发布构建,但无论我发送到其参数中,它都不会尝试运行发布.我可以把DeployTarget = TotalCarp,它仍然运行没有错误,但不会尝试发布.
下面是相关构建的日志部分:
运行MSBuild for Project
初始属性值
AdditionalVCOverrides =
CommandLineArguments =/p:SkipInvalidConfigurations = true/p:DeployOnBuild = True/p:DeployTarget = TotalCarp/p:MsDeployPublishMethod = RemoteAgent/p:DeployIisAppPath ="WebRoot/ExternalContractSupportWeb"/ p:MsDeployServiceUrl = whatever/p: AllowUntrustedCertificated = True/p:UserName = Username/p:Password = Password
Configuration = Test
GenerateVSPropsFile = True
LogFile =
LogFileDropLocation =\g10svhudtfs\TFSBuilds\ExternalContractSupport\TestBuild\TestBuild_20101101.25\logs
MaxProcesses = 1
OutDir = C:\ Builds\1\CustomerTerms\TestBuild\Binaries
Platform =任何CPU
Project = C:\ Builds\1\CustomerTerms\TestBuild\Sources\ExternalContractSupportWeb\ExternalContractSupportWeb.csproj
ResponseFile =
RunCodeAnalysis = AsConfigured
Targets =
TargetsNotLogged = String [] Array
ToolPath =
ToolPlatform = Auto
Verbosity = Diagnostic
C:\ Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe/nologo/noconsolelogger"C:\ Builds\1\CustomerTerms\TestBuild\Sources\ExternalContractSupportWeb\ExternalContractSupportWeb.csproj"/ …
我试图使用WriteCodeFragment MSBuild任务创建AssemblyVersion属性。我在创建属性组以正确传递处理所需的ITaskItem数组时遇到问题。有人可以帮忙一个例子。
msbuild msbuild-task msbuild-propertygroup visual-studio msbuild-4.0
在自动化ClickOnce发布过程中,我们使用Mage生成应用程序清单和MsBuild GenerateDeploymentManifest任务.
<GenerateDeploymentManifest AssemblyName="App.exe.application"
AssemblyVersion="$(AppVersion)"
Product="Application"
Install="true"
UpdateEnabled="true"
UpdateMode="Foreground"
OutputManifest="$(PrepareFolder)\App.exe.application"
MapFileExtensions="true"
EntryPoint="@(RelativeApplicationManifestFile)"
CreateDesktopShortcut="true"
MinimumRequiredVersion="$(AppVersion)"
/>
Run Code Online (Sandbox Code Playgroud)
但CreateDesktopShortcut无效,并且不会在部署清单文件中创建所需的标记.
得到这个:
<deployment install="true"
mapFileExtensions="true"
minimumRequiredVersion="2.19.13.0">
Run Code Online (Sandbox Code Playgroud)
代替
<deployment install="true"
mapFileExtensions="true"
minimumRequiredVersion="2.19.13.0"
co.v1:createDesktopShortcut="true">
Run Code Online (Sandbox Code Playgroud)
我错过了什么吗?
要在发布构建后复制不同位置的文件,我尝试了以下操作:
编辑csproj文件并添加此代码,将dll复制到相对路径的bin.
<PropertyGroup>
<CopyAllFilesToSingleFolderForPackageDependsOn>
CustomCollectFiles;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForPackageDependsOn>
</PropertyGroup>
<Target Name="CustomCollectFiles">
<ItemGroup>
<_CustomFiles Include="..\*project*\**\*.dll" />
<FilesForPackagingFromProject Include="%(_CustomFiles.Identity)">
<DestinationRelativePath>bin\%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>
</Target>
Run Code Online (Sandbox Code Playgroud)
这绝对没问题.我只是想知道是否可以使用像这样的post build事件来完成..(这不起作用).
if $(ConfigurationName) == Release xcopy /y "$(ProjectDir)$(OutDir)$(TargetFileName)" "$(SolutionDir)$(OutDir)"
Run Code Online (Sandbox Code Playgroud)
第一种方式是在VS2010中单击发布的"唯一方法"吗?值得关注的是,在VS2010中,csproj文件中的更改不会显示在任何地方.
我见过几个.NET项目(例如FluentNHibernate)使用Ruby的rake来运行他们的构建,而不是使用.Net工具,如NAnt或MSBuild.这样做有什么好处?我们正在开始一个新项目,并试图弄清楚是否坚持我们现有的NAnt构建或迁移到其他东西.任何意见,将不胜感激.
我们正在使用.Net 3.5,如果它有所作为.
我不熟悉Hudson或OSX,我只是想知道这是否可行.我们在OSX上安装了一个Hudson实例.我们希望使用构建过程连接到Windows Server并执行为我们的WP7项目运行MSBuild的批处理文件.我无法访问Hudson机器,到目前为止我的搜索没有得到任何答案,但我的预感是这是不可能的.
最终目标:我们的Hudson机器运行OSX,我们想知道是否可以使用我们的Hudson构建Windows Phone 7项目.我们有一台运行Windows Server 2008的计算机,但它没有Hudson.我们希望有一台Hudson机器尽可能地完成所有构建.
关于此链接提供的答案:建议的解决方案
我试图以多种方式使用这种方法,但是我无法让它工作.我已经仔细检查过我正在运行msbuild的框架4版本,我是这样,并仔细按照说明操作.
我的WixValues属性看起来像这样
<PropertyGroup>
<WixValues>
OnBuildServer=True;
DefineConstants=TXT=$(TXT);ProdVersion=$(InstallVersion);
Configuration=Release;
Platform=x64;
SuppressAllWarnings=True;
APPDATA=$(APPDATA);
</WixValues>
</PropertyGroup>
Run Code Online (Sandbox Code Playgroud)
但不知何故,第二个defineconstant值没有到达命令行,即使所有其他值都可以.
The candle command line from the msbuild log looks like this:
..\WixTools\candle.exe -sw -TXT=TRUE -d"DevEnvDir=*Undefined if not building from within Visual Studio*" -d"SolutionDir=*Undefined if not building a solution or within Visual Studio*" -d"SolutionExt=*Undefined if not building a solution or within Visual Studio*" -d"SolutionFileName=*Undefined if not building a solution or within Visual Studio*" -d"SolutionName=*Undefined if not building a solution or within Visual Studio*" -d"SolutionPath=*Undefined if not …Run Code Online (Sandbox Code Playgroud) 我试图阻止某些(MSTest)单元测试在我们的构建服务器上运行.我真的只想添加一个TestCategory,然后指定:
/category:"!RequiresLoginCredentials"
Run Code Online (Sandbox Code Playgroud)
但我不确定如何在msbuild项目文件中指出.
构建文件的相关部分目前具有:
<ItemGroup>
<!-- TEST ARGUMENTS
If the RunTest property is set to true then the following test arguments will be used to run
tests. Tests can be run by specifying one or more test lists and/or one or more test containers.
To run tests using test lists, add MetaDataFile items and associated TestLists here. Paths can
be server paths or local paths, but server paths relative to the location of this file are highly
recommended:
<MetaDataFile Include="$(BuildProjectFolderPath)/HelloWorld/HelloWorld.vsmdi"> …Run Code Online (Sandbox Code Playgroud) 我有几个自定义MSBuild项目文件<ProjectReferences>.我正在调用<MSBuild Projects="@(ProjectReference)" Targets="Build">任务,我可以使用该<Output TaskParameter="TargetOutputs" ItemName="OutputAssemblies" />元素获取所有构建的程序集,并且我将@(OutputAssemblies)复制到目标目录.
我希望能够从ResolveAssemblyReferences目标获取@(ReferenceCopyLocalPaths)项属性,但我无法弄清楚如何输出此属性.
<Target Name="BuildDocumentationForReferencedProjects">
<MSBuild
Projects="@(ProjectReference)"
Targets="Build"
BuildInParallel="true"
Properties="DocumentationFile=$(DllDir)\%(FileName).xml"
>
<Output TaskParameter="TargetOutputs" ItemName="OutputAssemblies" />
</MSBuild>
<Copy SourceFiles="@(OutputAssemblies)" DestinationFolder="$(DllDir)" />
</Target>
Run Code Online (Sandbox Code Playgroud) 我在同一目录中有.dll和.targets文件.在.targets文件中,我想将.dll添加到ItemGroup项.但是,如果我只是添加它类似于:
<Example Include="Example.dll" />
Run Code Online (Sandbox Code Playgroud)
Example.dll的路径似乎是相对于包含.targets文件的.csproj进行解析.如何将项目添加到.targets文件中的ItemGroup,并使用这样的相对路径?
例如,假设我有:
C:\lib\Example.dll
C:\lib\Example.targets
C:\src\Example.csproj
Run Code Online (Sandbox Code Playgroud)
从.targets文件中包含Example.dll时,完整路径解析C:\src\Example.dll为错误,我想要的是C:\lib\Example.dll.有没有人有什么建议?