Automatically setting up unit test projects in VS2008, need help - asp.net

I'm beginning to toy with the new ASP.NET MVC framework, and reading around in some tutorials I saw that in addition to creating the MVC project, theres an option to add a Unit Test project, using the Test framework (which I have) thats basically already set up for MVC testing.
Its supposed to pop up when you create a new MVC project, and look like this -
http://quickstarts.asp.net/previews/mvc/images/mvcCreateUnitTestProject.PNG http://quickstarts.asp.net/previews/mvc/images/mvcCreateUnitTestProject.PNG
But it doesn't, and I'm forced to create the Unit Test project myself by adding it into the solution, which is time consuming and generally annoying to do considering the MVC project structure...
I've looked around the Test framework settings and found no way to make that window appear, or find any option to create an MVC test project.
Any ideas?

Nevermind, reinstalling the MVC framework corrected the problem

Related

Advantages using the Yeoman .net core spa Angular template to create an Angular MVC project if API is a separate project?

I created a typical N-Tier architecture solution with project called TestProj.Api, TestProj.Business, TestProj.Data. All 3 of these projects work great together in VS2017.
Then I added a fourth project using the Yeoman Angular .Net Core Spa Template: TestProj.Web. This project makes api calls to TestProj.Api with CORS. I currently run multiple solution startup projects: TestProj.Api and TestProj.Web.
I am starting to notice that I like developing Angular in VSCode and additionally not sure if I like the Angular ASP.NET Core Template. I am wondering if TestProj.Web should be created outside of my solution.
What are the true advantages of using this Angular Template, here are the ones I can think of:
1. Able to keep everything in same VS2017 solution. Api, Business, Data, Web
2. Able to have a server-side Api and Angular in the same project (which I am not taking advantage of since I want my API to be completely separate)
Is there anything else I am not thinking of? Is there any suggestions on what I should do?
I think your point number (2) really answers your own question:
Able to have a server-side Api and Angular in the same project (which I am not taking advantage of since I want my API to be completely separate)
As you are intimating, they are not the same projects. They will have different release schedules, different coding styles/languages, etc. Since they are separate projects , really, then managing them using different IDEs becomes less of a worry.
In fact I, like you, started trying to use Visual Studio to manage the API as well as the web front end. However I soon found out that Visual Studio is BAD at managing the Angular 2 front-end stuff. VS Code plus a command line window is far, far easier. Its just more suited to the task. Trying to get Visual Studio to do this is like trying to get a car to be a boat - it never really works properly.
Having been through the same decision process as yourself, and having seen how much easier it is to manage the web code using VS Code and command prompt, I would strongly recommend to ditch Visual Studio for the front end.
For the back end API, Visual Studio is very strong.

Should i create an Empty Web Application or Web API Web Application template? - VB.net

I wanted to build a VB.net web application using MS Visual Studio 2015. Someone suggested me to create a Web API instead of MVC project if i'm also planning to create a mobile app later on. I may use angularjs in my project so controllers will surely be used, so what should i choose when creating the project in the first place?
Because when i created a web project: File=>New Project=>ASP.net Web Application=>Empty..there are no folders for Controllers, Model, etc. Do i have to create a Controller folder on my own?
Or should i do this: File=>New Project=>ASP.net Web Application=>Web API..? sorry if its a silly question. its just that i'm afraid that if i chose the wrong project now, it'll affect the development later on.
Answer to your question mainly depends on your choice and needs,
for example
In Case of an empty project as name defines you will have nothing else web.config.
Benefits of it:
here you can define, design your own structure. you can either make
it simple 3 tier or you can make it WEBAPI application. it's all up
to you.
however in the case of choosing Webapi template you will have a prebuilt structure which can help you out for initial understanding
https://docs.asp.net/en/latest/tutorials/first-web-api.html
benefits of it
You will get predefine template and structure.
you can utilize of webapi's which further isolate you backend logic from the frontend.
as you are also planning to create the mobile app. and using front end as angular, so in that case, webapi may come handy.
as the whole world is moving towards webapi, so i will recommend you to use it. please refer https://blogs.msdn.microsoft.com/martinkearn/2015/01/05/introduction-to-rest-and-net-web-api/
so down the line it all depend on you if you want to build you application for the stretch and take full control of it regarding structuring backend etc.. then go with empty else go with Microsoft pre-define template
Thanks,
Ajay Kotnala

How to migrate from WebForms to MVC, step by step?

I'm having already existing project (of medium size) that is created using WebForms. Now I have to gradually migrate it to MVC5. I should start section by section, site by site, and at the end to got to the point where it will be fully in MVC.
I'm having intermediate knowledge of MVC and basic/intermediate knowledge of WebForms. I guess these will be the steps:
1.) to create empty MVC5 solution
2.) integrate WebForms project into new MVC5 solution
3.) make WebForms and MVC5 run side by side (make sure that old system works correctly while it's part of MVC5 solution)
4.) modifying WebForms project, section by section (site by site) and converting them one by one to MVC patterns
In theory I think I got the idea, but in the code I'm really not sure how to start the integration. All I did so far is step 1 :)
I have take a look into this link:
Combine ASP.Net MVC with WebForms, but it did helped me a lot since the blog post from #jeroenh maybe can help me in step3 but not in the step2. For step2 I have tried to apply the post from #Matt in the same link, but I end-up with a lot of errors (at his step6) and a lot of effort, so I'm thinking I'm not on the right track.
Are there some posts/tutorials related to this, step by step, that will guide the developers from doing this WebForms and MVC running side by side (but in one project and not in different projects)?

How can I add mvc.net to an old vb.net site

this is my first question. The company I work for uses a pretty large and old vb.net site. We were hoping to integrate mvc.net into the site. I've been following a book "Pro ASP.NET MVC 2 Framework" by Steven Sanderson - and it doesn't seem terrible complicated to merge the 2 systems together.
The breakdown looks like this:
Update build file - add GUIDs to so IDE gives options for mvc files.
Add assembly references for mvc.net.
enable routing. (I need to be sure it still uses the vb.net routing first, then mvc)
Merge web.configs. (Using a new blank mvc.net vb project, also where I got the GUID from)
Add whatever folders and start using mvc.
For reference, we currently use .net 3.5, but our operations team tells me 4.0 should be no problem.
The problem I run into is that the GUID from the blank mvc project doesn't work. When I add them to the older project I get "The project type is not supported by this installation." errors. I'm not very familiar with the project types and I'm not sure how to proceed from here. I've tried several combinations to with no success.
Does anyone know how to where I can get or generate the correct GUIDs to get this working? If anyone has done this, are there any other pitfalls I should watch out for? I have the project copied to another branch, so I'm free to make changes without affecting anything else.
Edit:
These are the GUIDs from our main site project:
{349c5851-65df-11da-9384-00065b846f21};
{F184B08F-C81C-45F6-A57F-5ABD9991F28F}
These are the GUIDs from a new mvc4 project (I'm not picky about MVC2-4)
{E3E379DF-F4C6-4180-9B81-6769533ABE47};
{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
I would suggest that you leave the current code base as it is.
You can start all your new development(new modules) in ASP.Net MVC. You can then just integrate this new module in your application. This way you can keep all the regression in respected code bases.
You will face problem only in case of session. If you are having InProc session then it would be little difficult to share. If it is already OutProc then it is easy.

Integrating my database - Separate project or just merge it?

I'm creating a new MVC web application. I've never used MVC before (in asp.net). Anyway, in my last project, I used Code First and Entity Framework to handle my data and I enjoyed using that so I wanted to use it again.
Now, in the last project, I had a separate project/folder for handling the models and contexts, and I just referenced it into my main project. Would doing something like that still be the right choice in an MVC project, or should I just run it from the 'Models' section?
This is the website where I was learning how to implement this:
http://www.codeproject.com/Articles/468777/Code-First-with-Entity-Framework-5-using-MVC4-and
Is there anything wrong with that approach or is it fine?
Nothing wrong.
If your project is not big enough go for it. Having just one project make it simpler though that you must keep the code organized
If your project might get large, then it would be a good choice to have two project or more for different layers and tiers of your application, such that different guys work on their own project.

Resources