<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d8211560\x26blogName\x3dTech+Tips,+Tricks+%26+Trivia\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttp://mvark.blogspot.com/search\x26blogLocale\x3den\x26v\x3d2\x26homepageUrl\x3dhttp://mvark.blogspot.com/\x26vt\x3d-5147029996388199615', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Tech Tips, Tricks & Trivia

by 'Anil' Radhakrishna
An architect's notes, experiments, discoveries and annotated bookmarks.

Search from over a hundred HOW TO articles, Tips and Tricks


HOW TO build your own Project Template in Visual Studio 2008

If you build a lot of websites that follow a similar structure or wish to enforce a similar structure within your team so that the code and applications are consistent and standardized, you can consider building your own Project template in Visual Studio 2008 in order to re-use. For instance, you may want the jQuery libary to be included in a JS folder for every new website that you create. Just like you see "ASP.NET Web Site" & other templates when you choose File > New option, you can have a custom Project Template show up after you create a new Project template.

The Visual Web Developer MSDN blog has detailed step by step instructions on creating a custom Project template for Visual Studio Web Developer & VSTS. I adapted the steps described there to create a Project template for VS 2008. Here are the instructions paraphrased for VS 2008:
  1. Open the model website based on which you wish to create newer websites.
  2. From the File menu, select Export Template...
  3. In the Export Template Wizard that appears, choose Project Template and click the Next button
  4. Choose a template name and specify a description for it.
  5. Keep the checkboxes "Automatically import the template into Visual Studio" and "Display an Explorer window on the output files folder" checked. (If you want your template to appear for all users, you should first un-check Automatically import the template into Visual Studio) and click on the Finish button of the Wizard.
  6. Copy the template (.zip file) alongside the other Project templates in this folder - Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplates\Web\CSharp\1033
  7. Select Visual Studio 2008 Command Prompt from Visual Studio Tools that appears in the Programs menu under Microsoft Visual Studio 2008.
  8. Run Devenv /setup at the command prompt
Now when you start creating a new website, you can select your new custom template.

Similarly, you can create an Item Template so that whenever you select File > New > File... or right click on a project within Solution Explorer & choose "Add New Item...", you can find a custom Item template similar to Web Form or AJAX Web Form.

Labels: , ,

Tweet this | Google+ it | Share on FB

« Home | Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »

»

Post a Comment