【问题标题】:VS2010 compiler auto-generates unwanted .vsprops file in MSBuild projectVS2010 编译器在 MSBuild 项目中自动生成不需要的 .vsprops 文件
【发布时间】:2011-10-05 03:38:57
【问题描述】:

我有一个 PrimaryBuild.targets 文件,我通过 Team Foundation Server 构建定义使用 MSBuild 构建该文件。此文件调用其他 msbuild 任务来构建包含在我的组件和许多其他目标中的所有 VB 解决方案。

(msbuild PrimaryBuild.targets)

/t:FullBuild;Deploy /p:Decorator=NTBMDev;DropLocation=\\xxx.xxx.xxx.xxx\;CurrentBranch=DEV;Configuration=Debug

当我在本地计算机上批量构建它时,一切似乎都很好。当我在构建服务器上构建它时,会在构建过程中创建一个 PrimaryBuild.target.vsprops 文件。 IT 覆盖了我的项目的 OutputDirectory,并且所有输出文件都复制到了错误的文件夹中(我的部署目标找不到它)

<?xml version="1.0" encoding="utf-8"?>
<VisualStudioPropertySheet ProjectType="Visual C++" Version="8.00" Name="Team Build Overrides" OutputDirectory="C:\Builds\7\NexTra\BMDEV\Binaries" />

在构建过程中没有任何地方构建 VC++ 项目,我只使用 VB 项目或编写自己的目标。此外,这是在服务器上构建期间创建 .vsprops 的唯一组件,其他组件工作正常。我什至不知道我应该在哪里搜索,为什么这个项目会创建这个文件。
如果有帮助 - 这是我日志中的 CoreCompile:

c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Vbc.exe /noconfig /baseaddress:11000000 /imports:Microsoft.VisualBasic,System,System.Collections,System.Data,System.Diagnostics /optioncompare:Binary /optionexplicit+ /optionstrict+ /nowarn:42353,42354,42355 /optioninfer+ /nostdlib /removeintchecks- /sdkpath:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0" /doc:obj\Debug\RuleSet.BM.xml /define:"CONFIG=\"Debug\",DEBUG=-1,TRACE=-1,_MyType=\"Windows\",PLATFORM=\"AnyCPU\"" /reference:**********.dll,***********.dll,***********.dll,*************.dll,"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll","C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.dll","C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll","C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Drawing.dll","C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Windows.Forms.dll","C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll" /debug+ /debug:full /keyfile:..\..\..\Transformer.snk /optimize- /out:obj\Debug\RuleSet.BM.dll /target:library /warnaserror- RuleSet.BM.vb AssemblyInfo.vb RuleSetInfo.vb "C:\Documents and Settings\pl-nextrabuild\Local Settings\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.vb" /warnaserror+:41999,42016,42017,42018,42019,42020,42021,42022,42032,42036

【问题讨论】:

    标签: .net visual-studio-2010 msbuild vsprops


    【解决方案1】:

    .vsprops 文件由 TFS 创建,以防万一有任何 C++ 项目,它不会在您的构建中使用。然而,它确实包含 TFS 也为所有其他项目创建的相同的 $(OutDir) 更改。查看文件,

    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets
    

    并查看 CoreCleanSolution 目标以查看逻辑。在您的 TFS 构建过程模板中搜索 OutDir 以查看 TFS 如何更改此属性,这就是您的项目构建到备用位置的原因。

    【讨论】:

    • 谢谢,正是这个问题。我昨天偶然发现它,只是通过创建新的构建配置。然后我比较了定义,发现我小组中的某个人在 .xaml 模板中进行了很多更改。切换到我们的默认模板很有帮助。谢谢!
    猜你喜欢
    • 1970-01-01
    • 2015-04-07
    • 2021-04-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-29
    相关资源
    最近更新 更多