关于部署与SMO相关的许多程序集,我有一点问题.我的项目中有以下5个参考文献:
每个都是一个库文件夹中的.dll,它是从中添加引用的地方,每个都设置为Copy Local = true.项目文件显示所有这些都是按顺序的,例如:
<Reference Include="Microsoft.sqlServer.Smo,Version=10.0.0.0,Culture=neutral,PublicKeyToken=89845dcd8080cc91,processorArchitecture=MSIL"> <HintPath>..\Libraries\Microsoft.sqlServer.Smo.dll</HintPath> <Private>True</Private> </Reference>
问题是,每次在PC上从Visual Studio发布时,程序集都不会被复制.当我发布通过TeamCity(绝对没有安装sql Server或SMO SDK)时,同样的事情.我可以手动复制程序集,并且事情运行正常(没有GAC依赖),但显然我想将其封装在部署过程中.
什么可以阻止这些大会出版?
解决方法
我相信你不应该只是在部署基于SMO的应用程序时复制DLL.看到这个链接:
Distributing an Application That Uses SQL Server Management Objects.我引用:
If you develop an application that uses sql Server Management Objects,
you need to make sure that the necessary support files are present on
the computer with the application. The sql Server 2008 feature pack
contains a redistributable package for the sql Server Management
Objects.
您将需要从此下载链接获取SharedManagementObjects.msi:http://www.microsoft.com/download/en/details.aspx?id=16978