How to make a solution template for visual studio for Mac - visual-studio-mac

I want to make a solution template for visual studio for Mac. IN window work for me but I would like to know how to do it for visual studio for mac

Currently you would need to create an extension for Visual Studio for Mac to add a new project template.
Then there are two options for how to create the project template. You can use the old templating engine which is documented on the MonoDevelop website.
Or you can use the new .NET Core templating engine to create a NuGet package. Then add some metadata to your extension's addin.xml file to get Visual Studio for Mac to use that project template.
<Extension path="/MonoDevelop/Ide/Templates">
<Template
id="Microsoft.Common.Console.CSharp"
_overrideName="Console Application"
_overrideDescription="Creates a new .NET Core console project."
path="Templates/Microsoft.DotNet.Common.ProjectTemplates.1.x.1.0.0-beta2-20170430-208.nupkg"
icon="md-netcore-console-project"
imageId="md-netcore-console-project"
category="netcore/app/general" />
</Extension>
I am also working on simplifying this for project templates you use locally with an template creator extension which is not yet published. This would allow you to right click an existing project or solution and then select Create Template and then it would be available in the New Project dialog for you to use.

Related

Removing Visual Basic project Templates from Visual Studio 2019?

Is there a way to remove the Visual Studio project templates from showing up in Visual Studio 2019? I'm never going to use them and I've had multiple occurences where I accidentially created a new Visual Basic project instead of a C# project.
I've tried removing the physical files from Common7\IDE\ProjectTemplates and clearing the cache but the project templates keep showing up in the dialog.
to remove a template from Visual Studio you may use:
dotnet new --uninstall NAMEOFTEMPLATE.Template
to uninstall some project types (Visual Basic maybe) try Change Visual Studio Tool from Setup...

Self created templates not shown in the "New Project" dialog in the Visual Studio 2019

I have created a C++ template with certain configurations in visual studio 2019, which is saved as a .zip file in the default ProjectTemplates folder.
However, when I open the New Project dialog, I couldn't find my new template, the dialog only shows me 3 options under the left Recent templates tag which is not what I want, and I can't find my own template in the right Scoll-down menu.
Please tell me how to create a new project from self-created template.
By updating my VS 2019 to professional edition, I managed to see my templates in the New project list. I am not extremely sure about the reason, just give a hint for this issue.

Empty .NET Core 2.0 project with MVC template in Visual studio 2017

Today I migrated from Visual studio 2015 to Visual studio 2017.
In visual studio 2015 whenever I wanted to create a new web project not only was I able to choose it as an empty project but also I was able to indicate my empty project be in which template by clicking on diverse check boxes in new project window. For example I was able to create a MVC project which all folders were empty.
I can not find this facilities in Visual studio 2017. If I choose a MVC project in new project windows it creates some default styles, views, and controller which I don't like. If I choose empty project then it don't have Model,View and Controller folders either.
So am I able to create an Empty + MVC + .Net Core 2 project in Visual studio 2017 or Microsoft simply removed this feature?
UPDATE
I have tried to first create an empty project and then add MVC to it by installing Microsoft.AspNet.Mvc through NUGET. But it just added MVC dependencies to my project. Am I have to create all needed folders (model, view, controller, shared....) manually? Its really frustrating.
I believe I have installed .NET Core properly. This screenshot of my New project window is a proof of that.

cannot be opened. The project type is not supported by this installation

.cs project file
The project was created using Visual Studio 2010 and I am trying to open it in Visual Studio 2010 itself but still I am facing this problem.
I have opened this project in VS 2012 and worked for few days but it has created in Visual studio 2010. Is there anything which preserve the project details on local machine?
This is the specific project section in my solution file:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Project Name", "Project Name\project name.csproj", "{48C1190E-7700-461B-ADCD-B5E0F1ECAD21}"
ProjectSection(ProjectDependencies) = postProject
{1F5440B3-9FD8-4FE2-B621-8697489ABDC4} = {1F5440B3-9FD8-4FE2-B621-8697489ABDC4}
EndProjectSection
EndProject
In Visual Studio it is possible to add Project Types, e.g. for creating an MSI, by installing an Add-On to the development machine. It appears that in the past this was done, and then that new Project Type was used to add a Project to the Solution. But now you are opening the Solution on a machine that does not have that new Project Type.
Look for the GUID of the missing Project Type, it should be part of the error you are getting. Then google "project type {the-guid}" to see which Add-On you need to install on your development machine.
It is also possible that a new Project Type was used in the Solution that simply can not work with VS 2010. In that case your options are either to keep using VS2012, or to start over with a new Solution in VS2010 and migrate the projects into it that are compatible (which may be a bit tricky or hard to do if VS2012 saved them).
Would it be too difficult to just recreate the project and include all the necessary files and references? Once the project was saved from VS 2012, the format may have broken compatibility with 2010. Sometimes this is fixable just by updating the version number in the project file, but I don't see it in your image.

Can MVC Scaffolding T4 Templates be installed using VSIX?

I have a MVC template that should be installed in
Common7\IDE\ItemTemplates\CSharp (or Visual Basic)\Web\MVC (or 2)
3\CodeTemplates
as noted here.
Is there a way to include this on a VSIX package?
Manually
Install the Visual Studio 2012 SDK (also available for 2010).
Create a VSIX project.
Double click the *.vsixmanifest file to open the manifest designer.
Add a new project template asset and point it to your template *.zip file.
Template Wizard Extension
Additionally, you can try the template Template Wizard Extension if you want to export a template and VSIX in one step:
http://msdn.microsoft.com/en-us/library/vstudio/ff527343(v=vs.100).aspx

Resources