Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF Prism application - Automapper causes System.Core load failure
    primarykey
    data
    text
    <p>I have a WPF 4.5 Prism project which works fine until I add Automapper 3.0 to it. When I add Automapper to my DAL in order to translate from Entity Framework objects to DTOs, the application fails in runtime, seemingly immediately after shell creation. I read somewhere that Automapper isn't completely deployed in some cases, so I have added references to Automapper and Automapper.Net4 to the Shell project as well to make sure everything is deployed.</p> <p>This is the error message I get:</p> <pre><code>Could not load file or assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The system cannot find the file specified. </code></pre> <p>Here is the code I added that causes the exception:</p> <pre><code>namespace DAL { [PartCreationPolicy(CreationPolicy.NonShared)] [Export(typeof(ICampaignActionDataAccess))] public class CampaignActionDataAccess : ICampaignActionDataAccess { public CampaignActionDataAccess() { //if (Mapper.FindTypeMapFor&lt;CampaignAction, CampaignActionDTO&gt;() == null) // Mapper.CreateMap&lt;CampaignAction, CampaignActionDTO&gt;(); //if (Mapper.FindTypeMapFor&lt;CampaignActionGroup, CampaignActionGroupDTO&gt;() == null) // Mapper.CreateMap&lt;CampaignActionGroup, CampaignActionGroupDTO&gt;(); //if (Mapper.FindTypeMapFor&lt;CampaignActionDescriptor, CampaignActionDescriptorDTO&gt;() == null) // Mapper.CreateMap&lt;CampaignActionDescriptor, CampaignActionDescriptorDTO&gt;(); } public IEnumerable&lt;CampaignActionDTO&gt; GetAllActiveCampaignActions() { //using (var db = new CampaignActionEntities()) //{ // var actions = (from ca in db.CampaignActions.Include(d =&gt; d.CampaignActionDescriptors) // where ca.IsValid == true // select ca).ToList(); // return Mapper.Map&lt;IEnumerable&lt;CampaignActionDTO&gt;&gt;(actions); //} throw new NotImplementedException(); } } </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload