I'm trying to instantiate the WorkItemStore Class in my MVC 6 (dnx 4.5) web app but I'm getting the following DllNotFoundException error.
An exception of type 'System.DllNotFoundException' occurred in Microsoft.TeamFoundation.WorkItemTracking.Client.DataStoreLoader.dll but was not handled in user code
Additional information: Unable to load DLL 'Microsoft.WITDataStore32.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
This is my code.
200Uri = new Uri("http://x contains tfs server link of company x");
200ProjectCollection = new TfsTeamProjectCollection(200Uri);
200WorkItemStore = new WorkItemStore(200ProjectCollection);
The more amazing thing is that the same class and code works on my previous ASP 4.5 Windows Forms app. Is this a problem with Dot Net Core? I've already switched to dnx 4.5.1 in dot net core? or MVC 6? Is this a problem with 32-64 bits library?
More details about the error-
System.DllNotFoundException - {"Unable to load DLL 'Microsoft.WITDataStore32.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"}
Data - {System.Collections.ListDictionaryInternal}
HelpLink - Null
InnerException - null
Message - Unable to load DLL 'Microsoft.WITDataStore32.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Source: Microsoft.TeamFoundation.WorkItemTracking.Client.DataStoreLoader
StackTrace - at Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore.DataStoreNative32.CreateDatastore(IntPtr& handle)
at Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore.DataStoreNative.CreateDatastore(IntPtr& handle)
at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.InitializeInternal()
at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.Microsoft.TeamFoundation.Client.ITfsTeamProjectCollectionObject.Initialize(TfsTeamProjectCollection teamProjectCollection)
at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore..ctor(TfsTeamProjectCollection teamProjectCollection, WorkItemStoreFlags workItemStoreFlags)
at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore..ctor(TfsTeamProjectCollection teamProjectCollection)
at FinalApp1.Models.Config..ctor() in C:\Users\eashan\Documents\Building a Web App using ASP 5\FinalApp1\src\FinalApp1\Models\Config.cs:line 23
TargetSite - {Void CreateDatastore(IntPtr ByRef)}
TypeName - ""
Any kind of help will be appreciated.
Microsoft.TeamFoundationServer.ExtendedClient.Microsoft.WindowsAzure.ConfigurationManager.
Here is the resultant project.json file (with sections deleted for clarity.)
{
"dependencies": {
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.TeamFoundationServer.ExtendedClient": "14.89.0",
"Microsoft.WindowsAzure.ConfigurationManager": "3.2.1"
}
"frameworks": {
"dnx451": { }
}
}
After installing those two packages, the following code builds and runs.
var xUri = new Uri("http://www.somedomain.com");
var xProjectCollection = new TfsTeamProjectCollection(xUri);
var xWorkItemStore = new WorkItemStore(xProjectCollection);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With