Understanding the GAC: Starting with the question "Microsoft.SqlServer.SqlClrProvider.dll not found"
Sinomfirst, look at the truth, as follows:
First, the problem descriptionI used MICROSOFT.SQLSERVER.SMO to develop a database management tool to manage SQL Server based on customized requirements. The above error is prompted after deployment to the client. And this file on my computer using a full search, in any case also cannot search.
second, the tracedafter research, it is found that this file is a Runtime support library of SQLServer2012, which exists in Sqlsysclrtype.msi, as follows:
http://www.microsoft.com/zh-cn/download/details.aspx?id=43339
Contains two versions of x86 and x64, please use them according to your needs.
Iii. Methods of Use
Of course, we can install Sqlsysclrtype.msi to the client, in fact we only need this dynamic library file:
microsoft.sqlserver.sqlclrprovider.dll in fact, we just need to deploy this file with our EXE to the client, but after installing Sqlsysclrtype.msi, we still can't find this dynamic library on this machine.
This file was originally installed in the GAC of the system!!!
What is the GAC?to improve system security, Microsoft has added a new--uac (User account Control) to the Windows system since Vista was launched, a new technology that has constrained many operations, especially system settings, file modifications, Win7, as a derivative, is also protected by UAC. in. NET project development, for some class library projects or user control projects, when program development is complete, it is sometimes necessary to deploy the developed assembly to the GAC (Global Assembly Cache) so that other programs can also invoke it. in general, there are two ways to install an assembly to the GAC:1. Manually drag the assembly (DLL file) to the C:/windows/assembly folder. 2. Install using the command line or the Global Assembly Cache tool gacutil.
That's it
!
The GAC directory is in c:\windows\assembly, and this directory is not allowed to copy and paste directly, only use the command line, you will find that the GAC's directory structure differs from the directory that Windows Explorer presents to you:
to get the files out, you need to use the command line:
so you can get the dynamic library you need!!!
Understanding the GAC: Starting with the question "Microsoft.SqlServer.SqlClrProvider.dll not found"