How to share an SSRS Report Template across TFS? - visual-studio

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.

Related

Editing RDL Files in Visual Studio

So we have a unique situation. I have 2300+ RDLs that we have in TFS that our team works on. These are deployed to 100+ different folders on the SSRS Server, and must stay that way as each folder is secured with it's own AD Group so users can't see each others folders/reports.
The problem with Visual Studio is that each folder has to be it's own project to manage the RDLs in Visual Studio. So my workaround is that I have a project in VS but then made my own folder with all of these RDL's and their own subfolder via Source Code Explorer. So when I try to edit the rdl with Visual studio it just opens it as xml and not the report designer. My work-around is that we associate the .rdl file with Report Builder, but I'd rather just use Visual Studio.
Any way to get VS to open the report designer this way? I am only interested in editing the rdl's this way, not using VS To deploy the reports.
You could try VS extension Microsoft Reporting Services Projects, which can be downloaded from website below:
https://marketplace.visualstudio.com/items?itemName=ProBITools.MicrosoftReportProjectsforVisualStudio
Or try the solution in case How to open .rdl file in visual studio :
In order to see a designer you need to give Visual Studio a bit of
context about what sort of file it is by making it part of a Report
Server Project.
Install SSDT for Visual Studio if you haven't already done so
Create a new project using the 'Report Server Project' template
Copy/move the .rdl file(s) you have into the folder for the newly created project (eg ..\Visual Studio 2015\Projects\My Report
Project\My Report Project)
Use the "Add Existing Item..." context menu option in Solution Explorer to add the .rdl to the project
Open report designer by double-clicking the newly added report project item(s)
There is one tool available in market IDSNext-Gen. The company name is Agnisys Inc.

How can I create an extension for Visual Studio that can interface with TFS directly?

I am attempting to create an extension that will periodically check to see if the user has the latest version of all files in a specific project or branch. This specific project/branch is going to be determined by what item is checked out for editing. The reason for creating this extension is to create reminders every time a file becomes unsynced. This will prevent merging into items that are out of date.
I am also working with Gated Check-ins, so it would be advantageous if I could check for latest version after a gated build succeeds.
I am having trouble finding the APIs for TFS integration when making an extension for visual studio. I am also having trouble finding an API to use to make a direct TFS extension. I am assuming this is because everything that has to do with TFS commands should be done using TFS command line commands.
I am running TFS and VS 2015.
Thanks in advance for the help!
You can use NuGet packages of TFS API:
Microsoft.VisualStudio.Services.Client
Microsoft.TeamFoundationServer.Client
Microsoft.TeamFoundationServer.ExtendedClient
All the DLL's also stored in the following location, you can take them and use in your project:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer
A good tutorial on how to use the API you can find here.

Generated T4 Files Not Added to Project from Visual Studio Extension

I am trying to generate code scaffolding for an in-house API. I created a T4 template which includes several other templates for each code file to be generated. I then wrote a Visual Studio Extension (VSIX) with a WPF form to capture user input and initiate the transforming of the T4 template. I am doing all of this in Visual Studio Professional 2013.
This is what I followed to Invoke the Text Transformation in a VS Extension
https://msdn.microsoft.com/en-us/library/gg586947%28v=vs.120%29.aspx?f=255&MSPPError=-2147217396
When testing the templates locally using Run custom tool, everything works perfectly. However, when testing the VS extension in an Experimental Instance of Visual Studio, the problem I am having is that after the transformation has been invoked [calling ITextTemplating.ProcessTemplate], the generated files are not placed into my open project. I verified that they exist in their appropriate folders in File Explorer.
I have searched high & low and can't find anything that talks about this. Any ideas?
The custom tool is using the Visual Studio API (DTE object) to add the generated files to the projects. I built something very similar and that is what I had to do. This project is a bit old but it is a great starting point for seeing how this can be done.
Basically you need to get a reference to the folder you want to add the new item to and then call AddFromFile. Also don't forget to save the project after you add all the items.

Deploy a VSPackage to create a new project type using Setup Project

I create a new custom project type using a VSPackage project inheriting of MPF library (http://mpfproj11.codeplex.com/). As a result I obtain a .vsix but I need add this project type using a .msi. I'm using the Visual Studio 2010 Setup projet for it. In my setup project I add the content of the VS Package in the same directory where the .vsix put then, but I think Ineed to put in the registre the new type of project because when I use the setup , the project template does not come out in Visual Studio and when I give double click the file with extension of the type of new project and does not recognize it. When I look the registry after install the vsix, this was one of the things that I found diferent. I add this entries in my setup project but It's not working yet.I'm missing something else?
In the projecttemplatedir is the directory where I put the .dll of the project type, the vsixmifest and pkgdef. The project template is in [User]\Documents\Visual Studio 2013\Templates\ProjectTemplates\[Name of new Project Type]\[projecttemplate.zip]
Best Regards
PS: The project type is for VS 2013 but I'm using the VS 2010 Setup project ;)
OK, so first the "don't"s of doing this:
In general, if you are installing via MSI you shouldn't be doing anything user-specific -- no writing in HKEY_CURRENT_USER, nor writing within their Documents folder, LocalAppData, or Visual Studio folders, etc. If you see yourself writing files or registry keys in either of those places, that should be your hint that there's a better way to do what you're trying to do. For what you've shown so far, this raises more than a few red flags for me.
Second, don't ever go writing keys into 12.0_Config. That part of the hive is nothing more than a cache that's built up from other parts of the registry and on-disk .pkgdef files from extensions. It's rebuilt in any number of senarios, including installing new extensions. Any writes there you should presume will get blown away at any time. If you need to write things there you should either (a) write in HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\[version] and run devenv /setup or (2) [preferred] put your keys in a .pkgdef inside your extension which gets merged into 12.0_Config for you automatically.
Now the dos:
You said you already had a .vsix produced by the SDK: you can put project templates in there. You can then register those templates in the .vsixmanifest and those will pull in. That's far easier than mucking around with files in Documents -- that's the user's directory...don't go playing with that.
Once you have a .vsix that does most of what you need, you should simply take the files within that and install the files in a folder within C:\Program Files [(x86)]\Microsoft Visual Studio 12.0\Common7\IDE\Extensions. Even better, you might just want to WiX toolset to build your installer, since it has built-in support for installing extensions. It also has built-in support for invoking the "/setup" process if that's what you need to do as well. Visual Studio Setup projects are no longer supported in newer versions of Visual Studio, so you're better off starting with a technology that isn't already obsolete. WiX is even what we use at Microsoft to do the setup work for Visual Studio itself, so it's definitely up to the task.
Last point: almost everything when it comes to Visual Studio extensibility can be done with a VSIX directly, so presume there's a good way to do something that way before falling back to an MSI. Internally, we can register the entire C# and VB language services with just a VSIX -- they're quite powerful.
I found the answer in this link Registering Project and Item Templates. I set projecttemplatedir entry with
[User]\Documents\Visual Studio 2013\Templates\ProjectTemplates[Name of new Project Type][projecttemplate.zip] that is where i put the project template.

creating custom templates in visual studio & resharper

I would like to create custom templates for c# files, unit test classes, .aspx.cs etc so that common items to all files are included once they are created eg file headers. I am working with visual studio 2010 and resharper 6. What is the easiest way to create these files and is it possible to be able to share them a team of developers easily? Appreciate any assistance or information as to how I might achieve this.
Visual Studio templates are simple enough to create - you can distribute them to your colleagues to setup in the same location on their computers (or even create an installer, if you want to makes things even easier).
See Creating Project and Item Templates and the Introduction to Visual Studio Templates on MSDN.
Contents of a Template
All project and item templates, whether installed together with Visual Studio or created by you, function by using the same principles and have similar contents. All templates contain the following items:
The files to be created when the template is used. This includes source code files, embedded resources, project files, and so on.
One .vstemplate file. This file contains the metadata that provides Visual Studio the information it needs to display the template in the New Project and Add New Item dialog boxes and create a project or item from the template. For more information about .vstemplate files, see Visual Studio Template Metadata Files.
When these files are compressed into a .zip file and put in the correct folder, Visual Studio automatically displays them in the My Templates section of the New Project and Add New Item dialog boxes. For more information about template folders, see How to: Locate and Organize Project and Item Templates.
You should open Templates Explorer from ReSharper | Templates Explorer. Then select the File Templates tab. There are default templates that comes with ReSharper. You can examine them and see how you can write your own. Here's the documentation and there's a question for useful examples.

Resources