Showing posts with label Visual Studio 2010. Show all posts
Showing posts with label Visual Studio 2010. Show all posts

Thursday, May 1, 2014

Manually unbinding a Visual Studio Solution from Source Control

 

If you have ever downloaded a Visual Studio solution from the Internet that was bound to source control, you may know that by default, the solution will always try to open with connections to the Source Control Provider. 

In some cases, Visual Studio may offer you an option to remove the source control binding, but in other cases, it may fail to load the solution altogether!

Well, fortunately, there is an easy way out of this situation.  However, it requires a bit of manual editing to remedy this situation.

  1. If the project is already unloaded in Visual Studio, right click on the project file and select “Edit MyProj.csproj”
  2. Now when you open up the project file, you should see some XML elements that begin with Scc
  3. Delete all of the Scc elements and save the file
  4. Now, when you open the solution, the project should be unbound from source control and you should be able to work with the solution file again!
<SccProjectName>SIM Example</SccProjectName>
<SccLocalPath>1~11fc7323-753a-426e-8db0-537b3138b51d</SccLocalPath>
<SccAuxPath>http://localhost/VaultService</SccAuxPath>
<SccProvider>SourceGear Vault Visual Studio 2005 Client:{7BE9CE03-56BF-4682-9C06-78C68B134B30}</SccProvider>

Monday, November 4, 2013

Problem when upgrading Visual Studio 2010 Web Project to Visual Studio 2013


With the recent release of Visual Studio 2013, I decided to try and start upgrading some of my Visual Studio 2010 projects over to Visual Studio 2013.

I opened up a reasonably large solution that contained several different types of C# projects and the overall solution seemed to upgrade just fine.

However, when I built/re-built my solution, I noticed a very puzzling error message:


Well, it seemed to address the problem indirectly in a number of ways, but copying and pasting the code exactly as it appeared in the article did not seem to work for me!  However, the solution seemed correct nevertheless, so I tried a variation after more closely examining the MSBuild script since I knew that MSBuild 12.0 (which ships with Visual Studio 2013) changed various properties in MSBuild and that could be contributing to the continued error message.  In addition, I knew that the Publishing model changed from Visual Studio 2010 to Visual Studio 2013, so I removed both of the Microsoft.Web.Publishing elements.

Therefore, this was the final result of my Visual Studio 2013 change:
 
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />




If you think you might still require preservation of the Microsoft.Web.Publishing.targets, you can alternatively simply enter an empty _CopyBinDeployableAssemblies target into your Visual Studio project file.  As it turns out, that also works!

I included the line just before the BeforeBuild event.  My resultant Visual Studio 2013 project file looked like this:



<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\Web\Microsoft.Web.Publishing.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets" Condition="false" />
<Target Name="_CopyBinDeployableAssemblies"></Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->

Monday, March 25, 2013

Visual Studio Toolbar differences between Visual Studio 2010 and 2012

If you are switching from Visual Studio 2010 over to Visual Studio 2012, most of the main toolbar menu headers should be the same.

However, the ONE major difference between the 2 IDEs is the switch from the Data menu item to the SQL menu item.



In the case of Visual Studio 2012, while the SQL menu item replaces some of the functionality for Schema and Data Comparisons, as well as the Transact SQL Editor, it does not completely replace the Data menu item.

In the case of the Data menu item, you also have 2 menu items for "Show Data Sources" and "Add New Data Source".  



While neither of these menu items seem to exist in Visual Studio 2012, you can perform these same operations in the Data Sources pane which is usually hidden along with the Toolbox.




Sunday, February 24, 2013

Deployable Dependencies option missing in Visual Studio 2012

I was recently reading an article regarding how to deploy ASP.NET MVC 4 to a Shared Hosting Provider and the article mentioned using the "Add Deployable Dependencies" option.

Well, I was using Visual Studio 2012 and I did not see this option anywhere!


 Well, as it turns out according to this Microsoft Connect feedback item, this option was removed from Visual Studio 2012: http://connect.microsoft.com/VisualStudio/feedback/details/735553/add-deployable-dependencies-missing-from-vs11-beta

Therefore, while this option still exists in Visual Studio 2010 (and Visual Studio 2010 SP1), it was built into the NuGet Package Manager alongside Visual Studio 2012 so that all required assemblies are automatically bin deployed.




Publishing Web differences between Visual Studio 2010 and Visual Studio 2012

I recently switched over from developing my Web Applications using Visual Studio 2010 to Visual Studio 2012 and was trying to publish one of my ASP.NET MVC Web Applications using Visual Studio 2012 and I came across this dialog:


This dialog was COMPLETELY different from the dialog I used to see in Visual Studio 2010!!


In Visual Studio 2010, I had the option to also select from a variety of choices for publishing as well as the ability to create new Publishing profiles directly from within the IDE:


Needless to say, I still have not figured out how to create a Publishing profile in Visual Studio 2012 similar to how I was previously able to do so using Visual Studio 2010.

If you are like me and want the capabilities of the Visual Studio 2010 IDE available in Visual Studio 2012, please vote for this Visual Studio UserVoice feedback item:

http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/3687139-provide-a-publish-web-dialog-similar-to-visual-stu

Sunday, February 3, 2013

Merging ASP.NET Web Application projects with ASP.NET MVC Projects

If you want to learn how to merge an ASP.NET Web Application project with an ASP.NET MVC project, you can follow this article here: http://www.hanselman.com/blog/IntegratingASPNETMVC3IntoExistingUpgradedASPNet4WebFormsApplications.aspx

This might be useful if you start out with an ASP.NET Web Application project that you have built quite some time ago and have now decided you want to leverage the power and flexibility of ASP.NET MVC with Entity Framework and jQuery.

One of the notable things that is missing from Scott Hanselman's article is manually editing the Visual Studio project file in order to get the right click Visual Studio MVC functionality into the project.

You can accomplish this by doing the following:


  1. Simply open a valid ASP.NET MVC Web Application project file in Visual Studio
  2. Unload the project and right click and select it for Editing.  
  3. Right click and select Edit the .csproj file
  4. Review the ProjectTypeGuids element in the ASP.NET MVC Web Application Project and copy them to the clipboard
  5. Follow steps 1-3 for the ASP.NET Web Application project file and replace your existing ProjectTypeGuids
  6. Save the resultant ASP.NET Web Application project file.
  7. Reload the ASP.NET Web Application project
  8. Right click on the Controllers or Views directory in Visual Studio and verify that you now are able to add appropriate Controllers or Views to the respective directory!

Thursday, July 12, 2012

Hacking the Visual Web Part project template in Visual Studio 2010

If you have worked with the Visual Web Part project in Visual Studio 2010, you already know that you cannot use a Sandboxed-compatible Visual Web Part project.  Instead, you have to use the Item Template that ships with the SharePoint Power Tools to achieve this solution.

However, if you look at the underlying solution that Microsoft has provided with the use of the SharePoint Power Tools, it is really just a sleight of hand that can easily be worked around by manually "hacking" the original Visual Web Part project template.

If you look at the Project Template (.vstemplate file) for a Visual Web Part project, you will find the following lines:
<WizardExtension>
    <Assembly>Microsoft.VisualStudio.SharePoint.ProjectExtensions.Wizards, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
    <FullClassName>Microsoft.VisualStudio.SharePoint.ProjectExtensions.Wizards.WebPartProjectWizard</FullClassName>
  </WizardExtension>

However, if you look at the Project Template (.vstemplate file) for an Empty SharePoint Project, you will find the following lines:
  <WizardExtension>
    <Assembly>Microsoft.VisualStudio.SharePoint.ProjectExtensions.Wizards, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
    <FullClassName>Microsoft.VisualStudio.SharePoint.ProjectExtensions.Wizards.EmptyProjectWizard</FullClassName>
  </WizardExtension>

Interestingly enough, the Wizard Extension for an Empty SharePoint project provides the capability to create a sandboxed-compatible solution as well as a Farm solution.  However, when you create a Visual Web Part project, you can only create Farm Level solutions.

But, the instructions for creating a sandboxed-compatible Visual Web Part is to first create an Empty SharePoint project and then to add a Visual Web Part (Sandboxed) Item Template.

So it just looks like Microsoft is really leveraging the sandboxed capabilities from the Empty SharePoint project template!

In any case, I started playing around with manipulating and modifying the Project Templates and sure enough, I was able to inject the WizardExtension for an Empty SharePoint project into a Project Template for a Visual Web Part project.

After doing this and importing the new SharePoint Project Template into Visual Studio 2010, I was able to use a Visual Studio 2010 Web Part project template interchangeably for sandboxed solutions as well as Farm solutions!

Creating a Visual Web Part project as a Sandboxed solution

As most SharePoint 2010 developers know, you cannot normally create a Visual Web Part "project" that supports sandboxed solutions.  

Instead, in Visual Studio 2010, you have to create an Empty SharePoint project as a sandboxed solution and then using the SharePoint Power Tools you can add the Visual Web Part Item Template for sandboxed solutions.  

Well, while this solution is an "OK" workaround, it is definitely not very appealing and certainly requires more time and effort than simply having this template out of the box.  

Fortunately, Visual Studio 2012 now offers the Visual Web Part as a project template!!  Therefore, you can just create the Visual Web Part project as a sandboxed solution in Visual Studio 2012 and you are ready to go!

Well, what if you do your production development with Visual Studio 2010??  Never fear, now that Visual Studio 2012 has backwards project compatibility with Visual Studio 2010 SP1, you can simply open the resultant project and solution file directly in Visual Studio 2010!!

What a great deal!!




Wednesday, June 27, 2012

Installation problem while installing SQL Server 2012 with Visual Studio 2010 SP1

If you are installing a single machine with both SQL Server Developer or Enterprise Edition as well as Visual Studio 2010, you may encounter an unusual issue with recognition of the Visual Studio 2010 Service Pack (SP1): http://samirvaidya.blogspot.com/2012/06/visual-studio-sdk-you-must-have.html

This actually occurs in the scenario where you install SQL Server 2012 with SQL Server Data Tools after you have already installed Visual Studio 2010 with SP1Since SQL Server Data Tools is its own version of the Visual Studio 2010 IDE, it removes the registry flag that indicates that SP1 for Visual Studio 2010 was installed successfully. 

Therefore, when you later attempt to install a program that has a Visual Studio 2010 SP1 dependency (such as the Visual Studio 2010 SP1 SDK), you will get a failure upon installation!!

So, if you want to avoid this error message, you can either install SQL Server 2012 before installing Visual Studio 2010 with SP1 or use the registry hack that I provided in the article above to work around this problem.

Wednesday, June 20, 2012

Visual Studio SDK--You must have Microsoft Visual Studio 2010 SP1 installed

If you are attempting to install Visual Studio 2010 SP1 SDK, you may encounter the following error message even after insalling SP1:

Error Type: Microsoft.VisualStudio.Sdk.Setup.MissingPrerequisiteException
Error Message: You must have Microsoft Visual Studio 2010 SP1 installed on your computer before proceeding.


Well, as it turns out, this is isolated to a single registry flag.  For some reason, Visual Studio 2010 SP1 does not always set this registry key on systems, which subsequently causes the Visual Studio 2010 SP1 SDK installation to fail.

Since I was installing Visual Studio 2010 on Windows Server 2008 R2 (a 64-bit OS), I had to examine the following registry key path:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\DevDiv\vs\Servicing\10.0\SP

Before SP1 is installed, this key is set at the value of 0. 



After looking at another installation where the installation of Visual Studio SP1 SDK actually worked, I discovered that this registry key needs to be set to a value of 1.



After changing the registry key to a value of 1 (using the Decimal value selection in RegEdit), I was able to successfully install the Visual Studio 2010 SP1 SDK!!  Hooray!

Monday, June 11, 2012

Visual Studio 2012 and the death of Moles

Microsoft has recently published their edition comparison of features for Visual Studio 2012:


This is their original feature comparison for Visual Studio 2010:


As you can tell from the comparison chart, they have added a few features to the Premium edition which were not available before such as Lab Management capabilities and some of the newly added features such as PowerPoint Storyboarding.  However, on the whole, the Professional edition continues to get the short end of the stick with a very nominal set of features added to the Professional edition with the Visual Studio 2012 release vs. the prior Visual Studio 2010 release.

Most notably, the newly integrated Fakes framework for isolation testing in Unit Testing is reserved exclusively for developers with an MSDN Ultimate subscription.  With the Visual Studio 2010 release, Pex and Moles was available as an integrated add-on for MSDN Premium and Ultimate subscribers while Moles could be downloaded independently for free from the Visual Studio Gallery.

Of course, Moles is no longer being actively developed (http://research.microsoft.com/en-us/projects/moles/) thereby leaving any developers that were previously using it with Visual Studio 2010 Professional high and dry to choose another alternative mocking framework.

Did Microsoft make the right decision to bundle Fakes exclusively with Visual Studio Ultimate or should Fakes be provided with Visual Studio Professional edition as well?  Perhaps it should be provided as a free download similar to Moles?

Let Microsoft know what you think and let your voice be heard!

Monday, April 2, 2012

Installing Visual Studio 2010 with SP1

While Microsoft does not offer a "slipstreamed" installation of Visual Studio 2010 with Service Pack 1, they do offer an article on how to install Visual Studio 2010 in succession with SP1.

It is a rather lengthy process to set up, but once it is implemented, it can save a tremendous amount of time especially if a large number of developers on the team need to install Visual Studio 2010 with SP1 on their local workstations.

You can read more about the details of how to accomplish this here: http://blogs.msdn.com/b/heaths/archive/2011/03/15/installing-visual-studio-2010-rtm-and-service-pack-1-together.aspx

Sunday, March 25, 2012

Understanding Visual Studio Item and Project Template Categorization

If you are creating your own Visual Studio Item or Project Templates, it is worthwhile to understand how Visual Studio itself categorizes its content.

Interestingly enough, there is actually nothing in the .vstemplate file which explicitly forces the categorization of the content into the appropriate navigational structure when you Add a New Item or create a New Project.  Instead, the categorization is based solely on folder structure!

Therefore, the best way to get an understanding of the required folder structure for your own Item and Project Templates is to look at the way that Visual Studio internally utilizes its folder structure.


If we look at the Item Template folder structure, we can see that the top level folder structure is categorized based on the various project types.  Some are categorized by the actual language such as CSharp or VisualBasic, while others are categorized by their actual project type such as Test or Web.

If we dig a little deeper into the actual folder structure for a particular language such as CSharp, we will see the following folder structure:


For the language, we see the various project types mapping to the project categorizations we normally see when we create a New Project within Visual Studio or Add a New Item within Visual Studio.


The only major confusing project type that arises is the use of the Web project type.  As you noticed from the earlier screenshot, Web is a project type at the root of the folder hierarchy as well as residing beneath the CSharp folder structure.

As it turns out, the Web folder residing at the root of the folder structure corresponds to Web Sites, while the Web folder beneath the CSharp directory corresponds to Web Applications.  Therefore, the languages for CSharp and VisualBasic actually reside beneath  the Web folder structure when creating Web Sites.

Other than that, everything else in the folder structure should be pretty self explanatory!

Hopefully this gives you a little bit more insight when creating your own Item and Project Templates for use within your own organization.  As long as you are able to follow this folder structure for your own Item and Project Templates, you should have no trouble getting your Items and Projects to appear in the correct locations in the Visual Studio Installed Templates Navigation Tree!

Thursday, March 8, 2012

Unintended side effects of debugging with Fiddler

If you use Fiddler to debug your web-based applications, there may be an unintended side effect of using Fiddler that you may not know about.

First of all, the way in which Fiddler works is by intercepting the traffic that is normally sent between your client browser and the target server.  How does it do that?  By inserting itself as a proxy between itself and the browser!

You can verify this for yourself by checking the proxy settings of your Internet Connection through Internet Explorer:


  1. Open up Internet Explorer
  2. Click on Tools-->Internet Options
  3. Click on the Connections tab
  4. Click on the LAN Settings button
  5. You should see a checkbox next to "Use a proxy server for your LAN"
  6. If you click on the Advanced button, you should now see the proxy server settings that Fiddler uses:
    • HTTP Proxy Address: 127.0.0.1 Port: 8888
    • Secure Proxy Address: 127.0.0.1 Port: 8888
Well, one of the unintended side effects of this is that you may not be able to get to content on the Internet if Fiddler is not running!  This will particularly occur if you are working on a virtual machine that is configured to use a static IP address rather than a DHCP Bridged or NAT IP Address.

Of course, the solution to this is to simply remove the proxy settings from Internet Explorer's Internet Connection properties, but if you have not encountered this before, you may be wondering what just happened to your Internet Connectivity!

So hopefully if you stumble across this situation in the midst of one of your debugging sessions, now you will know how to resolve it quickly and efficiently!

Wednesday, March 7, 2012

CodeRush Xpress Developer Productivity Tool

If you are looking for a free add-on to Visual Studio 2008 or 2010 that significantly extends the capability of Visual Studio, CodeRush XPress is definitely worth a look.

Some of the features that you can get from CodeRush XPress are listed here:http://community.devexpress.com/blogs/markmiller/archive/2009/06/25/coderush-xpress-for-c-and-visual-basic-2008.aspx

To download CodeRush Xpress, you can go to this website: http://msdn.microsoft.com/en-us/vstudio/ee663901

Sunday, February 26, 2012

Publishing VSIX Project or Item Templates in a specified Category

If you are creating a VSIX Project and adding your individual Item or Project Templates to your VSIX Project, you probably have noticed that the default behavior of the VSIX Project is to simply publish the Item or Content Template at the root of the targeted language such as C#.

However, many Project Templates or Item Templates will be targeted towards specific categories or project types such as "Web", therefore, you will want to ensure that this categorical information displays when you install your VSIX Project as well.

Fortunately, the solution to achieving this is quite simple:

When you Add Content to your VSIX Project (such as your previously created Project or Item Template .zip file), there is a text field that states "Add to subfolder (optional)".  If you enter a directory path in this field such as /CSharp/Web, the appropriate folder structure will automatically be created for you as the content is added.




The result, as you can probably already guess, is that the installation of the VSIX project successfully publishes your Project or Item Template in the appropriate category!

Getting to know Visual Studio Template Replacement Parameters

If you have been working with creating your own custom Project or Item Templates in Visual Studio, you may find many of the replacement parameters confusing (at best).

There are numerous replacement parameters available, but the most common ones that you will use while creating your Project and Item Templates are listed below:
safeitemrootname Most often used with files that may span several files such as a WCF Servce
safeprojectname Most often used in Web Applications
rootnamespace Most often used in Class Library projects for class files
classname  Used to dynamically create the class name in any class file including code behind files

There are actually many more available to use across all of your various projects as can be found documented here:  http://msdn.microsoft.com/en-us/library/eehb4faa.aspx

Interestingly enough, however, if you extract some of the Project and Item Templates that are included as part of the Visual Studio 2010 installation, you will encounter many more which are completely undocumented such as the use of codebesiderootname and codebesideclassname or even masterpage or pagecontent.

As you dig further into creating your own Item and Project Templates, the best source of reference for developing these will ultimately be what Microsoft has done itself in the creation of various templates used within Visual Studio.

The great thing about creating your own Item and Project Templates is that these can easily be shared with a development team to encourage re-usability and standardization of development throughout projects in your organization.  

Rather than have individual developers create brand new Visual Studio projects that need to be heavily customized, you can now export these templates and share them with your development staff so as to save them from all of this customization effort.  If you also participate in periodic code reviews, you can probably imagine how much nicer it will be to perform these code reviews when every developer is using the same set of templates to develop their projects and their code!



Thursday, February 23, 2012

Creating custom Visual Studio Item Templates

If you are using Visual Studio 2010, you probably know that you can easily create new Item Templates based on existing file by simply selecting File-->Export Template and using the Item Template option in the Wizard.

However, this quick and easy solution of creating Item Templates may leave quite a lot be desired in terms of customizing your Item Templates for future use.  The file names may not follow any standard conventions and things such as namespaces, class names, interfaces etc. may be exported as-is, thus providing limited re-usability.

Instead, what you will probably want to do is customize the content in the file prior to exporting the content as an Item Template.

Fortunately, there is a syntactical language available for providing just this type of functionality.  You can read more about this syntax here: http://msdn.microsoft.com/en-us/magazine/cc188697.aspx

If you want to see some examples of how this syntax is used, you have to look no further than your own Visual Studio 2010 installation!

Beneath the Program Files directory, you should find the following directory structure:
Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\

Below this directory you will find Item Templates for all of the various Item Templates that ship by default with Visual Studio 2010.

Now, if you navigate into any of these directories (such as CSharp), you will find several subdirectories corresponding to the various Item Template categories you find while creating New Items in Visual Studio.

If you go into the Code Directory and the 1033 subdirectory (for the English language), you will find numerous .zip files.  Interestingly enough, all of the Item Templates in Visual Studio are simply represented as nothing more than .zip files!

Since they are just .zip files, you can examine any of them by using any number of Zip Extraction tools (including Windows Own Built-in Zip Utility that ships with Windows Vista and later).

For example, if I open up the Class.zip file, I will find 2 files contained within:
  1. Class.vstemplate
  2. Class.cs
If I now open up the Class.cs file, I will see content such as the following:

using System;
using System.Collections.Generic;
$if$ ($targetframeworkversion$ >= 3.5)using System.Linq;
$endif$using System.Text;

namespace $rootnamespace$
{
    class $safeitemrootname$
    {
    }
}



The $<variable name>$ syntax is the internal substitution syntax that is being used to perform the required namespace and class processing that occurs when you add a new Class file to your project. As you can see, this maps over to the Built-In Replacement parameters provided in the link above.

Finally, if you open the Class.vstemplate file, you will also be able to see how the Template Definition is created so that it may be used in Visual Studio.
 
In future articles, I will begin examining some of the additional nuances and details about creating and using  Visual Studio Item Templates, but for now, you should have enough to get you started towards creating your very own Item Templates!



Friday, February 17, 2012

Dependent files in Visual Studio projects

If you have ever lost the hierarchical tree view in a Visual Studio project for a main file and its associated files, you probably already know that there is no way directly within the Visual Studio IDE to re-associate those files.  You may need to have this hierarchical tree view display particularly with the use of Config Transforms which are dependent on a primary Web.config file and its associated Build configuration transformation files.

Therefore, in order to do this, you will have to do the following:


  1. From within Visual Studio, right click on the affected project and select "Unload project"
  2. Once the project has been unloaded, you can right click on the project and select "Edit project"
  3. This will open the Visual Studio project for editing and display the MSBuild structure of the Visual Studio project file.
  4. If you are looking for a particular file such as Web.config, you can search for it.
  5. Once you find the appropriate element, determine if it exists as a standalone content item within an existing ItemGroup or if it is in its own associated ItemGroup.  If it is not within its own ItemGroup, you will need to remove the individual <Content Include="Web.config"> element and place in its own ItemGroup.  Visual Studio Intellisense will assist you in creating the new ItemGroup element.
  6. Once you have the Content item in the appropriate location, you need to add the dependency content items.
  7. A dependency content item will look like the following:

    <content include="Web.Debug.config">
    <dependentupon>Web.config</dependentupon>
    </content>

  8. You can add each of these elements within the dedicated ItemGroup depending on the number of Config Transforms that you have for your project.
  9. Your final ItemGroup should look similar to the following:

      <ItemGroup>
        <Content Include="Web.config" />
        <Content Include="Web.Debug.config">
          <DependentUpon>Web.config</DependentUpon>
        </Content>
        <Content Include="Web.Release.config">
          <DependentUpon>Web.config</DependentUpon>
        </Content>
      </ItemGroup>

Tuesday, January 10, 2012

Creating Visual Studio Extensions

If you are interested in creating re-usable templates for Visual Studio, you can create these templates quite readily through the help of the Visual Studio SDK and the Export Template Wizard.

Using the Export Template wizard, you will actually be provided with the option to Export a Template as a VSIX file.

Generally, when you Export a Template from the Visual Studio File menu, it simply exports a template as a .zip file which must be manually placed in a Template directory of your choosing.

However, while using VSIX files, you can actually produce an installable template which can be integrated with Visual Studio.

Here is an MSDN article describing one method of creating Visual Studio extensions using the Export Template wizard:  http://msdn.microsoft.com/en-us/library/ff728614.aspx

You can download the Visual Studio 2010 SP1 SDK from here: http://www.microsoft.com/download/en/details.aspx?id=21835
You can download the Export Template Wizard from here: http://visualstudiogallery.msdn.microsoft.com/57320b20-34a2-42e4-b97e-e615c71aca24/