Visual Studio 2010 Automation for ASP.NET MVC - asp.net-mvc

I'm new in automation and I could'n find some tutorials or guids how to do that. I found that I could write add-in for visual studio and found that guidance automation can do something what suits me. I tried to create guidance automation project in Visual Studio but some notes in project pointed to Visual Studio 2005. And project icon seemd quit old style. So I thought maybe it's dead.
I would like to do some automation for my mvc project. I have to do a lot fo similar forms. So I decided it would be great to havo some automation. Things I would like to do:
when I'm creating controller I would like to select entity
create controller class from my defined t4 template
create tests in my test project from t4 template
create model class in Model folder
ceeate command class
In your opinion what would be best solution to aproach that?
And maybe anyone knows any resources where to start.
Thanks

Have a look at the Mvc Scaffolding package available through nuget.

Related

Custom Scaffolding Extension Visual Studio 2019

I'm attempting to create a Custom Scaffold Extension for .NET Framework and Visual Studio 2019. I do not want to overwrite the default MVC T4 templates. I'm trying to do something like:
https://marketplace.visualstudio.com/items?itemName=robinliks.HappyScaffoldingforMVC5
I've found plenty of articles detailing the process for older versions of VS to include the SideWaffle projects but nothing that works with 2019.
Can anyone point me in the right direction?

How to reuse class library from existing solution

I would like some advice please.
I am about to start a new MVC application using Visual Studio 2013. I would like the new solution to reuse 3 projects (Class Libraries) from an older solution which was created in Visual Studio 2010.
I don't understand how I should reference these 3 class library projects in my new solution. Should I from my new solution:
Add --> Existing Project --> locate the .csproj file of the project I want to reuse
OR
Add Reference --> locate the .dll file of the project I want to reuse
Would either of these be the correct approach?
Any feedback much appreciated.
Thanks.

Unable to create MVC View using scaffolding in Visual Studio 2013 Ultimate Update 5

I recently applied Update 5 to Visual Studio 2013 (Ultimate Edition) running on Windows 8.1. After the update, any time I try to create a Razor View (*.cshtml) file in my MVC application using scaffolding, I get the following error:
There was an error running the selected code generator:
The Templates\PackageVersion5.1.3.xml file is missing from the
installed template folder
From the error, it is clear that some file (PackageVersion5.1.3.xml) is missing but I'm not sure how to fix it. I even repaired Visual Studio but to no avail.
As yoo probably know during scaffolding your view is generated base on this missing xml file. I don't know why your file is not there but you can copy it from one of your colleagues computer or reinstall visual studio.
Maybe you have change something i VS options?
I avoid the scaffolding options in Visual Studio.
Why? In my experience, the standard MVC pattern where everything separated by type will always led to a difficult to manage and test solution.
Instead, I now prefer to organise MVC projects by feature (http://timgthomas.com/2013/10/feature-folders-in-asp-net-mvc/).

ASP.NET MVC 5 Custom Scaffolding Option [t4 templates]

Currently , I am developing a framework , I want to add custom scaffolding option in visual studio menu.
By default "MVC5 Controller with views, using Entity Framework" option 3 from the dialog box chooses "CodeTemplates\MvcControllerWithContext\Controller.cs.t4" , that t4 again targets view t4 templates inside
"CodeTemplates\MvcView\ModelMetadataFunctions.cs.include.cs.t4"
"CodeTemplates\MvcView\Create.cs.t4"
"CodeTemplates\MvcView\Edit.cs.cs.t4"
"CodeTemplates\MvcView\Delete.cs.cs.t4"
"CodeTemplates\MvcView\List.cs.cs.t4"
I have been modifying t4 templates almost a year, I haven't found a single piece of evidence that suggest that how it is targeting those views or how to add option in the scaffolding dialog. I have googled a lot , however haven't found anything close.
In summary , I am only looking for the place where I can add or modify the locations for those t4 templates and add a reference of a new scaffold in the scaffolding dialog box.
Any of the answer will be dearly appreciated. Thank you.
Before continuing to implement your framework using T4, you should be aware that the ASP.Net vNext team have quietly dropped support for T4 from MVC6 projects, so unless that decision is reversed, you will not be able to upgrade your framework.
As of Visual Studio 2015 CTP6, MVC6 projects do not support Single File Generators, which are a requirement for T4. The reasons given by the ASP.Net vNext team are described on the official GitHub repository for ASP.Net.
https://github.com/aspnet/Home/issues/272
UPDATE
David Fowler from the team has now (29-04-2015) confirmed that Single File Generators will be supported in MVC6, which in turn should allow support for T4.
UPDATE 2
To revert back to your original question on the topic of using Custom Code Templates for Scaffolding, this is not finalised for MVC6 and Visual Studio 2015.
I raised this question on the ASP.Net GitHub issue tracker thread mentioned above; Sayed Ibrahim Hashimi (MSFT) replied there will be some discussion regarding which technology and implementation will be followed, and at the moment the main candidates are T4 or Razor generator.
Sayed pointed to the following article that shows some early thoughts, but stresses that this is not finalised, and people should not time invest in this approach as it is likely to change.
http://blogs.msdn.com/b/webdev/archive/2014/08/23/how-to-customize-scaffolding-templates-for-asp-net-vnext.aspx

Add xUnit test project to an existing Visual Web Developer 2010 express MVC application

Maybe it's very easy but I'm trying to add support for xUnit in Visual Web Developer 2010 Express. I followed this tutorial on how to install everything but the main problem is that this tutorial only show how to add a test project to a new project and not to an existing one. When I do "Add New Project", there is not "xunit" or "test project" anywhere...
Anybody know how or can point me to a good tutorial?
A standard Windows Library (.DLL) project will work fine and is the normal project type used for xUnit.net Tests - all the existing mechanism really added was the inclusion of some example tests to start you off.
This (not having templates) is the approach being taken with future xUnit versions. You'll find some discussion of the reasoning behind this on http://xunit.codeplex.com/discussions

Resources