简体   繁体   中英

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. Please bear with me.

I have a solution and within that solution is a project that is executing an SSIS package remotely. 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 ?). 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:\\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

When I clean and build the solution from within Visual Studio 2015, everything builds fine. However when I call MSBuild on the solution from my deployment script, I get many errors saying that the references do not exist. 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. You must add a reference to assembly 'Microsoft.SqlServer.ConnectionInfo, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'. [C:\\TestModule\\SSISTests\\SSISTests.csproj]

Is there an option I am not passing to MSBuild that would solve this problem? This is not a dependency issue (I don't think) because no other projects are needed by this project - just these SQL Server assemblies.

Open your csproj file and check to see if that DLL is correctly referenced. Also, see if you can run MSBuild against just the csproj and not the sln. Might be a pathing issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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