简体   繁体   English

MSBuild无法解析指向GAC外部的引用

[英]MSBuild not resolving references pointing outside of GAC

I am new to C# so it may be possible that I am not asking the right questions. 我是C#的新手,所以我可能没有问正确的问题。 Please bear with me. 请多多包涵。

I have a solution and within that solution is a project that is executing an SSIS package remotely. 我有一个解决方案,并且在该解决方案中是一个可以远程执行SSIS包的项目。 After some research I discovered that in order to do so I needed to create some references to DLLs that were "outside" of the GAC (General Assembly Catalog ?). 经过一番研究,我发现为了做到这一点,我需要创建一些对GAC(大会目录?)之外的DLL的引用。 The following assemblies were referenced: 引用了以下程序集:

C:\\Windows\\assembly\\GAC_MSIL\\Microsoft.SqlServer.Management.IntegrationServices\\11.0.0.0__89845dcd8080cc91\\Microsoft.SqlServer.Management.IntegrationServices.dll C:\\ WINDOWS \\装配\\ GAC_MSIL \\ Microsoft.SqlServer.Management.IntegrationServices \\ 11.0.0.0__89845dcd8080cc91 \\ Microsoft.SqlServer.Management.IntegrationServices.dll

C:\\Program Files (x86)\\Microsoft SQL Server\\110\\SDK\\Assemblies\\Microsoft.SqlServer.Management.Sdk.Sfc.dll C:\\ Program Files(x86)\\ Microsoft SQL Server \\ 110 \\ SDK \\ Assemblies \\ Microsoft.SqlServer.Management.Sdk.Sfc.dll

C:\\Program Files (x86)\\Microsoft SQL Server\\110\\SDK\\Assemblies\\Microsoft.SqlServer.Smo.dll C:\\ Program Files(x86)\\ Microsoft SQL Server \\ 110 \\ SDK \\ Assemblies \\ Microsoft.SqlServer.Smo.dll

When I clean and build the solution from within Visual Studio 2015, everything builds fine. 当我从Visual Studio 2015中清理并生成解决方案时,一切都可以正常运行。 However when I call MSBuild on the solution from my deployment script, I get many errors saying that the references do not exist. 但是,当我从部署脚本中的解决方案中调用MSBuild时,出现许多错误,指出引用不存在。 For example, here is one of those errors: 例如,这是这些错误之一:

"C:\\TestModule\\SSISTests\\SSISTests.csproj" (default target) (10) -> (CoreCompile target) -> SSISTests.cs(78,17): error CS0012: The type 'Microsoft.SqlServer.Management.Common.ISfcConnection' is defined in an assembly that is not referenced. “ C:\\ TestModule \\ SSISTests \\ SSISTests.csproj”(默认目标)(10)->(CoreCompile目标)-> SSISTests.cs(78,17):错误CS0012:类型为'Microsoft.SqlServer.Management.Common。 ISfcConnection'是在未引用的程序集中定义的。 You must add a reference to assembly 'Microsoft.SqlServer.ConnectionInfo, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'. 您必须添加对程序集'Microsoft.SqlServer.ConnectionInfo,Version = 11.0.0.0,Culture = neutral,PublicKeyToken = 89845dcd8080cc91'的引用。 [C:\\TestModule\\SSISTests\\SSISTests.csproj] [C:\\ TestModule \\ SSISTests \\ SSISTests.csproj]

Is there an option I am not passing to MSBuild that would solve this problem? 我没有传递给MSBuild的选项可以解决此问题吗? This is not a dependency issue (I don't think) because no other projects are needed by this project - just these SQL Server assemblies. 这不是依赖性问题(我不认为),因为该项目不需要其他任何项目-仅这些SQL Server程序集。

Open your csproj file and check to see if that DLL is correctly referenced. 打开您的csproj文件,并检查该DLL是否被正确引用。 Also, see if you can run MSBuild against just the csproj and not the sln. 另外,请查看是否可以仅对csproj而不对sln运行MSBuild。 Might be a pathing issue. 可能是一个棘手的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM