Visual Studio Package (vsix) - Team City没有安装Visual Studio
本文关键字:Visual Studio City 安装 Team Package vsix | 更新日期: 2023-09-27 18:08:02
我正在创建一个Visual Studio包(vsix)(无耻的插头:pMixins),我想使用TeamCity持续集成服务器构建vsix包。TeamCity在后台使用MSBuild。
我很乐意在我的构建代理上安装Visual Studio SDK,但我确实不想要安装Visual Studio的完整版本。当我运行Visual Studio SDK安装程序时,它抱怨Visual Studio不存在。
How can I use MSBuild (via TeamCity) to build my vsix without having to install Visual Studio?
我已经复制了C:'Program Files (x86)'MSBuild'Microsoft'VisualStudio'v11.0'VSSDK'Microsoft.VsSDK.targets
目标文件,但现在我被困在如何安装所需的程序集:
[MSBuild output] (ResolveAssemblyReferences target) ->
[22:25:37][MSBuild output] C:'Windows'Microsoft.NET'Framework'v4.0.30319'Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "extensibility". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity]
[22:25:37][MSBuild output] C:'Windows'Microsoft.NET'Framework'v4.0.30319'Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.Designer.Interfaces". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity]
[22:25:37][MSBuild output] C:'Windows'Microsoft.NET'Framework'v4.0.30319'Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.OLE.Interop". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity]
[22:25:37][MSBuild output] C:'Windows'Microsoft.NET'Framework'v4.0.30319'Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.Shell.Interop". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity]
[22:25:37][MSBuild output] C:'Windows'Microsoft.NET'Framework'v4.0.30319'Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.Shell.Interop.8.0". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity]
[22:25:37][MSBuild output] C:'Windows'Microsoft.NET'Framework'v4.0.30319'Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.Shell.Interop.9.0". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity]
[22:25:37][MSBuild output] C:'Windows'Microsoft.NET'Framework'v4.0.30319'Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.Shell.Interop.10.0". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity]
[22:25:37][MSBuild output] C:'Windows'Microsoft.NET'Framework'v4.0.30319'Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.Shell.Interop.11.0". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity]
[22:25:37][MSBuild output] C:'Windows'Microsoft.NET'Framework'v4.0.30319'Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.TextManager.Interop". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity]
[22:25:37][MSBuild output] C:'Windows'Microsoft.NET'Framework'v4.0.30319'Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.Shell.11.0". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity]
[22:25:37][MSBuild output] C:'Windows'Microsoft.NET'Framework'v4.0.30319'Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.Shell.Immutable.10.0". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity]
[22:25:37][MSBuild output] C:'Windows'Microsoft.NET'Framework'v4.0.30319'Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.Shell.Immutable.11.0". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity]
[22:25:37][MSBuild output] C:'Windows'Microsoft.NET'Framework'v4.0.30319'Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "VSLangProj, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity]
[22:25:37][MSBuild output] C:'Windows'Microsoft.NET'Framework'v4.0.30319'Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "VSLangProj80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity]
[22:25:37][MSBuild output]
[22:25:37][MSBuild output]
[22:25:37][MSBuild output] "D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity" (Build target) (1) ->
[22:25:37][MSBuild output] (ResolveComReferences target) ->
[22:25:37][MSBuild output] C:'Windows'Microsoft.NET'Framework'v4.0.30319'Microsoft.Common.targets(2015,5): warning MSB3284: Cannot get the file path for type library "80cc9f66-e7d8-4ddd-85b6-d9e6cd0e93e2" version 8.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)) [D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity]
[22:25:37][MSBuild output] C:'Windows'Microsoft.NET'Framework'v4.0.30319'Microsoft.Common.targets(2015,5): warning MSB3284: Cannot get the file path for type library "26ad1324-4b7c-44bc-84f8-b86aed45729f" version 10.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)) [D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity]
[22:25:37][MSBuild output] C:'Windows'Microsoft.NET'Framework'v4.0.30319'Microsoft.Common.targets(2015,5): warning MSB3284: Cannot get the file path for type library "1a31287a-4d7d-413e-8e32-3b374931bd89" version 8.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)) [D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity]
[22:25:37][MSBuild output] C:'Windows'Microsoft.NET'Framework'v4.0.30319'Microsoft.Common.targets(2015,5): warning MSB3284: Cannot get the file path for type library "2ce2370e-d744-4936-a090-3fffe667b0e1" version 9.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)) [D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity]
[22:25:37][MSBuild output] C:'Windows'Microsoft.NET'Framework'v4.0.30319'Microsoft.Common.targets(2015,5): warning MSB3284: Cannot get the file path for type library "1cba492e-7263-47bb-87fe-639000619b15" version 8.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)) [D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity]
[22:25:37][MSBuild output] C:'Windows'Microsoft.NET'Framework'v4.0.30319'Microsoft.Common.targets(2015,5): warning MSB3283: Cannot find wrapper assembly for type library "stdole". Verify that (1) the COM component is registered correctly and (2) your target platform is the same as the bitness of the COM component. For example, if the COM component is 32-bit, your target platform must not be 64-bit. [D:'BuildServer'TeamCity_Agent'work'd059d781c29b14d2'pMixins.VSPackage'pMixins.VSPackage.csproj.teamcity]
[22:25:37][MSBuild output]
[22:25:37][MSBuild output] 20 Warning(s)
[22:25:37][MSBuild output] 0 Error(s)
Nicodemeus是对的,这是一项非琐碎的任务,但这是可能的。
这篇MSDN文章Visual Studio扩展和构建服务器介绍了Visual Studio 2010的过程。
看起来你正在尝试构建一个VS 2013包,所以会有一些修改:
- 你需要引用2013 SDK程序集而不是2010 SDK程序集
- 你需要确保你在TeamCity上使用MSBuild 12,并在构建代理上安装。net 4.5.1: MSBuild 12在TeamCity中没有找到。net 4.5.1的参考程序集
您将发现这是一项艰巨的任务,沿途有许多捕获,您的最终解决方案将是安装所需的程序集,如果您有权限的话。
即使你创建了包,底层的构建任务也会搜索环境变量和注册表项,以便检测VsSdk的安装路径(严肃地说,反思一下Microsoft.VsSDK.Build.Tasks.FolderLocator GetSDKInstallationPath()的VsSdk构建任务集)。
因此,要使VsSdk在没有安装程序的情况下工作,您需要对机器进行管理访问,并能够将安装包放在必要的注册表项和环境变量及其相应的位,并创建一个自定义的NuGet包来部署,但是当您到达这一点时,您会发现您已经重新发明了轮子,应该刚刚安装了必要的VsSdk MSI。