NUnit Testing Framework for MVC 3 Projects - asp.net-mvc

I am using Visual Web Developer 2010. I have installed NUnit, and I'm trying to get it so that NUnit is a selectable testing framework when you create an ASP.NET MVC 3 project.
Since I am using Visual Web Developer, I do not have access to MSTest. What do I need to do to get NUnit loaded as a Test Framework so I can add it as a project based off of a template when I create an MVC 3 project?

You may checkout the following template. It's for VS2010 Professional and higher since VWD 2010 do not support extensions.

Related

.net mvc 5.2.3 does not work correctly in visual studio 2013

After upgrading my .net mvc project to 5.2.3, it does not have nice features like validating view/action names and linking to them.
here are my project type guids
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
which should mean web application + C# and probably is correct
I have Microsoft Visual Studio Ultimate 2013 Version 12.0.31101.00 Update 4
.net version is 4.5.51641
and tools which are probably related
ASP.NET and Web Tools 12.4.51016.0
ASP.NET Web Frameworks and Tools 2012.2 4.1.21001.0
ASP.NET Web Frameworks and Tools 2013 5.2.21010.0
do i need some additional extension or is there some secret project guid for mvc 5.2.3?
Try uninstalling the package. Then clean the solution and reinstall it again.
it turned out to be a resharper issue
https://youtrack.jetbrains.com/issue/RSRP-433112
have been using this tool for so long it seemed natural to have this kind of intellisense and started to blame visual studio.

Is ASP.NET MVC 5 released or not?

According to Wikipedia - asp.NET MVC 5 was released on 17th October 2013.
However on the ASP Website I can't see where to download the package.
When I try to create a new Project in VS 2013 - I can only choose asp.NET MVC 4.
How can I install MVC 5 ?
In Visual Studio 2013, the MVC project wizard was merged with the ASP.NET Web Application Wizard. When you target .NET 4.5, select the ASP.NET project. You will be presented with a new wizard that will allow you to select a base template and then customize it further by adding support for Web API or MVC. It also allows you to customize the authentication/authorization model you wish to use in your application.
The MVC 4 wizard is still present under the VS 2012 node in the New Project dialog.
Runtime packages for MVC 5, Web API 2, and Web Pages 3 were published to nuget.org, so you can upgrade existing projects.
You can also download a separate installer for Visual Studio 2012 that will allow you to create an MVC 5 and Web API 2 project, albeit empty. Once you have the project created you will be able to add views and controllers using the new scaffolding. The download for the Visual Studio 2012 support can be found at here
Thanks,
Jacques
From the nuget site:
Microsoft ASP.NET MVC 5.0.0
To install Microsoft ASP.NET MVC, run the following command in the Package Manager Console
PM> Install-Package Microsoft.AspNet.Mvc
You can download it directly from this link:
http://www.asp.net/mvc/mvc5
You can find all versions of latest MVC from below nuget
http://www.nuget.org/packages/Microsoft.AspNet.Mvc

Create and Run MVC 5 Project in VS 2012

For some reason my Visual Studio 2013 Preview cannot create MVC 5 Projects. Since the MVC project is now open source in CodePlex I was wondering if there's a simple way to develop MVC 5 projects in my Visual Studio 2012 Ultimate.
Microsoft has released updated Web Tools 2013.1 that provide the support:
Description
Direct download
Note that I had to install it manually from the second link, the tools did not install properly from Web Platform Installer. Also a colleague had to install both Update 4 and these tools to get proper support.
Original answer (not actual anymore):
I received this answer from Microsoft developer:
MVC 5/Razor 3 tooling support for VS 2012 has not shipped yet. We hope to ship this support in Mid November.
Recently ASP.NET Program Manager from Microsoft mentioned in a talk that this would be included in VS2012 Update 4. Edit: unfortunately the support is not in Update 4.
So the accepted answer is true for now but we can plan to soon have this support in VS2012 as well.
A new tutorial has been recently added to the ASP.NET website on how to upgrade an MVC4 project to MVC5.
I migrated a VS 2012 project using this tutorial without problems, but there is no design time support for Razor 3 in VS2012 due to changes in the way VS loads the razor engine.
You can edit razor pages in VS2012, but it will be a plain HTML editor.
Microsoft has released an update for this, Web Tools 2013.1 for VS2012.
http://blogs.msdn.com/b/webdev/archive/2013/11/18/announcing-release-of-asp-net-and-web-tools-2013-1-for-visual-studio-2012.aspx
I'm not sure MS will fix it.
The bug report says problem closed : by design
https://connect.microsoft.com/VisualStudio/feedback/details/806348/razor-intellisense-does-not-work-in-visual-studio-2012-after-upgrading-to-mvc-5-razor-3
and it is mid November
I have a tutorial that will not only get your empty MVC 5 project working with Bundling, a controller, jQuery, jQuery UI, Modernizr and more, but it will walk you through installing Zurb's Foundation 5, a responsive Framework which I have working with Sass in MVC 5. It's all here:
http://tinyurl.com/VS12-MVC5-F5
The problem many have ran into is that Visual Studio 2012 only allows you to start from a blank MVC 5 project, so I will help you get the NuGet installed which is pretty similar to the instructions in the NuGet package with a few minor changes; however, it does not take into consideration that you will be installing from Visual Studio 2012 using a Blank MVC 5 project. If you would like to use Foundation 5 with MVC 4 Web Application template just omit the Bootstrap uninstall and the NuGet package should work fine, but if you need to use MVC 5 and you don’t have Visual Studio 2013, you will need to build the Home Controller, Bundling class, modify the Global.asax.cs as well as other quirky little things. So lets get started.
I spent a good part of a few hours getting it all working.

ASP.NET MVC 4 RC Missing Use HTML5 Semantic Markup

I am working with Visual Studio 2010 - SP1
I installed ASP.NET MVC 4.0 RC on my box. The option "Use HTML5 semantic markup" is missing in all the project templates (empty application, Web Api, Internet app, Intranet App) when creating a new project of ASP.NET MVC 4.0 Web Application project type.
Remember, I have not installed asp.net mvc 4 beta prior to RC installation. However, this option is present when creating an asp.net mvc 3.0 web application.
You have to install this extension :
Web Standards Update for Microsoft Visual Studio 2010 SP1
Also consider installing Web Essentials. It add a tons of useful tools related to web development.

Setting up MbUnit for ASP.NET MVC

I am using Visual Web Developer 2008 Express with ASP.NET MVC 1.0.
I would like to use MbUnit as a test framework so how would I set this up as a unit test project for an ASP.NET MVC web application?
File -> New -> Project -> Windows -> Class Library
Add a reference to MbUnit.dll (or whatever the name of their library is)
Add a reference to your ASP.NET MVC project
Add a new class file and your test code
The only problem you'll run into now is running the tests. For that you might try something like TestDriven.net or ReSharper.
FYI The latest nUnit includes the features that MbUnit set out to add to unit testing. nUnit also has better integration with VS and various add-ons I believe.

Resources