FileNotFoundException: Automapper.Net4 in Silverlight 5 with Automapper 3.1.0

774 Views Asked by At

I have strange issue in one of my machine with project on Silverlight 5 with Automapper 3.1.0 where I get following error:

System.IO.FileNotFoundException occurred
Message=Could not load file or assembly 'AutoMapper.Net4, Version=3.1.0.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005' or one of its dependencies.
The system cannot find the file specified.

I have tried all options but not able to find out why I get this error in the project.

1

There are 1 best solutions below

0
On

Quoting Jimmy Bogard on this issue:

It just tried to load anything it can find - because I can't detect the runtime, I can't know the exact right assembly, so I just go off a hard-coded, well-known list ( https://github.com/AutoMapper/AutoMapper/blob/f969b94444e6e3c1c71a3582cc6132044b983ed6/src/AutoMapper/Internal/PlatformAdapter.cs#L7). I then just use NuGet's multi-platform capabilities to make sure your project only references the platform-specific assemblies, even though in the package I have all platforms inside.

Basically this means that right now you can either disable "Break on all exceptions" or hit F5, since this won't be a problem (the exception is caught internally).