Loading a DLL in the GAC - dll

currently I have a problem with getting a DLL into the Windows GAC. I tried to follow the steps of creating a DLL and loading it as described in this blog post:
http://blogs.technet.com/b/cloudpfe/archive/2014/02/01/how-to-create-a-custom-authentication-provider-for-active-directory-federation-services-3-0-part-2.aspx
At the point where I try calling the following command:
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7514a164b89fa979")
I get an error which tells me that System.EnterpriseServices could not be found:
Exception calling "Load" with "1" argument(s): "Could not load file or
assembly 'System.EnterpriseServices, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=7514a164b89fa979' or one of its dependencies. The
system cannot find the file specified."
The specified DLL (System.EnterpriseServices) does exist* on the machine.
So now my question is, why can't this method find the DLL and what do I have to do/change to get this command to work?
NOTE: I Tried this on a vanilla Windows Server 2012 R2 with just ADFS parts installed; And I've called the command from the Powershell.
*UPDATE: The System.EnterpriseServices DLL resides in
C:\Windows\Microsoft.NET\assembly\GAC_64\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a
and
C:\Windows\WinSxS\amd64_system.enterpriseservices_b03f5f7f11d50a3a_4.0.9600.1638‌​4_none_53a3f9b13fac0ba5\
So it should be available from the GAC.

I think your public Key token is incorrect, you found your own answer with your update :) .
It should be
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
Give this a try.

Related

Getting an Unexpected Error in dotnet core Project

In my solution Explorer(Visual Studio) there are 5 projects
DigiIdentity(webapi)
Core(class library)
Data(class library)
Services(class library)
DigiPigmyApi(webapi)
DigiSyncApi(webapi)
I am getting following error while running the project(solution)
Error CS1705 Assembly 'Microsoft.AspNetCore.Hosting' with identity 'Microsoft.AspNetCore.Hosting, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' uses 'Microsoft.AspNetCore.Hosting.Abstractions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' which has a higher version than referenced assembly 'Microsoft.AspNetCore.Hosting.Abstractions' with identity 'Microsoft.AspNetCore.Hosting.Abstractions, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
Actually I am not finding the Microsoft.AspNetCore.Hosting.Abstractions, Version=1.1.1.0 package anywhere, can any one tell me the exact course of the error.

System.IO.FileLoadException: Could not load file or assembly 'IBM.Data.DB2'

I am currently working on Outlook 2013 Addin Projects using visual studio 2013 and Visual Basic .Net. However, when I try to connect to DB2 Database. It shows that the dll files that I added into the project reference cannot be loaded.
What I do is add a new panes with a button in outlook which will look a windows form in outlook when the button is clicked. Onload the form, it will connect to DB2 and the below error message occur
System.IO.FileLoadException: Could not load file or assembly 'IBM.Data.DB2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7c307b91aa13d208' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)
File name: 'IBM.Data.DB2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7c307b91aa13d208'
=== Pre-bind state information ===
LOG: DisplayName = IBM.Data.DB2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7c307b91aa13d208
(Fully-specified)
LOG: Appbase = file:///C:/Users/D0259/Documents/Visual Studio 2013/Projects/OutlookAddIn3/OutlookAddIn3/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : OutlookAddIn3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: IBM.Data.DB2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7c307b91aa13d208
LOG: Attempting download of new URL file:///C:/Users/D0259/Documents/Visual Studio 2013/Projects/OutlookAddIn3/OutlookAddIn3/bin/Debug/IBM.Data.DB2.DLL.
ERR: Failed to complete setup of assembly (hr = 0x80131045). Probing terminated.
Other windows form project using the same dll is working. Really need some advice on this. Anyone face this error before? Viewers' help is highly appreciated.

Running SSIS package on SQL 2014

I created a new sql job in SQL2014 with an SSIS package created in SQL 2005.
The job is failing with this error:
Source: Ready data to zip Ready data to zip Description: There was an exception while loading Script Task from XML: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Tools.Applications.Core, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.VisualStudio.Tools.Applications.Core, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at Microsoft.SqlServer.IntegrationServices.VSTA.VstaHelper.b__1a() at Microsoft.SqlServer.VSTAHosting.VSTAScriptingEngine.DisposeVstaHelper() at Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptTask.MigrateVSAScriptTask(XmlElement elemProj, IDTSInfoEvents events) at Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptTask.LoadFromXML(XmlElement elemProj, IDTSInfoEvents events)
Can you please explain the error? I think I'm missing some files.
This is a longshot, but you may be attempting to run the 32-bit version of DTExec. By default, it's not installed on a 64-bit machine unless you install the client components - which may mean you have an incomplete installation.

dll not loading- FileLoadException

The problem I am having is that I am getting a System.IO.FileLoadException when trying to load the RWLock.dll on a test box and Windows xp machines.
This is the exception that is thrown when it tries to load the dll on the windows 2003 server machine (most likely 32 bit):
System.IO.FileLoadException: A procedure imported by 'rwlock, Version=1.0.3889.27926, Culture=neutral, PublicKeyToken=null' could not be loaded.
File name: 'rwlock, Version=1.0.3889.27926, Culture=neutral, PublicKeyToken=null' ---> System.Runtime.InteropServices.COMException (0x8007007F): The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)...
However, we have not had any problems trying to run this on a Windows 2007* server machine (64 bit).
Any ideas? Thanks in advance :)
*windows 2008(oops)
The error message is telling you that RWLock.dll tries to import a function that doesn't exist from another DLL. This probably means that RWLock is trying to import an API function that exists on the (I presume you meant instead of "Windows 2007 Server") Windows 2008 Server machine, but not on Windows 2003 or earlier.
You can use Dependency Walker to figure out what it's trying to load and where it's trying to find that missing function, but it won't help make it available on the Windows versions where it doesn't exist.
The other possibility is that RWLock has a dependency on another DLL that it provides, but you're not re-distributing it properly. Dependency Walker can help with this, too.

PRISM exception on not existing method

I am using PRISM for Silverlight 4.0 in one of my projects where I also access Sharepoint 2010.
The strange thing is that randomly I get the error:
An exception occurred while initializing module 'SharepointServiceModule'.
- The exception message was: Die Methode add_GetListCompleted im Typ SharepointServiceModule.Services.SharepointObjectModelService der Assembly SharepointServiceModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null hat keine Implementierung.
- The Assembly that the module was trying to be loaded from was:SharepointServiceModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
Check the InnerException property of the exception for more information. If the exception occurred while creating an object in a DI container, you can exception.GetRootException() to help locate the root cause of the problem.
Which is very strange for me because first of all it happens only randomly and second that the method "add_GetListCompleted" is an event which must be implemented because I use it and it works.
Does anybody have an idea of whats going on here?
I found a solution for my problem.
First I tried to change the name of the interface and I noticed that the interface name did not change in the error message.
Therefore I removed the affected xap module from the Web project (this can be done in the properties of the "name.Web" project under "Silverlight Applications") and added it again. Then I performed a clean of the solution and a rebuild. After that everthing worked fine...