ITKeyword,专注技术干货聚合推荐

注册 | 登录

asp.net mvc - Postal for ASP MVC 4 wants me to use MVC 5

itPublisher 分享于

2021腾讯云限时秒杀,爆款1核2G云服务器298元/3年!(领取2860元代金券),
地址https://cloud.tencent.com/act/cps/redirect?redirect=1062

2021阿里云最低价产品入口+领取代金券(老用户3折起),
入口地址https://www.aliyun.com/minisite/goods

推荐:ASP.NET MVC (一)

从零开始学习ASP.NET MVC:开天辟地入门篇(一) 2009-2-27 20:11:26 已被阅读:1151 发表评论 一.摘要 和自身水平有关, 我总喜欢写入门级别的文章.比如虽然做项目

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

asp.net-mvc asp.net-mvc-4 postal
|
  this question
asked Jun 14 '14 at 19:19 user1186050 1,437 3 21 53      as soon as I add the using statement 'using postal' in my cs file I get the error. –  user1186050 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! –  user1186050 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? –  user1186050 Jun 14 '14 at 22:54      Of course you can. Although there is a bit of a process to it. See asp.net/mvc/tutorials/mvc-5/… –  Erik Funkenbusch Jun 14 '14 at 22:57  |  show more comment

2 Answers
2

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


|
  this answer
answered Jul 14 '14 at 12:58 Andrew Davey 3,117 1 31 53

 | 

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.

推荐:ASP.NET MVC MESS

  ASP.NET MVC Html.Action() http://www.2cto.com/kf/201207/143417.html ASP.NET MVC Html.TextBox 与 Html.TextBoxFor 区别 For支持强类型(model的类型),内部

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

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


|
  this answer
answered Jul 14 '14 at 12:58 ppumkin 5,372 5 29 51

 | 

推荐:ASP.NET MVC随想

从ASP.NET Web Form到ASP.NET MVC,我们感到既熟悉又陌生。它是ASP.NET Web Form的一个增强,一个替代,还是一个替补?我们做Web开发两者都需要了解掌握吗……  


相关阅读排行


相关内容推荐

最新文章

×

×

请激活账号

为了能正常使用评论、编辑功能及以后陆续为用户提供的其他产品,请激活账号。

您的注册邮箱: 修改

重新发送激活邮件 进入我的邮箱

如果您没有收到激活邮件,请注意检查垃圾箱。