Reputation: 7374
I'm using ASP.NET MVC3, StructureMap and SharpSvn.
Here's the code that I'm using:
public class SvnFileReader : ISvnFileReader
{
private readonly string _svnAddress;
public SvnFileReader(string svnAddress)
{
_svnAddress = svnAddress;
}
public void DownloadFiles(DirectoryInfo destination)
{
using (var svnClient = new SvnClient())
{
// checkout the code to the specified directory
svnClient.CheckOut(new Uri(_svnAddress), destination.FullName);
}
}
}
When I execute this code:
_svnFileReader.DownloadFiles(new System.IO.DirectoryInfo(@"d:\test"));
I get the following error message:
Could not load file or assembly 'file:///D:\Projects\SvnFileReaderDemo\bin\SharpSvn-DB44-20-Win32.dll' or one of its dependencies. The module was expected to contain an assembly manifest.
Any help would be greatly appreciated!
Upvotes: 1
Views: 2093
Reputation: 1038790
You should exclude the SharpSvn DLLs from StructureMap automatic assembly scanning for dependencies. This is an unmanaged library but because you have configured StructureMap to look for types in all dlls when it tries to load this one it breaks.
UPDATE:
If you are running this code on a x64 bit OS you may try downloading the specific x64 SharpSvn which uses SharpSvn-DB44-20-x64.dll
.
Upvotes: 1