1

I just installed postal for ASP MVC with NuGet and tried compiling it after I set up some code to send an email. I was given an error that is telling me I need to use MVC version 5.1 for Postal version 0.9.2. My MVC project is a MVC 4 project type that uses .net 4.5 and I'm in VS 2013 Pro. Is there a way to configure this differently to get it to work?

Here is my error message

Error 2 Assembly 'Postal, Version=0.9.2.0, Culture=neutral, PublicKeyToken=45719375b8b4d528' uses 'System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' c:\TFS\OULUVU\OULUVU\packages\postal.0.9.2\lib\net40\Postal.dll OULUVU

There was a warning with it that says

Warning 1 Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. OULUVU

chuckd
  • 13,460
  • 29
  • 152
  • 331
  • as soon as I add the using statement 'using postal' in my cs file I get the error. – chuckd Jun 14 '14 at 20:43
  • I got it to work by uninstalling postal 0.9.2 and installing 0.8.2, not shure why this works but some compatibility issue. If anyone knows how to get 0.9.2 working in VS 2013 MVC4 let me know! – chuckd Jun 14 '14 at 20:47
  • Why not upgrade to MVC5? – Erik Funkenbusch Jun 14 '14 at 21:38
  • can I do that without creating a new project? Is there a way to upgrade my MVC4 project to 5? – chuckd Jun 14 '14 at 22:54
  • Of course you can. Although there is a bit of a process to it. See http://www.asp.net/mvc/tutorials/mvc-5/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2 – Erik Funkenbusch Jun 14 '14 at 22:57
  • Upgradding is a mission! I tried that when I ran into the same problem with Postal. It would have ended up easier for me to reverse the changes but instead I created a new MVC4 project and just copied everything over. It was stable then. VisualSutdio just goes and downalods new DLL's while the project runs on the old DLL's. Its rubbish and just happened to me today again with the MVC5. – Piotr Kula Jul 14 '14 at 12:55

2 Answers2

1

There are now specific nuget packages for each version of MVC. So, for example, install Postal.Mvc4

Andrew Davey
  • 5,441
  • 3
  • 43
  • 57
0

I posted an issue on the authors github page. Its not really his fault. Its Visual Studio that goes ahead and downloads the latest dependencies without asking and screws everything up.

The Author did say he retracted Postal.MVC form Nuget and has now split them up for each version.

enter image description here

Luckily I was only testing today but I had to delete the project, copy everything over and explicitly install Postal MVC4 - Works great.

Piotr Kula
  • 9,597
  • 8
  • 59
  • 85