Code to install files to the GAC doesn't seem to work
Basically we ran into where, for whatever reason, we had to put some 3rd party dll in the GAC for it to work correctly. (The assemblies loaded, but had weird 开发者_高级运维behavior and trouble finding types in the loaded assemblies. The app itself is a add in to another 3rd party program, so it must be something about how its being loaded.) So I tried to write some quick code to handle this without having to manually do this on each machine it was needed on.
This is basically what the code boils down to:
Dim X As New System.EnterpriseServices.Internal.Publish
X.GacInstall(name)
Where name is the filename of the dll. This runs without error. It even add the assembly to the GAC. However, the application still experiences the same issue until you manually add the assembly in .Net Configuration window.
Do you think there is another step that needs to be done in my code?
If you have administrator permissions enabled on windows directory, this might fail to install.
精彩评论