【问题标题】:Path to TlbExp/TlbImp during build with MsBuild (VS2015)使用 MsBuild (VS2015) 构建期间 TlbExp/TlbImp 的路径
【发布时间】:2016-02-22 07:35:56
【问题描述】:

我切换了一些解决方案,在只有 VS2015 和 buildagent 的干净构建机器上使用最新的框架和工具集进行构建。

对于所有 vc 项目,路径变量“TargetFrameworkSDKToolsDirectory”符合我的需要。它看起来像这样:

"$(TargetFrameworkSDKToolsDirectory)tlbimp.exe" $(TargetPath) /verbose /strictref /asmversion=$(Version) /out:$(DropLocation)

但是对于 c#-projects 我找不到任何解决方案。之前的解决方案如下所示:

"$(WindowsSDKDir)\bin\NETFX 4.0 Tools\tlbexp" $(TargetPath) /out:$(ProjectDir)\bin\$(ConfigurationName)\$(TargetName).tlb

但是 buildmachine 不知道“WindowsSDKDir”或“FrameworkSDKdir”,我希望尽可能少地进行自定义。

我无法想象我是唯一一个遇到这个问题的人,所以我希望找到一个已经解决这个问题的人。

【问题讨论】:

    标签: c# msbuild alm


    【解决方案1】:

    我发现满足我需求的最佳解决方案是在 buildmachine 上安装 Windows SDK 并将 TargetFrameworkSDKToolsDirectory 用于 c# 和 c++ 项目。

    【讨论】:

      【解决方案2】:

      我正在使用:

      call "$(VS140COMNTOOLS)vsvars32.bat" 
      tlbexp.exe "$(TargetPath)" /out:"$(SolutionDir)CommonFiles\$(TargetName).tlb"
      

      这不仅适用于 Visual Studio,而且如果您使用 msbuild 构建...

      我不建议使用:

      call "$(DevEnvDir)..\Tools\vsvars32.bat"
      

      因为它只能在 Visaul Stuio 内部工作,但会因 msbuild 失败...

      确保您已安装 Windows SDK(Visual Studio 的一部分)。

      【讨论】:

        猜你喜欢
        • 2013-10-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-10-24
        相关资源
        最近更新 更多