Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding MOQ to a .NET 4.0 project is not possible

I want to add MOQ .net library to a .NET 4.0 project. I get an error message that I should convert the project to something smaller than 4.0. I need to use .NET 4.0 also because of other project dependencies.

How can I make MOQ work with a .NET 4.0 project in VS2010 ?

like image 559
Pascal Avatar asked Mar 27 '12 20:03

Pascal


1 Answers

The latest version from Google Code (http://code.google.com/p/moq/), works in a .Net 4.0 project. I would just download the dll again.

Here is the download link: http://code.google.com/p/moq/downloads/detail?name=Moq.4.0.10827.Final.zip

The zip file at that location contains a .Net 4 folder. Use the dll : Moq.dll from the NET40 folder and everthing will work fine. Just do a normal Add Reference on the project.

I would check the version number and the Runtime veseion of the assembly you are trying to use. It should say:

Runtime Version: v4.0.20926

Version: 4.0.10827.0

like image 174
Gilles Avatar answered Oct 06 '22 20:10

Gilles