How to execute PowerShell script while creating a Custom Project Template in Visual Studio 2015? - visual-studio

I am creating a Custom Visual Studio Project Template. This custom project template consists of two folders which needs to contain some binaries. These binaries has to copied from some server location. As these binaries will be updated periodically i can't simply enclose them while creating the custom project template. I would like to copy them from server location whenever the developer selects this custom project template the two folders inside their Visual Studio might get the latest binaries from the server location. I have to do this with PowerShell script only. Can someone help me on how to execute PowerShell scripts while creating custom project template in Visual Studio.

Why don't you create your own custom nuget packages? Then you only have to "refresh nuget packages" after creating the project from template.

Related

Create Visual Studio for Mac extension (.mpack) file

I am trying to create a new project template extension. I have followed the steps mentioned in the link below to create the template. It works fine on my Visual Studio as it is adding the configuration in my Visual Studio custom folder template.
https://lastexitcode.com/blog/2017/11/12/TemplateCreatorForVisualStudioMac/
Now I need to pack this project template and ship it to others with the extension type of extension_name.mpack.
Could you please provide the steps to create the mpack file from the template files.

How to share an SSRS Report Template across TFS?

The standard method of implementing a Reporting Services report template is to create an .RDL (report file) and place it in the Visual Studio Report Project template folder at C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\ProjectItems\ReportProject
Since this is a purely local approach, is there a way to implement a shared and source controlled template that can be used from the new item menu?
Our current solution for this issue is to store our templates in our report solution, and copy/paste them for new reports. Just wondering if there's a better alternative.
You need to create this as a .vsix extension and then share it. If you update the package and version all Visual Studio instanced that have it installed will prompt the user to update.
How to: https://blogs.msdn.microsoft.com/vsx/2014/06/10/creating-a-vsix-deployable-project-or-item-template-with-custom-wizard-support/
Although you can setup your own repo to load it from, It's much easyer to use http://marketplace.visualstudio.com for distribution.

How can i load a template I have created in Visual Studio?

After creating a solution for a project, I exported it as a template. Now after exporting it automatically adds the template to my IDE and creates a ZIP file with all the project files and a .vstemplate extension file.
Now i am on another computer with visual studio and i wish to load this template and save it in the IDE, but i cannot find this option anywhere. The temporary solution i have is to open an empty web application and copy all the contents of the ZIP file not including the .vstemplate file. So my question is how can i load this template into my IDE?
When opening the vstemplate file in Visual Studio all i get is a text editor and XML data.
I am using Visual studio 2013 with Update 4.
Once you've exported your template, copy the entire ZIP file that was created to the folder C:\Users\[User Name]\Documents\Visual Studio 2013\Templates\ProjectTemplates. (You might want to use one of the provided subdirectories to keep your template organized.)
Restart Visual Studio, and then use the search bar in the New Project dialog to help you find the project template you just added.
For the record, it looks like using templates changes with VS2017. Your project template provider will have to publish via a new build mechanic, and it'll be a bit different than just dumping a .zip into a user folder:
Using Project/Item Templates:
https://learn.microsoft.com/en-us/visualstudio/extensibility/upgrading-custom-project-and-item-templates-for-visual-studio-2017
Create Project/Item Template:
https://learn.microsoft.com/en-us/visualstudio/extensibility/creating-custom-project-and-item-templates

Is it possible to provide custom content for the VS2012 Start Page?

Visual Studio 2012 (and 2010, too) has a Start Page that has links and streamed videos. Is it possible for my package to provide content on this page, e.g., create a separate section next to Welcome/Windows 8/etc.?
I finally got a custom start page working in VS2012 - my issue was I could not install the Start Page Project Template in 2012 as the extension only installs on 2010 (which I don't have access to) and my My Documents folder is mapped to a network drive, so putting the raw XAML file in My Documents/Visual Studio 2012/Startpages didn't work as Visual Studio refused to use this "untrustworthy file".
Download the Start Page Template from here.
Rename the file to .zip and extract it.
Copy the "\Solution\CSharp\Extensibility\StartPage.zip" file to your project template folder (by default "My Documents\Visual Studio 2012\Templates\ProjectTemplates\Visual C#").
Create a new project using this template.
Follow the instructions here to upgrade from 2010 to 2012 start page.
Update the project properties target framework to 4.5.
Update the project references in the Control project by removing the Microsoft.VisualStudio.Shell.10.0 reference and adding the Microsoft.VisualStudio.Shell.11.0 and Microsoft.VisualStudio.Shell.Immutable.11.0 references.
Update the namespaces references in the xaml file by replacing the existing ones with the two below.
xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.11.0"
xmlns:vsfxim="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.Immutable.11.0"
Replace the references to vsfx:VsBrushes keys to vs:EnvironmentColors keys, e.g. vsfx:VsBrushes.StartPageBackgroundKey to vs:EnvironmentColors.StartPageTabBackgroundBrushKey
In the VSIX project, make the following changes to the source.extension.vsixmanifest file (values depending on if 2010 support is desired, it is not for me):
Add an author, the default empty tag is not allowed: <Author>Ken</Author>
Change/add the visual studio support version to 11.0: <VisualStudio Version="11.0">
Change the supported runtime edition to include 4.5: <SupportedFrameworkRuntimeEdition MinVersion="4.5" MaxVersion="4.5" />
The VSIX solution should now build and spit out a VSIX file in the project bin folder. Install this and you can now choose your Start Page from the drop down list in the visual studio options.
I haven't actually developed my custom start page beyond this, but hopefully it is a helpful to people wanting to get started developing them with VS2012
EDIT: A project which includes a basic 2012 start page, custom control and can be deployed via VSIX: template
Custom Start Pages, via google:
http://msdn.microsoft.com/en-us/library/aa991992.aspx

Compile error when trying to debug a Visual Studio integration project

I'm currently working on a Visual Studio integration project for VS2010 (a custom highlighter) I'm using Irony and the LanguageServiceTemplate from this Code project article. However that template is build for 2008 and the changes made in VS2010 when it comes to integrating breaks the template.
When I try to compile I get the following error:
Source.extension.vsixmanifest file not found in project. If a file with this name is present in the project, make sure the build action is set to "None".
Any ides of what I can do to fix it?
You have two options depending on how your package is constructed.
1) Edit the project file and remove the following line.
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\VSSDK\Microsoft.VsSDK.targets" />
If you do this, you will lose a few things like the automatic zipping of your item and project templates.
2) Add a source.extension.vsixmanifest file to the root of your project. You can get one by creating a new VSIX Project. After you install the Visual Studio 2010 SDK, this is under the Extensibility category. If you add no content, it won't create a vsix file.
The second method is probably the best route to go. I have a specific VSIX project that I use to pull in various other package projects. If you only have one project, you can use the new vsixmanifest file to include the project to make an installer.

Resources