Easily Create A Custom Project Template For MVC With Entity Framework

Introduction

 
If you often create an MVC project with Entity Framework in Visual Studio, you need to add the entityframework NuGet package library in every project manually. It is not a hard job but do you ever think about a new project template with Entity Framework? I myself studied the structure of projects with ASP.NET web applications and .NET Framework (not about .NET Core projects) and learned the way Microsoft structured it. I found that it is easy to add our own custom project templates in any of the Visual Studio versions. Here, I am sharing my own experience. I tried with both Visual Studio 2017 and 2019 versions. We will create a new project template for MVC with Entity Framework and add to the existing template list.
 

Identify the path of the MVC project templates for your Visual Studio version

 
First, you must identify the path of the MVC project templates for the version of Visual Studio you have installed. I am using Visual Studio 2019 Community Edition. If you are using any other version, the path may be different. The path for me is -
 
“C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\WebTemplates\MVC\CSharp\1033”
 
For example, if you are using Visual Studio 2017 Professional Edition, your path may be like below.
 
“C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\WebTemplates\MVC\CSharp\1033”
 
Important
 
We are going to modify some files and add some files to this folder. Please be careful to take a backup of this path before going to make any changes.
 
You can see the below folders and files inside the above folder.
 
Easily Create A Custom Project Template For MVC With Entity Framework
  • The “MvcApplicationTestLibaryv5.0” folder is used for test projects.
  • The “MvcBasicApplicationv5.0” folder is used for MVC 5.0 projects.
  • The “MvcEmptyTestLibaryv5.0” folder is also used for test projects and “Spav5.0” used for single page application projects.
  • You can see the “Mvc.png” image file which is used as a preview icon for all the templates.
  • There is one more file, “Templates.xml” in the folder. This is the most important file used to control the entire project templates.
We can copy the folder “MvcBasicApplicationv5.0” and rename to “MvcEntityApplicationv5.0”.
 
Easily Create A Custom Project Template For MVC With Entity Framework
 
Now, open this folder.
 
Easily Create A Custom Project Template For MVC With Entity Framework
 
You can see many folders and files inside the above folder. “MvcBasicApplication.cshtml.vstemplate” is the project template file which will control the default packages for an MVC project file. We can rename this file to “MvcEntityApplication.cshtml.vstemplate” for uniqueness.
 
We can open this file and add some values to this file. You can see many sections inside this template file.
 
Easily Create A Custom Project Template For MVC With Entity Framework
 
The last section is the “WizardData” section and you can see the default package details inside it. Please note these are the default package libraries added with an MVC project. We can add one more package reference inside this section for Entity Framework.
 
Easily Create A Custom Project Template For MVC With Entity Framework
 
I have added a new reference. Please note that you can’t add all the references inside this section. The package should be in the below file location.
 
“C:\Program Files (x86)\Microsoft Visual Studio\Shared\Packages”
 
The above folder is common for all Visual Studio versions. If you are adding a new package which is not in the above folder location, Visual Studio will throw an error while creating the project.
 
MvcEntityApplication.cshtml.vstemplate
  1. <VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Project">    
  2.     <TemplateData>    
  3.         <ProjectType>CSharp</ProjectType>    
  4.         <ProjectSubType>Web</ProjectSubType>    
  5.         <TemplateGroupID>Web</TemplateGroupID>    
  6.         <TemplateID>Microsoft.WAP.CSharp.MvcBasicApplication.v5</TemplateID>    
  7.         <SortOrder>51</SortOrder>    
  8.         <RequiredFrameworkVersion>4.5</RequiredFrameworkVersion>    
  9.         <CreateNewFolder>true</CreateNewFolder>    
  10.         <DefaultName>MvcApplication</DefaultName>    
  11.         <ProvideDefaultName>true</ProvideDefaultName>    
  12.         <LocationField>Enabled</LocationField>    
  13.         <PromptForSaveOnCreation>true</PromptForSaveOnCreation>    
  14.         <EnableLocationBrowseButton>true</EnableLocationBrowseButton>    
  15.     </TemplateData>    
  16.     <TemplateContent>    
  17.         <CustomParameters>    
  18.             <CustomParameter Name="$language$" Value="C#" />    
  19.             <CustomParameter Name="$languageext$" Value="cs" />    
  20.             <CustomParameter Name="$globalclassname$" Value="MvcApplication" />    
  21.         </CustomParameters>    
  22.         <Project File="MvcBasicApplication.csproj" ReplaceParameters="true">    
  23.             <ProjectItem ReplaceParameters="false" TargetFileName="favicon.ico">favicon.ico</ProjectItem>    
  24.             <Folder Name="Properties" TargetFolderName="Properties">    
  25.                 <ProjectItem ReplaceParameters="true" TargetFileName="AssemblyInfo.cs">AssemblyInfo.cs</ProjectItem>    
  26.             </Folder>    
  27.             <Folder Name="App_Data" TargetFolderName="App_Data" />    
  28.             <Folder Name="App_Start" TargetFolderName="App_Start">    
  29.                 <ProjectItem ReplaceParameters="true" TargetFileName="BundleConfig.cs">BundleConfig.cs</ProjectItem>    
  30.                 <ProjectItem ReplaceParameters="true" TargetFileName="FilterConfig.cs">FilterConfig.cs</ProjectItem>    
  31.                 <ProjectItem ReplaceParameters="true" TargetFileName="RouteConfig.cs">RouteConfig.cs</ProjectItem>    
  32.             </Folder>    
  33.             <Folder Name="Content" TargetFolderName="Content">    
  34.                 <ProjectItem ReplaceParameters="true" TargetFileName="Site.css">Site.css</ProjectItem>    
  35.             </Folder>    
  36.             <Folder Name="Controllers" TargetFolderName="Controllers">    
  37.                 <ProjectItem ReplaceParameters="true" TargetFileName="HomeController.cs">HomeController.cs</ProjectItem>    
  38.             </Folder>    
  39.             <Folder Name="Models" TargetFolderName="Models" />    
  40.             <Folder Name="Scripts" TargetFolderName="Scripts" />    
  41.             <Folder Name="Views" TargetFolderName="Views">    
  42.                 <Folder Name="Home" TargetFolderName="Home">    
  43.                     <ProjectItem ReplaceParameters="true" TargetFileName="About.cshtml">About.cshtml</ProjectItem>    
  44.                     <ProjectItem ReplaceParameters="true" TargetFileName="Contact.cshtml">Contact.cshtml</ProjectItem>    
  45.                     <ProjectItem ReplaceParameters="true" TargetFileName="Index.cshtml">Index.cshtml</ProjectItem>    
  46.                 </Folder>    
  47.                 <Folder Name="Shared" TargetFolderName="Shared">    
  48.                     <ProjectItem ReplaceParameters="true" TargetFileName="_Layout.cshtml">_Layout.cshtml</ProjectItem>    
  49.                     <ProjectItem ReplaceParameters="true" TargetFileName="Error.cshtml">Error.cshtml</ProjectItem>    
  50.                 </Folder>    
  51.                 <ProjectItem ReplaceParameters="true" TargetFileName="_ViewStart.cshtml">_ViewStart.cshtml</ProjectItem>    
  52.                 <ProjectItem ReplaceParameters="true" TargetFileName="Web.config">Web.config</ProjectItem>    
  53.             </Folder>    
  54.             <ProjectItem ReplaceParameters="true" TargetFileName="Global.asax">Global.asax</ProjectItem>    
  55.             <ProjectItem ReplaceParameters="true" TargetFileName="Global.asax.cs">Global.asax.cs</ProjectItem>    
  56.             <ProjectItem ReplaceParameters="true" TargetFileName="Web.config">Web.config</ProjectItem>    
  57.             <ProjectItem ReplaceParameters="true" TargetFileName="Web.Debug.config">Web.Debug.config</ProjectItem>    
  58.             <ProjectItem ReplaceParameters="true" TargetFileName="Web.Release.config">Web.Release.config</ProjectItem>    
  59.         </Project>    
  60.     </TemplateContent>    
  61.     <WizardExtension>    
  62.         <Assembly>NuGet.VisualStudio.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>    
  63.         <FullClassName>NuGet.VisualStudio.TemplateWizard</FullClassName>    
  64.     </WizardExtension>    
  65.     <WizardData>    
  66.         <packages repository="registry" keyName="WebFormsVS16" isPreunzipped="true">    
  67.             <package id="Newtonsoft.Json" version="11.0.1" skipAssemblyReferences="true" />    
  68.             <package id="bootstrap" version="3.4.1" skipAssemblyReferences="true" />    
  69.             <package id="EntityFramework" version="6.2.0" skipAssemblyReferences="true" />    
  70.             <package id="jQuery" version="3.3.1" skipAssemblyReferences="true" />    
  71.             <package id="Microsoft.AspNet.Razor" version="3.2.7" skipAssemblyReferences="true" />    
  72.             <package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" skipAssemblyReferences="true" />    
  73.             <package id="Microsoft.AspNet.WebPages" version="3.2.7" skipAssemblyReferences="true" />    
  74.             <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" skipAssemblyReferences="true" />    
  75.             <package id="Microsoft.AspNet.Mvc" version="5.2.7" skipAssemblyReferences="true" />    
  76.             <package id="Modernizr" version="2.8.3" skipAssemblyReferences="true" />    
  77.             <package id="Antlr" version="3.5.0.2" skipAssemblyReferences="true" />    
  78.             <package id="WebGrease" version="1.6.0" skipAssemblyReferences="true" />    
  79.             <package id="jQuery.Validation" version="1.17.0" skipAssemblyReferences="true"/>    
  80.             <package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.2.11" skipAssemblyReferences="true"/>    
  81.              
  82.         </packages>    
  83.     </WizardData>    
  84. </VSTemplate>    
We can go to the previous folder location and modify the “Templates.xml” file.
 
You can see a “UI” section and multiple “Template” sections. We need to copy the “MVC” template section and rename as “MVC with EntityFramework”. Also, modify the “BaseTemplateID” to “Microsoft.WAP.CSharp.MvcEntityApplication.v5.0" and modify the “Order” to “1001”. Modify the “Icon” and “PreviewImage” with “Mvc-entity.png”. Now, our icon will be different from other templates. You can use any 32x32 pixel image. Let us modify the summary and description details as well.
 
Easily Create A Custom Project Template For MVC With Entity Framework
 
Add a “BaseTemplate” section also to this file. Copy the details of the default MVC section and modify the ID and VSTemplatePath, as shown below.
 
Easily Create A Custom Project Template For MVC With Entity Framework
 
Templates.xml
  1. <?xml version="1.0" encoding="utf-8" ?>    
  2. <TemplateDefinition Name="_MVC" Order="1000">    
  3.     <UI>    
  4.         <Template Name="MVC" BaseTemplateID="Microsoft.WAP.CSharp.MvcBasicApplication.v5.0" Order="1000">    
  5.             <Icon>Mvc.png</Icon>    
  6.             <PreviewImage>Mvc.png</PreviewImage>    
  7.             <Summary>A project template for creating ASP.NET MVC applications. ASP.NET MVC allows you to build applications using the Model-View-Controller architecture. ASP.NET MVC includes many features that enable fast, test-driven development for creating applications that use the latest standards.</Summary>    
  8.             <Description>A project template for creating ASP.NET MVC applications. ASP.NET MVC allows you to build applications using the Model-View-Controller architecture. ASP.NET MVC includes many features that enable fast, test-driven development for creating applications that use the latest standards.</Description>    
  9.             <SupportsDocker>True</SupportsDocker>    
  10.             <Options>    
  11.                 <Authentication Default="NoAuth">    
  12.                     <NoAuth/>    
  13.                     <IndividualAuth/>    
  14.                     <WindowsAuth/>    
  15.                     <OrgAuth/>    
  16.                 </Authentication>    
  17.                 <TemplateReferences>    
  18.                     <WebForms/>    
  19.                     <MVC Required="true"/>    
  20.                     <WebAPI/>    
  21.                 </TemplateReferences>    
  22.                 <AzureResources>    
  23.                     <AzureWebsite />    
  24.                     <AzureVirtualMachine />    
  25.                 </AzureResources>    
  26.             </Options>    
  27.             <UnitTest DefaultBaseTemplateID="Microsoft.CSharp.MvcApplicationTestLibrary.v5.0"/>    
  28.         </Template>    
  29.         <Template Name="MVC with EntityFramework" BaseTemplateID="Microsoft.WAP.CSharp.MvcEntityApplication.v5.0" Order="1001">    
  30.           <Icon>Mvc-entity.png</Icon>    
  31.           <PreviewImage>Mvc-entity.png</PreviewImage>    
  32.           <Summary>A project template for creating ASP.NET MVC applications with entity framework. (Added by Sarathlal.S)</Summary>    
  33.           <Description>A project template for creating ASP.NET MVC applications with entity framework. (Added by Sarathlal.S)</Description>    
  34.           <SupportsDocker>True</SupportsDocker>    
  35.           <Options>    
  36.             <Authentication Default="NoAuth">    
  37.               <NoAuth/>    
  38.               <IndividualAuth/>    
  39.               <WindowsAuth/>    
  40.               <OrgAuth/>    
  41.             </Authentication>    
  42.             <TemplateReferences>    
  43.               <WebForms/>    
  44.               <MVC Required="true"/>    
  45.               <WebAPI/>    
  46.             </TemplateReferences>    
  47.             <AzureResources>    
  48.               <AzureWebsite />    
  49.               <AzureVirtualMachine />    
  50.             </AzureResources>    
  51.           </Options>    
  52.           <UnitTest DefaultBaseTemplateID="Microsoft.CSharp.MvcApplicationTestLibrary.v5.0"/>    
  53.         </Template>    
  54.         <Template Name="Single Page Application" BaseTemplateID="Microsoft.WAP.CSharp.Spa.v5.0" Order="1200">    
  55.             <Icon>Mvc.png</Icon>    
  56.             <PreviewImage>Mvc.png</PreviewImage>    
  57.             <Summary>A project template for creating rich client side JavaScript driven HTML5 applications using ASP.NET Web API. Single Page Applications provide a rich user experience which includes client-side interactions using HTML5, CSS3, and JavaScript.</Summary>    
  58.             <Description>A project template for creating rich client side JavaScript driven HTML5 applications using ASP.NET Web API. Single Page Applications provide a rich user experience which includes client-side interactions using HTML5, CSS3, and JavaScript.</Description>    
  59.             <SupportsDocker>True</SupportsDocker>    
  60.             <Options>    
  61.                 <Authentication Default="IndividualAuth">    
  62.                     <IndividualAuth/>    
  63.                 </Authentication>    
  64.                 <TemplateReferences>    
  65.                     <WebForms/>    
  66.                     <MVC Required="true"/>    
  67.                     <WebAPI Required="true"/>    
  68.                 </TemplateReferences>    
  69.                 <AzureResources>    
  70.                     <AzureWebsite />    
  71.                     <AzureVirtualMachine />    
  72.                 </AzureResources>    
  73.             </Options>    
  74.             <UnitTest DefaultBaseTemplateID="Microsoft.CSharp.MvcEmptyTestLibrary.v5.0"/>    
  75.         </Template>    
  76.     </UI>    
  77.     
  78.     <BaseTemplates>    
  79.         <BaseTemplate ID="Microsoft.WAP.CSharp.MvcBasicApplication.v5.0"    
  80.                       NugetPackageKey="WebFormsVS16"    
  81.                       VSTemplatePath="MvcBasicApplicationv5.0\MvcBasicApplication.cshtml.vstemplate">    
  82.             <ApplyRules>    
  83.                 <RunRule RuleID="global.WebAPI" Option="WebAPI" />    
  84.             </ApplyRules>    
  85.             <ApplyRules>    
  86.                 <RunRule RuleID="global.WebForms" Option="WebForms" />    
  87.             </ApplyRules>    
  88.             <ApplyRules Option="NoAuth">    
  89.                 <RunRule RuleID="BasicMvcWithWebApi" Option="WebAPI" />    
  90.                 <RunRule RuleID="BasicMvcWithWebForms" Option="WebForms" />    
  91.                 <RunRule RuleID="BasicMvcWithWebApiWebForms" Option="WebAPI,WebForms" />    
  92.             </ApplyRules>    
  93.             <ApplyRules Option="WindowsAuth">    
  94.                 <!-- Windows authentication does not apply the MvcBasicCommonAuthFiles -->    
  95.                 <RunRule RuleID="MvcBasicWindowsAuthFiles"/>    
  96.                 <RunRule RuleID="BasicMvcWithWebApiWindowsAuth" Option="WebAPI" />    
  97.                 <RunRule RuleID="BasicMvcWithWebFormsWindowsAuth" Option="WebForms" />    
  98.                 <RunRule RuleID="BasicMvcWithWebApiWebFormsWindowsAuth" Option="WebAPI,WebForms" />    
  99.             </ApplyRules>    
  100.             <ApplyRules Option="IndividualAuth">    
  101.                 <RunRule RuleID="MvcBasicCommonAuthFiles"/>    
  102.                 <RunRule RuleID="MvcBasicIndividualAuthFiles"/>    
  103.                 <RunRule RuleID="BasicMvcWithWebApiIndividualAuth" Option="WebAPI" />    
  104.                 <RunRule RuleID="BasicMvcWithWebFormsIndividualAuth" Option="WebForms" />    
  105.                 <RunRule RuleID="BasicMvcWithWebApiWebFormsIndividualAuth" Option="WebAPI,WebForms" />    
  106.                 <RunRule RuleID="IndividualAuthPackages"/>    
  107.             </ApplyRules>    
  108.             <ApplyRules Option="OrgAuth">    
  109.                 <RunRule RuleID="MvcBasicCommonAuthFiles"/>    
  110.                 <ApplyRules Option="SSO">    
  111.                     <RunRule RuleID="MvcBasicOrgAuthFiles"/>    
  112.                     <RunRule RuleID="MvcBasicOrgAuthSSOFiles"/>    
  113.                     <RunRule RuleID="BasicMvcWithWebApiOrgAuthSSO" Option="WebAPI" />    
  114.                     <RunRule RuleID="BasicMvcWithWebFormsOrgAuthSSO" Option="WebForms" />    
  115.                     <RunRule RuleID="BasicMvcWithWebApiWebFormsOrgAuthSSO" Option="WebAPI,WebForms" />    
  116.                     <RunRule RuleID="OrgAuthPackages"/>    
  117.                     <RunRule RuleID="OrgAuthSSOAndMultiPackages"/>    
  118.                 </ApplyRules>    
  119.                 <ApplyRules Option="SSOR">    
  120.                     <RunRule RuleID="MvcBasicOrgAuthFiles"/>    
  121.                     <RunRule RuleID="MvcBasicOrgAuthSSOFiles"/>    
  122.                     <RunRule RuleID="MvcBasicOrgAuthADFiles"/>    
  123.                     <RunRule RuleID="MvcBasicOrgAuthADSSOFiles"/>    
  124.                     <RunRule RuleID="BasicMvcWithWebApiOrgAuthSSO" Option="WebAPI" />    
  125.                     <RunRule RuleID="BasicMvcWithWebFormsOrgAuthSSO" Option="WebForms" />    
  126.                     <RunRule RuleID="BasicMvcWithWebApiWebFormsOrgAuthSSO" Option="WebAPI,WebForms" />    
  127.                     <RunRule RuleID="BasicMvcWithWebApiOrgAuthSSOR" Option="WebAPI" />    
  128.                     <RunRule RuleID="BasicMvcWithWebFormsOrgAuthSSOR" Option="WebForms" />    
  129.                     <RunRule RuleID="BasicMvcWithWebApiWebFormsOrgAuthSSOR" Option="WebAPI,WebForms" />    
  130.                     <RunRule RuleID="OrgAuthPackages"/>    
  131.                     <RunRule RuleID="OrgAuthSSOAndMultiPackages"/>    
  132.                     <RunRule RuleID="OrgAuthADReadPackages"/>    
  133.                 </ApplyRules>    
  134.                 <ApplyRules Option="MultiOrg">    
  135.                     <RunRule RuleID="MvcBasicOrgAuthFiles"/>    
  136.                     <RunRule RuleID="MvcBasicOrgAuthMultiOrgFiles"/>    
  137.                     <RunRule RuleID="BasicMvcWithWebApiOrgAuthMultiOrg" Option="WebAPI" />    
  138.                     <RunRule RuleID="BasicMvcWithWebFormsOrgAuthMultiOrg" Option="WebForms" />    
  139.                     <RunRule RuleID="BasicMvcWithWebApiWebFormsOrgAuthMultiOrg" Option="WebAPI,WebForms" />    
  140.                     <RunRule RuleID="OrgAuthPackages"/>    
  141.                     <RunRule RuleID="OrgAuthSSOAndMultiPackages"/>    
  142.                 </ApplyRules>    
  143.                 <ApplyRules Option="MultiOrgR">    
  144.                     <RunRule RuleID="MvcBasicOrgAuthFiles"/>    
  145.                     <RunRule RuleID="MvcBasicOrgAuthMultiOrgFiles"/>    
  146.                     <RunRule RuleID="MvcBasicOrgAuthADFiles"/>    
  147.                     <RunRule RuleID="MvcBasicOrgAuthADMultiOrgFiles"/>    
  148.                     <RunRule RuleID="BasicMvcWithWebApiOrgAuthMultiOrg" Option="WebAPI" />    
  149.                     <RunRule RuleID="BasicMvcWithWebFormsOrgAuthMultiOrg" Option="WebForms" />    
  150.                     <RunRule RuleID="BasicMvcWithWebApiWebFormsOrgAuthMultiOrg" Option="WebAPI,WebForms" />    
  151.                     <RunRule RuleID="BasicMvcWithWebApiOrgAuthMultiOrgR" Option="WebAPI" />    
  152.                     <RunRule RuleID="BasicMvcWithWebFormsOrgAuthMultiOrgR" Option="WebForms" />    
  153.                     <RunRule RuleID="BasicMvcWithWebApiWebFormsOrgAuthMultiOrgR" Option="WebAPI,WebForms" />    
  154.                     <RunRule RuleID="OrgAuthPackages"/>    
  155.                     <RunRule RuleID="OrgAuthSSOAndMultiPackages"/>    
  156.                     <RunRule RuleID="OrgAuthADReadPackages"/>    
  157.                 </ApplyRules>    
  158.                 <ApplyRules Option="OnPrem">    
  159.                     <RunRule RuleID="MvcBasicOrgAuthFiles"/>    
  160.                     <RunRule RuleID="MvcBasicOrgAuthOnPremFiles"/>    
  161.                     <RunRule RuleID="BasicMvcWithWebApiOrgAuthOnPrem" Option="WebAPI" />    
  162.                     <RunRule RuleID="BasicMvcWithWebFormsOrgAuthOnPrem" Option="WebForms" />    
  163.                     <RunRule RuleID="BasicMvcWithWebApiWebFormsOrgAuthOnPrem" Option="WebAPI,WebForms" />    
  164.                     <RunRule RuleID="OrgAuthPackages"/>    
  165.                     <RunRule RuleID="OrgAuthOnPremPackages"/>    
  166.                 </ApplyRules>    
  167.             </ApplyRules>    
  168.             <!-- This needs to run last since it applies an XDT and avoids the other rules replacing web.config -->    
  169.             <ApplyRules>    
  170.                 <RunRule RuleID="CodeDomPackages" />    
  171.             </ApplyRules>    
  172.         </BaseTemplate>    
  173.         <BaseTemplate ID="Microsoft.WAP.CSharp.MvcEntityApplication.v5.0"    
  174.                        NugetPackageKey="WebFormsVS16"    
  175.                        VSTemplatePath="MvcEntityApplicationv5.0\MvcEntityApplication.cshtml.vstemplate">    
  176.           <ApplyRules>    
  177.             <RunRule RuleID="global.WebAPI" Option="WebAPI" />    
  178.           </ApplyRules>    
  179.           <ApplyRules>    
  180.             <RunRule RuleID="global.WebForms" Option="WebForms" />    
  181.           </ApplyRules>    
  182.           <ApplyRules Option="NoAuth">    
  183.             <RunRule RuleID="BasicMvcWithWebApi" Option="WebAPI" />    
  184.             <RunRule RuleID="BasicMvcWithWebForms" Option="WebForms" />    
  185.             <RunRule RuleID="BasicMvcWithWebApiWebForms" Option="WebAPI,WebForms" />    
  186.           </ApplyRules>    
  187.           <ApplyRules Option="WindowsAuth">    
  188.             <!-- Windows authentication does not apply the MvcBasicCommonAuthFiles -->    
  189.             <RunRule RuleID="MvcBasicWindowsAuthFiles"/>    
  190.             <RunRule RuleID="BasicMvcWithWebApiWindowsAuth" Option="WebAPI" />    
  191.             <RunRule RuleID="BasicMvcWithWebFormsWindowsAuth" Option="WebForms" />    
  192.             <RunRule RuleID="BasicMvcWithWebApiWebFormsWindowsAuth" Option="WebAPI,WebForms" />    
  193.           </ApplyRules>    
  194.           <ApplyRules Option="IndividualAuth">    
  195.             <RunRule RuleID="MvcBasicCommonAuthFiles"/>    
  196.             <RunRule RuleID="MvcBasicIndividualAuthFiles"/>    
  197.             <RunRule RuleID="BasicMvcWithWebApiIndividualAuth" Option="WebAPI" />    
  198.             <RunRule RuleID="BasicMvcWithWebFormsIndividualAuth" Option="WebForms" />    
  199.             <RunRule RuleID="BasicMvcWithWebApiWebFormsIndividualAuth" Option="WebAPI,WebForms" />    
  200.             <RunRule RuleID="IndividualAuthPackages"/>    
  201.           </ApplyRules>    
  202.           <ApplyRules Option="OrgAuth">    
  203.             <RunRule RuleID="MvcBasicCommonAuthFiles"/>    
  204.             <ApplyRules Option="SSO">    
  205.               <RunRule RuleID="MvcBasicOrgAuthFiles"/>    
  206.               <RunRule RuleID="MvcBasicOrgAuthSSOFiles"/>    
  207.               <RunRule RuleID="BasicMvcWithWebApiOrgAuthSSO" Option="WebAPI" />    
  208.               <RunRule RuleID="BasicMvcWithWebFormsOrgAuthSSO" Option="WebForms" />    
  209.               <RunRule RuleID="BasicMvcWithWebApiWebFormsOrgAuthSSO" Option="WebAPI,WebForms" />    
  210.               <RunRule RuleID="OrgAuthPackages"/>    
  211.               <RunRule RuleID="OrgAuthSSOAndMultiPackages"/>    
  212.             </ApplyRules>    
  213.             <ApplyRules Option="SSOR">    
  214.               <RunRule RuleID="MvcBasicOrgAuthFiles"/>    
  215.               <RunRule RuleID="MvcBasicOrgAuthSSOFiles"/>    
  216.               <RunRule RuleID="MvcBasicOrgAuthADFiles"/>    
  217.               <RunRule RuleID="MvcBasicOrgAuthADSSOFiles"/>    
  218.               <RunRule RuleID="BasicMvcWithWebApiOrgAuthSSO" Option="WebAPI" />    
  219.               <RunRule RuleID="BasicMvcWithWebFormsOrgAuthSSO" Option="WebForms" />    
  220.               <RunRule RuleID="BasicMvcWithWebApiWebFormsOrgAuthSSO" Option="WebAPI,WebForms" />    
  221.               <RunRule RuleID="BasicMvcWithWebApiOrgAuthSSOR" Option="WebAPI" />    
  222.               <RunRule RuleID="BasicMvcWithWebFormsOrgAuthSSOR" Option="WebForms" />    
  223.               <RunRule RuleID="BasicMvcWithWebApiWebFormsOrgAuthSSOR" Option="WebAPI,WebForms" />    
  224.               <RunRule RuleID="OrgAuthPackages"/>    
  225.               <RunRule RuleID="OrgAuthSSOAndMultiPackages"/>    
  226.               <RunRule RuleID="OrgAuthADReadPackages"/>    
  227.             </ApplyRules>    
  228.             <ApplyRules Option="MultiOrg">    
  229.               <RunRule RuleID="MvcBasicOrgAuthFiles"/>    
  230.               <RunRule RuleID="MvcBasicOrgAuthMultiOrgFiles"/>    
  231.               <RunRule RuleID="BasicMvcWithWebApiOrgAuthMultiOrg" Option="WebAPI" />    
  232.               <RunRule RuleID="BasicMvcWithWebFormsOrgAuthMultiOrg" Option="WebForms" />    
  233.               <RunRule RuleID="BasicMvcWithWebApiWebFormsOrgAuthMultiOrg" Option="WebAPI,WebForms" />    
  234.               <RunRule RuleID="OrgAuthPackages"/>    
  235.               <RunRule RuleID="OrgAuthSSOAndMultiPackages"/>    
  236.             </ApplyRules>    
  237.             <ApplyRules Option="MultiOrgR">    
  238.               <RunRule RuleID="MvcBasicOrgAuthFiles"/>    
  239.               <RunRule RuleID="MvcBasicOrgAuthMultiOrgFiles"/>    
  240.               <RunRule RuleID="MvcBasicOrgAuthADFiles"/>    
  241.               <RunRule RuleID="MvcBasicOrgAuthADMultiOrgFiles"/>    
  242.               <RunRule RuleID="BasicMvcWithWebApiOrgAuthMultiOrg" Option="WebAPI" />    
  243.               <RunRule RuleID="BasicMvcWithWebFormsOrgAuthMultiOrg" Option="WebForms" />    
  244.               <RunRule RuleID="BasicMvcWithWebApiWebFormsOrgAuthMultiOrg" Option="WebAPI,WebForms" />    
  245.               <RunRule RuleID="BasicMvcWithWebApiOrgAuthMultiOrgR" Option="WebAPI" />    
  246.               <RunRule RuleID="BasicMvcWithWebFormsOrgAuthMultiOrgR" Option="WebForms" />    
  247.               <RunRule RuleID="BasicMvcWithWebApiWebFormsOrgAuthMultiOrgR" Option="WebAPI,WebForms" />    
  248.               <RunRule RuleID="OrgAuthPackages"/>    
  249.               <RunRule RuleID="OrgAuthSSOAndMultiPackages"/>    
  250.               <RunRule RuleID="OrgAuthADReadPackages"/>    
  251.             </ApplyRules>    
  252.             <ApplyRules Option="OnPrem">    
  253.               <RunRule RuleID="MvcBasicOrgAuthFiles"/>    
  254.               <RunRule RuleID="MvcBasicOrgAuthOnPremFiles"/>    
  255.               <RunRule RuleID="BasicMvcWithWebApiOrgAuthOnPrem" Option="WebAPI" />    
  256.               <RunRule RuleID="BasicMvcWithWebFormsOrgAuthOnPrem" Option="WebForms" />    
  257.               <RunRule RuleID="BasicMvcWithWebApiWebFormsOrgAuthOnPrem" Option="WebAPI,WebForms" />    
  258.               <RunRule RuleID="OrgAuthPackages"/>    
  259.               <RunRule RuleID="OrgAuthOnPremPackages"/>    
  260.             </ApplyRules>    
  261.           </ApplyRules>    
  262.           <!-- This needs to run last since it applies an XDT and avoids the other rules replacing web.config -->    
  263.           <ApplyRules>    
  264.             <RunRule RuleID="CodeDomPackages" />    
  265.           </ApplyRules>    
  266.         </BaseTemplate>    
  267.         <BaseTemplate ID="Microsoft.WAP.CSharp.Spa.v5.0"    
  268.                       NugetPackageKey="WebFormsVS16"    
  269.                       VSTemplatePath="Spav5.0\Spa.cshtml.vstemplate">    
  270.             <ApplyRules>    
  271.                 <RunRule RuleID="SpaIndividualAuthPackages" />    
  272.             </ApplyRules>    
  273.             <ApplyRules>    
  274.                 <RunRule RuleID="global.WebForms" Option="WebForms" />    
  275.                 <RunRule RuleID="SpaWithWebForms" Option="WebForms" />    
  276.             </ApplyRules>    
  277.             <ApplyRules Option="IndividualAuth"/>    
  278.             <!-- This needs to run last since it applies an XDT and avoids the other rules replacing web.config -->    
  279.             <ApplyRules>    
  280.                 <RunRule RuleID="CodeDomPackages" />    
  281.             </ApplyRules>    
  282.         </BaseTemplate>    
  283.         <BaseTemplate ID="Microsoft.CSharp.MvcEmptyTestLibrary.v5.0"    
  284.                       NugetPackageKey="WebFormsVS16"    
  285.                       VSTemplatePath="MvcEmptyTestLibraryv5.0\MvcEmptyTestLibrary.cs.vstemplate">    
  286.         </BaseTemplate>    
  287.         <BaseTemplate ID="Microsoft.CSharp.MvcApplicationTestLibrary.v5.0"    
  288.                       NugetPackageKey="WebFormsVS16"    
  289.                       VSTemplatePath="MvcApplicationTestLibraryv5.0\MvcApplicationTestLibrary.cs.vstemplate">    
  290.         </BaseTemplate>    
  291.     </BaseTemplates>    
  292.     
  293.     <Rules>    
  294.         <Rule ID="MvcBasicCommonAuthFiles">    
  295.             <ReplaceFile Destination="Views\Shared\_Layout.cshtml" Source="MvcBasicApplicationv5.0\_AuthCommon\Views\Shared\_Layout.cshtml"/>    
  296.             <ReplaceFile Destination="Views\Shared\Error.cshtml" Source="MvcBasicApplicationv5.0\_AuthCommon\Views\Shared\Error.cshtml"/>    
  297.         </Rule>    
  298.         <Rule ID="MvcBasicIndividualAuthFiles">    
  299.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_IndividualAuth\web.config"/>    
  300.             <AddFile Destination="Startup.cs" Source="MvcBasicApplicationv5.0\_IndividualAuth\Startup.cs"/>    
  301.             <ReplaceFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_IndividualAuth\Global.asax.cs"/>    
  302.             <AddFile Destination="App_Start\IdentityConfig.cs" Source="MvcBasicApplicationv5.0\_IndividualAuth\App_Start\IdentityConfig.cs"/>    
  303.             <AddFile Destination="App_Start\Startup.Auth.cs" Source="MvcBasicApplicationv5.0\_IndividualAuth\App_Start\Startup.Auth.cs"/>    
  304.             <AddFile Destination="Controllers\AccountController.cs" Source="MvcBasicApplicationv5.0\_IndividualAuth\Controllers\AccountController.cs"/>    
  305.             <AddFile Destination="Controllers\ManageController.cs" Source="MvcBasicApplicationv5.0\_IndividualAuth\Controllers\ManageController.cs"/>    
  306.             <AddFile Destination="Models\AccountViewModels.cs" Source="MvcBasicApplicationv5.0\_IndividualAuth\Models\AccountViewModels.cs"/>    
  307.             <AddFile Destination="Models\IdentityModels.cs" Source="MvcBasicApplicationv5.0\_IndividualAuth\Models\IdentityModels.cs"/>    
  308.             <AddFile Destination="Models\ManageViewModels.cs" Source="MvcBasicApplicationv5.0\_IndividualAuth\Models\ManageViewModels.cs"/>    
  309.             <AddFile Destination="Views\Account\_ExternalLoginsListPartial.cshtml" Source="MvcBasicApplicationv5.0\_IndividualAuth\Views\Account\_ExternalLoginsListPartial.cshtml"/>    
  310.             <AddFile Destination="Views\Account\ConfirmEmail.cshtml" Source="MvcBasicApplicationv5.0\_IndividualAuth\Views\Account\ConfirmEmail.cshtml"/>    
  311.             <AddFile Destination="Views\Account\ExternalLoginConfirmation.cshtml" Source="MvcBasicApplicationv5.0\_IndividualAuth\Views\Account\ExternalLoginConfirmation.cshtml"/>    
  312.             <AddFile Destination="Views\Account\ExternalLoginFailure.cshtml" Source="MvcBasicApplicationv5.0\_IndividualAuth\Views\Account\ExternalLoginFailure.cshtml"/>    
  313.             <AddFile Destination="Views\Account\ForgotPassword.cshtml" Source="MvcBasicApplicationv5.0\_IndividualAuth\Views\Account\ForgotPassword.cshtml"/>    
  314.             <AddFile Destination="Views\Account\ForgotPasswordConfirmation.cshtml" Source="MvcBasicApplicationv5.0\_IndividualAuth\Views\Account\ForgotPasswordConfirmation.cshtml"/>    
  315.             <AddFile Destination="Views\Account\Login.cshtml" Source="MvcBasicApplicationv5.0\_IndividualAuth\Views\Account\Login.cshtml"/>    
  316.             <AddFile Destination="Views\Account\Register.cshtml" Source="MvcBasicApplicationv5.0\_IndividualAuth\Views\Account\Register.cshtml"/>    
  317.             <AddFile Destination="Views\Account\ResetPassword.cshtml" Source="MvcBasicApplicationv5.0\_IndividualAuth\Views\Account\ResetPassword.cshtml"/>    
  318.             <AddFile Destination="Views\Account\ResetPasswordConfirmation.cshtml" Source="MvcBasicApplicationv5.0\_IndividualAuth\Views\Account\ResetPasswordConfirmation.cshtml"/>    
  319.             <AddFile Destination="Views\Account\SendCode.cshtml" Source="MvcBasicApplicationv5.0\_IndividualAuth\Views\Account\SendCode.cshtml"/>    
  320.             <AddFile Destination="Views\Account\VerifyCode.cshtml" Source="MvcBasicApplicationv5.0\_IndividualAuth\Views\Account\VerifyCode.cshtml"/>    
  321.             <AddFile Destination="Views\Manage\AddPhoneNumber.cshtml" Source="MvcBasicApplicationv5.0\_IndividualAuth\Views\Manage\AddPhoneNumber.cshtml"/>    
  322.             <AddFile Destination="Views\Manage\ChangePassword.cshtml" Source="MvcBasicApplicationv5.0\_IndividualAuth\Views\Manage\ChangePassword.cshtml"/>    
  323.             <AddFile Destination="Views\Manage\Index.cshtml" Source="MvcBasicApplicationv5.0\_IndividualAuth\Views\Manage\Index.cshtml"/>    
  324.             <AddFile Destination="Views\Manage\ManageLogins.cshtml" Source="MvcBasicApplicationv5.0\_IndividualAuth\Views\Manage\ManageLogins.cshtml"/>    
  325.             <AddFile Destination="Views\Manage\SetPassword.cshtml" Source="MvcBasicApplicationv5.0\_IndividualAuth\Views\Manage\SetPassword.cshtml"/>    
  326.             <AddFile Destination="Views\Manage\VerifyPhoneNumber.cshtml" Source="MvcBasicApplicationv5.0\_IndividualAuth\Views\Manage\VerifyPhoneNumber.cshtml"/>    
  327.             <AddFile Destination="Views\Shared\Lockout.cshtml" Source="MvcBasicApplicationv5.0\_IndividualAuth\Views\Shared\Lockout.cshtml"/>    
  328.             <AddFile Destination="Views\Shared\_LoginPartial.cshtml" Source="MvcBasicApplicationv5.0\_IndividualAuth\Views\Shared\_LoginPartial.cshtml"/>    
  329.         </Rule>    
  330.         <Rule ID="MvcBasicWindowsAuthFiles">    
  331.             <ReplaceFile Destination="Views\Shared\_Layout.cshtml" Source="MvcBasicApplicationv5.0\_WindowsAuth\Views\Shared\_Layout.cshtml"/>    
  332.             <ReplaceFile Destination="Views\Shared\Error.cshtml" Source="MvcBasicApplicationv5.0\_WindowsAuth\Views\Shared\Error.cshtml"/>    
  333.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_WindowsAuth\web.config"/>    
  334.         </Rule>    
  335.         <Rule ID="MvcBasicOrgAuthFiles">    
  336.             <AddFile Destination="Startup.cs" Source="MvcBasicApplicationv5.0\_OrgAuth\_SSO\Startup.cs"/>    
  337.             <ReplaceFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_OrgAuth\Global.asax.cs"/>    
  338.             <ReplaceFile Destination="Controllers\HomeController.cs" Source="MvcBasicApplicationv5.0\_OrgAuth\Controllers\HomeController.cs"/>    
  339.             <AddFile Destination="Controllers\AccountController.cs" Source="MvcBasicApplicationv5.0\_OrgAuth\_SSO\Controllers\AccountController.cs"/>    
  340.             <AddFile Destination="Views\Shared\_LoginPartial.cshtml" Source="MvcBasicApplicationv5.0\_OrgAuth\_SSO\Views\Shared\_LoginPartial.cshtml"/>    
  341.             <AddFile Destination="Views\Account\SignOutCallback.cshtml" Source="MvcBasicApplicationv5.0\_OrgAuth\_SSO\Views\Account\SignOutCallback.cshtml"/>    
  342.         </Rule>    
  343.         <Rule ID="MvcBasicOrgAuthSSOFiles">    
  344.             <AddFile Destination="App_Start\Startup.Auth.cs" Source="MvcBasicApplicationv5.0\_OrgAuth\_SSO\App_Start\Startup.Auth.cs"/>    
  345.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_OrgAuth\_SSO\web.config"/>    
  346.         </Rule>    
  347.         <Rule ID="MvcBasicOrgAuthADSSOFiles">    
  348.             <ReplaceFile Destination="App_Start\Startup.Auth.cs" Source="MvcBasicApplicationv5.0\_OrgAuth\_Read\App_Start\_SSO\Startup.Auth.cs"/>    
  349.             <ReplaceFile Destination="Views\Shared\_LoginPartial.cshtml" Source="MvcBasicApplicationv5.0\_OrgAuth\_Read\Views\Shared\_SSO\_LoginPartial.cshtml"/>    
  350.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_OrgAuth\_Read\_SSO\web.config"/>    
  351.         </Rule>    
  352.         <Rule ID="MvcBasicOrgAuthADFiles">    
  353.             <AddFile Destination="Controllers\UserProfileController.cs" Source="MvcBasicApplicationv5.0\_OrgAuth\_Read\Controllers\UserProfileController.cs"/>    
  354.             <ReplaceFile Destination="Views\Shared\_Layout.cshtml" Source="MvcBasicApplicationv5.0\_OrgAuth\_Read\Views\Shared\_Layout.cshtml"/>    
  355.             <AddFile Destination="Views\UserProfile\Index.cshtml" Source="MvcBasicApplicationv5.0\_OrgAuth\_Read\Views\UserProfile\Index.cshtml"/>    
  356.             <AddFile Destination="Views\UserProfile\Relogin.cshtml" Source="MvcBasicApplicationv5.0\_OrgAuth\_Read\Views\UserProfile\Relogin.cshtml"/>    
  357.             <AddFile Destination="Models\AdalTokenCache.cs" Source="MvcBasicApplicationv5.0\_OrgAuth\_Read\Models\AdalTokenCache.cs"/>    
  358.             <AddFile Destination="Models\ApplicationDbContext.cs" Source="MvcBasicApplicationv5.0\_OrgAuth\_Read\Models\ApplicationDbContext.cs"/>    
  359.         </Rule>    
  360.         <Rule ID="MvcBasicOrgAuthMultiOrgFiles">    
  361.             <AddFile Destination="App_Start\Startup.Auth.cs" Source="MvcBasicApplicationv5.0\_OrgAuth\_MultiOrg\App_Start\Startup.Auth.cs"/>    
  362.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_OrgAuth\_MultiOrg\web.config"/>    
  363.         </Rule>    
  364.         <Rule ID="MvcBasicOrgAuthADMultiOrgFiles">    
  365.             <ReplaceFile Destination="App_Start\Startup.Auth.cs" Source="MvcBasicApplicationv5.0\_OrgAuth\_Read\App_Start\_MultiOrg\Startup.Auth.cs"/>    
  366.             <ReplaceFile Destination="Views\Shared\_LoginPartial.cshtml" Source="MvcBasicApplicationv5.0\_OrgAuth\_Read\Views\Shared\_MultiOrg\_LoginPartial.cshtml"/>    
  367.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_OrgAuth\_Read\_MultiOrg\web.config"/>    
  368.         </Rule>    
  369.         <Rule ID="MvcBasicOrgAuthOnPremFiles">    
  370.             <AddFile Destination="App_Start\Startup.Auth.cs" Source="MvcBasicApplicationv5.0\_OrgAuth\_OnPrem\App_Start\Startup.Auth.cs"/>    
  371.             <ReplaceFile Destination="Controllers\AccountController.cs" Source="MvcBasicApplicationv5.0\_OrgAuth\_OnPrem\Controllers\AccountController.cs"/>    
  372.             <ReplaceFile Destination="Views\Shared\_LoginPartial.cshtml" Source="MvcBasicApplicationv5.0\_OrgAuth\_OnPrem\Views\Shared\_LoginPartial.cshtml"/>    
  373.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_OrgAuth\_OnPrem\web.config"/>    
  374.         </Rule>    
  375.         <Rule ID="OrgAuthPackages">    
  376.             <AddReference Name="System.IdentityModel" />    
  377.             <AddReference Name="System.Runtime.Serialization" />    
  378.             <AddNugetPackages NugetPackageKey="WebFormsVS16" SkipAssemblyReferences="true" IsPreUnzipped="true">    
  379.                 <Package ID="Owin" Version="1.0">    
  380.                     <References>    
  381.                         <Reference Include="Owin" HintPath="$nugetpackagesfolder$Owin.1.0\lib\net40\Owin.dll"/>    
  382.                     </References>    
  383.                 </Package>    
  384.                 <Package ID="Microsoft.Owin" Version="3.1.0" MaxFrameworkVersion="4.5">    
  385.                     <References>    
  386.                         <Reference Include="Microsoft.Owin" HintPath="$nugetpackagesfolder$Microsoft.Owin.3.1.0\lib\net45\Microsoft.Owin.dll"/>    
  387.                     </References>    
  388.                 </Package>    
  389.                 <Package ID="Microsoft.Owin" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  390.                     <References>    
  391.                         <Reference Include="Microsoft.Owin" HintPath="$nugetpackagesfolder$Microsoft.Owin.4.0.0\lib\net451\Microsoft.Owin.dll"/>    
  392.                     </References>    
  393.                 </Package>    
  394.                 <Package ID="Microsoft.Owin.Host.SystemWeb" Version="3.1.0" MaxFrameworkVersion="4.5">    
  395.                     <References>    
  396.                         <Reference Include="Microsoft.Owin.Host.SystemWeb" HintPath="$nugetpackagesfolder$Microsoft.Owin.Host.SystemWeb.3.1.0\lib\net45\Microsoft.Owin.Host.SystemWeb.dll"/>    
  397.                     </References>    
  398.                 </Package>    
  399.                 <Package ID="Microsoft.Owin.Host.SystemWeb" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  400.                     <References>    
  401.                         <Reference Include="Microsoft.Owin.Host.SystemWeb" HintPath="$nugetpackagesfolder$Microsoft.Owin.Host.SystemWeb.4.0.0\lib\net451\Microsoft.Owin.Host.SystemWeb.dll"/>    
  402.                     </References>    
  403.                 </Package>    
  404.                 <Package ID="Microsoft.Owin.Security" Version="3.1.0" MaxFrameworkVersion="4.5">    
  405.                     <References>    
  406.                         <Reference Include="Microsoft.Owin.Security" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.3.1.0\lib\net45\Microsoft.Owin.Security.dll"/>    
  407.                     </References>    
  408.                 </Package>    
  409.                 <Package ID="Microsoft.Owin.Security" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  410.                     <References>    
  411.                         <Reference Include="Microsoft.Owin.Security" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.4.0.0\lib\net451\Microsoft.Owin.Security.dll"/>    
  412.                     </References>    
  413.                 </Package>    
  414.                 <Package ID="Microsoft.Owin.Security.Cookies" Version="3.1.0" MaxFrameworkVersion="4.5">    
  415.                     <References>    
  416.                         <Reference Include="Microsoft.Owin.Security.Cookies" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.Cookies.3.1.0\lib\net45\Microsoft.Owin.Security.Cookies.dll"/>    
  417.                     </References>    
  418.                 </Package>    
  419.                 <Package ID="Microsoft.Owin.Security.Cookies" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  420.                     <References>    
  421.                         <Reference Include="Microsoft.Owin.Security.Cookies" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.Cookies.4.0.0\lib\net451\Microsoft.Owin.Security.Cookies.dll"/>    
  422.                     </References>    
  423.                 </Package>    
  424.                 <Package ID="Microsoft.IdentityModel.Logging" Version="5.2.1" MinFrameworkVersion="4.5.1">    
  425.                     <References>    
  426.                         <Reference Include="Microsoft.IdentityModel.Logging" HintPath="$nugetpackagesfolder$Microsoft.IdentityModel.Logging.5.2.1\lib\net451\Microsoft.IdentityModel.Logging.dll"/>    
  427.                     </References>    
  428.                 </Package>    
  429.                 <Package ID="Microsoft.IdentityModel.Protocols" Version="5.2.1" MinFrameworkVersion="4.5.1">    
  430.                     <References>    
  431.                         <Reference Include="Microsoft.IdentityModel.Protocols" HintPath="$nugetpackagesfolder$Microsoft.IdentityModel.Protocols.5.2.1\lib\net451\Microsoft.IdentityModel.Protocols.dll"/>    
  432.                     </References>    
  433.                 </Package>    
  434.                 <Package ID="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="5.2.1" MinFrameworkVersion="4.5.1">    
  435.                     <References>    
  436.                         <Reference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" HintPath="$nugetpackagesfolder$Microsoft.IdentityModel.Protocols.OpenIdConnect.5.2.1\lib\net451\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll"/>    
  437.                     </References>    
  438.                 </Package>    
  439.                 <Package ID="Microsoft.IdentityModel.Tokens" Version="5.2.1" MinFrameworkVersion="4.5.1">    
  440.                     <References>    
  441.                         <Reference Include="Microsoft.IdentityModel.Tokens" HintPath="$nugetpackagesfolder$Microsoft.IdentityModel.Tokens.5.2.1\lib\net451\Microsoft.IdentityModel.Tokens.dll"/>    
  442.                     </References>    
  443.                 </Package>    
  444.                 <Package ID="System.IdentityModel.Tokens.Jwt" Version="4.0.4.403061554" MaxFrameworkVersion="4.5">    
  445.                     <References>    
  446.                         <Reference Include="System.IdentityModel.Tokens.Jwt" HintPath="$nugetpackagesfolder$System.IdentityModel.Tokens.Jwt.4.0.4.403061554\lib\net45\System.IdentityModel.Tokens.Jwt.dll"/>    
  447.                     </References>    
  448.                 </Package>    
  449.                 <Package ID="System.IdentityModel.Tokens.Jwt" Version="5.2.1" MinFrameworkVersion="4.5.1">    
  450.                     <References>    
  451.                         <Reference Include="System.IdentityModel.Tokens.Jwt" HintPath="$nugetpackagesfolder$System.IdentityModel.Tokens.Jwt.5.2.1\lib\net451\System.IdentityModel.Tokens.Jwt.dll"/>    
  452.                     </References>    
  453.                 </Package>    
  454.                 <Package ID="Microsoft.IdentityModel.Protocol.Extensions" Version="1.0.4.403061554">    
  455.                     <References>    
  456.                         <Reference Include="Microsoft.IdentityModel.Protocol.Extensions" HintPath="$nugetpackagesfolder$Microsoft.IdentityModel.Protocol.Extensions.1.0.4.403061554\lib\net45\Microsoft.IdentityModel.Protocol.Extensions.dll"/>    
  457.                     </References>    
  458.                 </Package>    
  459.     
  460.                    
  461.             </AddNugetPackages>    
  462.         </Rule>    
  463.         <Rule ID="OrgAuthSSOAndMultiPackages">    
  464.             <AddNugetPackages NugetPackageKey="WebFormsVS16" SkipAssemblyReferences="true" IsPreUnzipped="true">    
  465.                 <Package ID="Microsoft.Owin.Security.OpenIdConnect" Version="3.1.0" MaxFrameworkVersion="4.5">    
  466.                     <References>    
  467.                         <Reference Include="Microsoft.Owin.Security.OpenIdConnect" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.OpenIdConnect.3.1.0\lib\net45\Microsoft.Owin.Security.OpenIdConnect.dll"/>    
  468.                     </References>    
  469.                 </Package>    
  470.                 <Package ID="Microsoft.Owin.Security.OpenIdConnect" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  471.                     <References>    
  472.                         <Reference Include="Microsoft.Owin.Security.OpenIdConnect" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.OpenIdConnect.4.0.0\lib\net451\Microsoft.Owin.Security.OpenIdConnect.dll"/>    
  473.                     </References>    
  474.                 </Package>    
  475.             </AddNugetPackages>    
  476.         </Rule>    
  477.         <Rule ID="OrgAuthOnPremPackages">    
  478.             <AddNugetPackages NugetPackageKey="WebFormsVS16" SkipAssemblyReferences="true" IsPreUnzipped="true">    
  479.                 <Package ID="Microsoft.Owin.Security.WsFederation" Version="3.1.0" MaxFrameworkVersion="4.5">    
  480.                     <References>    
  481.                         <Reference Include="Microsoft.Owin.Security.WsFederation" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.WsFederation.3.1.0\lib\net45\Microsoft.Owin.Security.WsFederation.dll"/>    
  482.                     </References>    
  483.                 </Package>    
  484.                 <Package ID="Microsoft.Owin.Security.WsFederation" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  485.                     <References>    
  486.                         <Reference Include="Microsoft.Owin.Security.WsFederation" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.WsFederation.4.0.0\lib\net451\Microsoft.Owin.Security.WsFederation.dll"/>    
  487.                     </References>    
  488.                 </Package>    
  489.                 <Package ID="Microsoft.IdentityModel.Xml" Version="5.2.1" MinFrameworkVersion="4.5.1">    
  490.                     <References>    
  491.                         <Reference Include="Microsoft.IdentityModel.Xml" HintPath="$nugetpackagesfolder$Microsoft.IdentityModel.Xml.5.2.1\lib\net451\Microsoft.IdentityModel.Xml.dll"/>    
  492.                     </References>    
  493.                 </Package>    
  494.                 <Package ID="Microsoft.IdentityModel.Tokens.Saml" Version="5.2.1" MinFrameworkVersion="4.5.1">    
  495.                     <References>    
  496.                         <Reference Include="Microsoft.IdentityModel.Tokens.Saml" HintPath="$nugetpackagesfolder$Microsoft.IdentityModel.Tokens.Saml.5.2.1\lib\net451\Microsoft.IdentityModel.Tokens.Saml.dll"/>    
  497.                     </References>    
  498.                 </Package>    
  499.                 <Package ID="Microsoft.IdentityModel.Protocols.WsFederation" Version="5.2.1" MinFrameworkVersion="4.5.1">    
  500.                     <References>    
  501.                         <Reference Include="Microsoft.IdentityModel.Protocols.WsFederation" HintPath="$nugetpackagesfolder$Microsoft.IdentityModel.Protocols.WsFederation.5.2.1\lib\net451\Microsoft.IdentityModel.Protocols.WsFederation.dll"/>    
  502.                     </References>    
  503.                 </Package>    
  504.             </AddNugetPackages>    
  505.         </Rule>    
  506.         <Rule ID="OrgAuthADReadPackages">    
  507.             <AddNugetPackages NugetPackageKey="WebFormsVS16" SkipAssemblyReferences="true" IsPreUnzipped="true">    
  508.                 <Package ID="EntityFramework" Version="6.2.0">    
  509.                     <References>    
  510.                         <Reference Include="EntityFramework" HintPath="$nugetpackagesfolder$EntityFramework.6.2.0\lib\net45\EntityFramework.dll"/>    
  511.                         <Reference Include="EntityFramework.SqlServer" HintPath="$nugetpackagesfolder$EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll"/>    
  512.                     </References>    
  513.                 </Package>    
  514.                 <Package ID="Microsoft.Azure.ActiveDirectory.GraphClient" Version="2.1.1">    
  515.                     <References>    
  516.                         <Reference Include="Microsoft.Azure.ActiveDirectory.GraphClient" HintPath="$nugetpackagesfolder$Microsoft.Azure.ActiveDirectory.GraphClient.2.1.1\lib\portable-net4+sl5+win+wpa+wp8\Microsoft.Azure.ActiveDirectory.GraphClient.dll"/>    
  517.                     </References>    
  518.                 </Package>    
  519.                 <Package ID="Microsoft.Data.Edm" Version="5.8.3">    
  520.                     <References>    
  521.                         <Reference Include="Microsoft.Data.Edm" HintPath="$nugetpackagesfolder$Microsoft.Data.Edm.5.8.3\lib\net40\Microsoft.Data.Edm.dll"/>    
  522.                     </References>    
  523.                 </Package>    
  524.                 <Package ID="Microsoft.Data.OData" Version="5.8.3">    
  525.                     <References>    
  526.                         <Reference Include="Microsoft.Data.OData" HintPath="$nugetpackagesfolder$Microsoft.Data.OData.5.8.3\lib\net40\Microsoft.Data.OData.dll"/>    
  527.                     </References>    
  528.                 </Package>    
  529.                 <Package ID="Microsoft.Data.Services.Client" Version="5.8.3">    
  530.                     <References>    
  531.                         <Reference Include="Microsoft.Data.Services.Client" HintPath="$nugetpackagesfolder$Microsoft.Data.Services.Client.5.8.3\lib\net40\Microsoft.Data.Services.Client.dll"/>    
  532.                     </References>    
  533.                 </Package>    
  534.                 <Package ID="System.Spatial" Version="5.8.3">    
  535.                     <References>    
  536.                         <Reference Include="System.Spatial" HintPath="$nugetpackagesfolder$System.Spatial.5.8.3\lib\net40\System.Spatial.dll"/>    
  537.                     </References>    
  538.                 </Package>    
  539.                 <Package ID="Microsoft.IdentityModel.Clients.ActiveDirectory" Version="3.19.2" >    
  540.                     <References>    
  541.                         <Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory" HintPath="$nugetpackagesfolder$Microsoft.IdentityModel.Clients.ActiveDirectory.3.19.2\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll"/>    
  542.                     </References>    
  543.                 </Package>    
  544.             </AddNugetPackages>    
  545.         </Rule>    
  546.         <Rule ID="IndividualAuthPackages">    
  547.             <AddNugetPackages NugetPackageKey="WebFormsVS16" SkipAssemblyReferences="true" IsPreUnzipped="true">    
  548.                 <Package ID="EntityFramework" Version="6.2.0">    
  549.                     <References>    
  550.                         <Reference Include="EntityFramework" HintPath="$nugetpackagesfolder$EntityFramework.6.2.0\lib\net45\EntityFramework.dll"/>    
  551.                         <Reference Include="EntityFramework.SqlServer" HintPath="$nugetpackagesfolder$EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll"/>    
  552.                     </References>    
  553.                 </Package>    
  554.                 <Package ID="Microsoft.AspNet.Identity.Core" Version="2.2.2">    
  555.                     <References>    
  556.                         <Reference Include="Microsoft.AspNet.Identity.Core" HintPath="$nugetpackagesfolder$Microsoft.AspNet.Identity.Core.2.2.2\lib\net45\Microsoft.AspNet.Identity.Core.dll"/>    
  557.                     </References>    
  558.                 </Package>    
  559.                 <Package ID="Microsoft.AspNet.Identity.Owin" Version="2.2.2">    
  560.                     <References>    
  561.                         <Reference Include="Microsoft.AspNet.Identity.Owin" HintPath="$nugetpackagesfolder$Microsoft.AspNet.Identity.Owin.2.2.2\lib\net45\Microsoft.AspNet.Identity.Owin.dll"/>    
  562.                     </References>    
  563.                 </Package>    
  564.                 <Package ID="Microsoft.AspNet.Identity.EntityFramework" Version="2.2.2">    
  565.                     <References>    
  566.                         <Reference Include="Microsoft.AspNet.Identity.EntityFramework" HintPath="$nugetpackagesfolder$Microsoft.AspNet.Identity.EntityFramework.2.2.2\lib\net45\Microsoft.AspNet.Identity.EntityFramework.dll" />    
  567.                     </References>    
  568.                 </Package>    
  569.                 <Package ID="Owin" Version="1.0">    
  570.                     <References>    
  571.                         <Reference Include="Owin" HintPath="$nugetpackagesfolder$Owin.1.0\lib\net40\Owin.dll"/>    
  572.                     </References>    
  573.                 </Package>    
  574.                 <Package ID="Microsoft.Owin" Version="3.1.0" MaxFrameworkVersion="4.5">    
  575.                     <References>    
  576.                         <Reference Include="Microsoft.Owin" HintPath="$nugetpackagesfolder$Microsoft.Owin.3.1.0\lib\net45\Microsoft.Owin.dll"/>    
  577.                     </References>    
  578.                 </Package>    
  579.                 <Package ID="Microsoft.Owin" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  580.                     <References>    
  581.                         <Reference Include="Microsoft.Owin" HintPath="$nugetpackagesfolder$Microsoft.Owin.4.0.0\lib\net451\Microsoft.Owin.dll"/>    
  582.                     </References>    
  583.                 </Package>    
  584.                 <Package ID="Microsoft.Owin.Host.SystemWeb" Version="3.1.0" MaxFrameworkVersion="4.5">    
  585.                     <References>    
  586.                         <Reference Include="Microsoft.Owin.Host.SystemWeb" HintPath="$nugetpackagesfolder$Microsoft.Owin.Host.SystemWeb.3.1.0\lib\net45\Microsoft.Owin.Host.SystemWeb.dll"/>    
  587.                     </References>    
  588.                 </Package>    
  589.                 <Package ID="Microsoft.Owin.Host.SystemWeb" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  590.                     <References>    
  591.                         <Reference Include="Microsoft.Owin.Host.SystemWeb" HintPath="$nugetpackagesfolder$Microsoft.Owin.Host.SystemWeb.4.0.0\lib\net451\Microsoft.Owin.Host.SystemWeb.dll"/>    
  592.                     </References>    
  593.                 </Package>    
  594.                 <Package ID="Microsoft.Owin.Security" Version="3.1.0" MaxFrameworkVersion="4.5">    
  595.                     <References>    
  596.                         <Reference Include="Microsoft.Owin.Security" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.3.1.0\lib\net45\Microsoft.Owin.Security.dll"/>    
  597.                     </References>    
  598.                 </Package>    
  599.                 <Package ID="Microsoft.Owin.Security" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  600.                     <References>    
  601.                         <Reference Include="Microsoft.Owin.Security" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.4.0.0\lib\net451\Microsoft.Owin.Security.dll"/>    
  602.                     </References>    
  603.                 </Package>    
  604.                 <Package ID="Microsoft.Owin.Security.Facebook" Version="3.1.0" MaxFrameworkVersion="4.5">    
  605.                     <References>    
  606.                         <Reference Include="Microsoft.Owin.Security.Facebook" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.Facebook.3.1.0\lib\net45\Microsoft.Owin.Security.Facebook.dll"/>    
  607.                     </References>    
  608.                 </Package>    
  609.                 <Package ID="Microsoft.Owin.Security.Facebook" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  610.                     <References>    
  611.                         <Reference Include="Microsoft.Owin.Security.Cookies" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.Facebook.4.0.0\lib\net451\Microsoft.Owin.Security.Facebook.dll"/>    
  612.                     </References>    
  613.                 </Package>    
  614.                 <Package ID="Microsoft.Owin.Security.Cookies" Version="3.1.0" MaxFrameworkVersion="4.5">    
  615.                     <References>    
  616.                         <Reference Include="Microsoft.Owin.Security.Cookies" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.Cookies.3.1.0\lib\net45\Microsoft.Owin.Security.Cookies.dll"/>    
  617.                     </References>    
  618.                 </Package>    
  619.                 <Package ID="Microsoft.Owin.Security.Cookies" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  620.                     <References>    
  621.                         <Reference Include="Microsoft.Owin.Security.Cookies" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.Cookies.4.0.0\lib\net451\Microsoft.Owin.Security.Cookies.dll"/>    
  622.                     </References>    
  623.                 </Package>    
  624.                 <Package ID="Microsoft.Owin.Security.Google" Version="3.1.0" MaxFrameworkVersion="4.5">    
  625.                     <References>    
  626.                         <Reference Include="Microsoft.Owin.Security.Google" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.Google.3.1.0\lib\net45\Microsoft.Owin.Security.Google.dll"/>    
  627.                     </References>    
  628.                 </Package>    
  629.                 <Package ID="Microsoft.Owin.Security.Google" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  630.                     <References>    
  631.                         <Reference Include="Microsoft.Owin.Security.Google" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.Google.4.0.0\lib\net451\Microsoft.Owin.Security.Google.dll"/>    
  632.                     </References>    
  633.                 </Package>    
  634.                 <Package ID="Microsoft.Owin.Security.Twitter" Version="3.1.0" MaxFrameworkVersion="4.5">    
  635.                     <References>    
  636.                         <Reference Include="Microsoft.Owin.Security.Twitter" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.Twitter.3.1.0\lib\net45\Microsoft.Owin.Security.Twitter.dll"/>    
  637.                     </References>    
  638.                 </Package>    
  639.                 <Package ID="Microsoft.Owin.Security.Twitter" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  640.                     <References>    
  641.                         <Reference Include="Microsoft.Owin.Security.Twitter" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.Twitter.4.0.0\lib\net451\Microsoft.Owin.Security.Twitter.dll"/>    
  642.                     </References>    
  643.                 </Package>    
  644.                 <Package ID="Microsoft.Owin.Security.MicrosoftAccount" Version="3.1.0" MaxFrameworkVersion="4.5">    
  645.                     <References>    
  646.                         <Reference Include="Microsoft.Owin.Security.MicrosoftAccount" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.MicrosoftAccount.3.1.0\lib\net45\Microsoft.Owin.Security.MicrosoftAccount.dll"/>    
  647.                     </References>    
  648.                 </Package>    
  649.                 <Package ID="Microsoft.Owin.Security.MicrosoftAccount" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  650.                     <References>    
  651.                         <Reference Include="Microsoft.Owin.Security.MicrosoftAccount" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.MicrosoftAccount.4.0.0\lib\net451\Microsoft.Owin.Security.MicrosoftAccount.dll"/>    
  652.                     </References>    
  653.                 </Package>    
  654.                 <Package ID="Microsoft.Owin.Security.OAuth" Version="3.1.0" MaxFrameworkVersion="4.5">    
  655.                     <References>    
  656.                         <Reference Include="Microsoft.Owin.Security.OAuth" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.OAuth.3.1.0\lib\net45\Microsoft.Owin.Security.OAuth.dll"/>    
  657.                     </References>    
  658.                 </Package>    
  659.                 <Package ID="Microsoft.Owin.Security.OAuth" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  660.                     <References>    
  661.                         <Reference Include="Microsoft.Owin.Security.OAuth" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.OAuth.4.0.0\lib\net451\Microsoft.Owin.Security.OAuth.dll"/>    
  662.                     </References>    
  663.                 </Package>    
  664.                    
  665.             </AddNugetPackages>    
  666.         </Rule>    
  667.     
  668.         <!-- Spa Packages not definied in vstemplate file-->    
  669.         <Rule ID="SpaIndividualAuthPackages">    
  670.             <AddNugetPackages NugetPackageKey="WebFormsVS16" SkipAssemblyReferences="true" IsPreUnzipped="true">    
  671.                 <Package ID="Microsoft.Owin" Version="3.1.0" MaxFrameworkVersion="4.5">    
  672.                     <References>    
  673.                         <Reference Include="Microsoft.Owin" HintPath="$nugetpackagesfolder$Microsoft.Owin.3.1.0\lib\net45\Microsoft.Owin.dll"/>    
  674.                     </References>    
  675.                 </Package>    
  676.                 <Package ID="Microsoft.Owin" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  677.                     <References>    
  678.                         <Reference Include="Microsoft.Owin" HintPath="$nugetpackagesfolder$Microsoft.Owin.4.0.0\lib\net451\Microsoft.Owin.dll"/>    
  679.                     </References>    
  680.                 </Package>    
  681.                 <Package ID="Microsoft.Owin.Host.SystemWeb" Version="3.1.0" MaxFrameworkVersion="4.5">    
  682.                     <References>    
  683.                         <Reference Include="Microsoft.Owin.Host.SystemWeb" HintPath="$nugetpackagesfolder$Microsoft.Owin.Host.SystemWeb.3.1.0\lib\net45\Microsoft.Owin.Host.SystemWeb.dll"/>    
  684.                     </References>    
  685.                 </Package>    
  686.                 <Package ID="Microsoft.Owin.Host.SystemWeb" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  687.                     <References>    
  688.                         <Reference Include="Microsoft.Owin.Host.SystemWeb" HintPath="$nugetpackagesfolder$Microsoft.Owin.Host.SystemWeb.4.0.0\lib\net451\Microsoft.Owin.Host.SystemWeb.dll"/>    
  689.                     </References>    
  690.                 </Package>    
  691.                 <Package ID="Microsoft.Owin.Security" Version="3.1.0" MaxFrameworkVersion="4.5">    
  692.                     <References>    
  693.                         <Reference Include="Microsoft.Owin.Security" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.3.1.0\lib\net45\Microsoft.Owin.Security.dll"/>    
  694.                     </References>    
  695.                 </Package>    
  696.                 <Package ID="Microsoft.Owin.Security" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  697.                     <References>    
  698.                         <Reference Include="Microsoft.Owin.Security" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.4.0.0\lib\net451\Microsoft.Owin.Security.dll"/>    
  699.                     </References>    
  700.                 </Package>    
  701.                 <Package ID="Microsoft.Owin.Security.Facebook" Version="3.1.0" MaxFrameworkVersion="4.5">    
  702.                     <References>    
  703.                         <Reference Include="Microsoft.Owin.Security.Facebook" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.Facebook.3.1.0\lib\net45\Microsoft.Owin.Security.Facebook.dll"/>    
  704.                     </References>    
  705.                 </Package>    
  706.                 <Package ID="Microsoft.Owin.Security.Facebook" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  707.                     <References>    
  708.                         <Reference Include="Microsoft.Owin.Security.Cookies" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.Facebook.4.0.0\lib\net451\Microsoft.Owin.Security.Facebook.dll"/>    
  709.                     </References>    
  710.                 </Package>    
  711.                 <Package ID="Microsoft.Owin.Security.Cookies" Version="3.1.0" MaxFrameworkVersion="4.5">    
  712.                     <References>    
  713.                         <Reference Include="Microsoft.Owin.Security.Cookies" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.Cookies.3.1.0\lib\net45\Microsoft.Owin.Security.Cookies.dll"/>    
  714.                     </References>    
  715.                 </Package>    
  716.                 <Package ID="Microsoft.Owin.Security.Cookies" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  717.                     <References>    
  718.                         <Reference Include="Microsoft.Owin.Security.Cookies" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.Cookies.4.0.0\lib\net451\Microsoft.Owin.Security.Cookies.dll"/>    
  719.                     </References>    
  720.                 </Package>    
  721.                 <Package ID="Microsoft.Owin.Security.Google" Version="3.1.0" MaxFrameworkVersion="4.5">    
  722.                     <References>    
  723.                         <Reference Include="Microsoft.Owin.Security.Google" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.Google.3.1.0\lib\net45\Microsoft.Owin.Security.Google.dll"/>    
  724.                     </References>    
  725.                 </Package>    
  726.                 <Package ID="Microsoft.Owin.Security.Google" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  727.                     <References>    
  728.                         <Reference Include="Microsoft.Owin.Security.Google" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.Google.4.0.0\lib\net451\Microsoft.Owin.Security.Google.dll"/>    
  729.                     </References>    
  730.                 </Package>    
  731.                 <Package ID="Microsoft.Owin.Security.Twitter" Version="3.1.0" MaxFrameworkVersion="4.5">    
  732.                     <References>    
  733.                         <Reference Include="Microsoft.Owin.Security.Twitter" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.Twitter.3.1.0\lib\net45\Microsoft.Owin.Security.Twitter.dll"/>    
  734.                     </References>    
  735.                 </Package>    
  736.                 <Package ID="Microsoft.Owin.Security.Twitter" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  737.                     <References>    
  738.                         <Reference Include="Microsoft.Owin.Security.Twitter" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.Twitter.4.0.0\lib\net451\Microsoft.Owin.Security.Twitter.dll"/>    
  739.                     </References>    
  740.                 </Package>    
  741.                 <Package ID="Microsoft.Owin.Security.MicrosoftAccount" Version="3.1.0" MaxFrameworkVersion="4.5">    
  742.                     <References>    
  743.                         <Reference Include="Microsoft.Owin.Security.MicrosoftAccount" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.MicrosoftAccount.3.1.0\lib\net45\Microsoft.Owin.Security.MicrosoftAccount.dll"/>    
  744.                     </References>    
  745.                 </Package>    
  746.                 <Package ID="Microsoft.Owin.Security.MicrosoftAccount" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  747.                     <References>    
  748.                         <Reference Include="Microsoft.Owin.Security.MicrosoftAccount" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.MicrosoftAccount.4.0.0\lib\net451\Microsoft.Owin.Security.MicrosoftAccount.dll"/>    
  749.                     </References>    
  750.                 </Package>    
  751.                 <Package ID="Microsoft.Owin.Security.OAuth" Version="3.1.0" MaxFrameworkVersion="4.5">    
  752.                     <References>    
  753.                         <Reference Include="Microsoft.Owin.Security.OAuth" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.OAuth.3.1.0\lib\net45\Microsoft.Owin.Security.OAuth.dll"/>    
  754.                     </References>    
  755.                 </Package>    
  756.                 <Package ID="Microsoft.Owin.Security.OAuth" Version="4.0.0" MinFrameworkVersion="4.5.1">    
  757.                     <References>    
  758.                         <Reference Include="Microsoft.Owin.Security.OAuth" HintPath="$nugetpackagesfolder$Microsoft.Owin.Security.OAuth.4.0.0\lib\net451\Microsoft.Owin.Security.OAuth.dll"/>    
  759.                     </References>    
  760.                 </Package>    
  761.                    
  762.             </AddNugetPackages>    
  763.         </Rule>    
  764.     
  765.     
  766.         <!-- Basic MVC No Auth Conflict Resolution -->    
  767.         <Rule ID="BasicMvcWithWebApi">    
  768.             <ReplaceFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_WebApi\Global.asax.cs"/>    
  769.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_WebApi\web.config"/>    
  770.         </Rule>    
  771.         <Rule ID="BasicMvcWithWebForms">    
  772.             <ReplaceFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_WebForms\Global.asax.cs"/>    
  773.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_WebForms\web.config"/>    
  774.         </Rule>    
  775.         <Rule ID="BasicMvcWithWebApiWebForms">    
  776.             <ReplaceFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_WebApiWebForms\Global.asax.cs"/>    
  777.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_WebApi\web.config"/>    
  778.         </Rule>    
  779.     
  780.         <!-- Basic MVC Windows Auth Conflict Resolution -->    
  781.         <Rule ID="BasicMvcWithWebApiWindowsAuth">    
  782.             <ReplaceFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_WebApi\Global.asax.cs"/>    
  783.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_WebApi\_WindowsAuth\web.config"/>    
  784.         </Rule>    
  785.         <Rule ID="BasicMvcWithWebFormsWindowsAuth">    
  786.             <ReplaceFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_WebForms\Global.asax.cs"/>    
  787.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_WindowsAuth\web.config"/>    
  788.         </Rule>    
  789.         <Rule ID="BasicMvcWithWebApiWebFormsWindowsAuth">    
  790.             <ReplaceFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_WebApiWebForms\Global.asax.cs"/>    
  791.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_WebApi\_WindowsAuth\web.config"/>    
  792.         </Rule>    
  793.     
  794.         <!-- Basic MVC Individual Auth Conflict Resolution -->    
  795.         <Rule ID="BasicMvcWithWebApiIndividualAuth">    
  796.             <ReplaceFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_WebApi\_IndividualAuth\Global.asax.cs"/>    
  797.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_WebApi\_IndividualAuth\web.config"/>    
  798.         </Rule>    
  799.         <Rule ID="BasicMvcWithWebFormsIndividualAuth">    
  800.             <ReplaceFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_WebForms\_IndividualAuth\Global.asax.cs"/>    
  801.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_IndividualAuth\web.config"/>    
  802.         </Rule>    
  803.         <Rule ID="BasicMvcWithWebApiWebFormsIndividualAuth">    
  804.             <ReplaceFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_WebApiWebForms\_IndividualAuth\Global.asax.cs"/>    
  805.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_WebApi\_IndividualAuth\web.config"/>    
  806.         </Rule>    
  807.     
  808.         <!-- Basic MVC Org Auth SSO Conflict Resolution -->    
  809.         <Rule ID="BasicMvcWithWebApiOrgAuthSSO">    
  810.             <ReplaceFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_WebApi\_OrgAuth\Global.asax.cs"/>    
  811.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_WebApi\_OrgAuth\_SSO\web.config"/>    
  812.         </Rule>    
  813.         <Rule ID="BasicMvcWithWebFormsOrgAuthSSO">    
  814.             <ReplaceFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_WebForms\_OrgAuth\Global.asax.cs"/>    
  815.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_OrgAuth\_SSO\web.config"/>    
  816.         </Rule>    
  817.         <Rule ID="BasicMvcWithWebApiWebFormsOrgAuthSSO">    
  818.             <ReplaceFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_WebApi\_OrgAuth\Global.asax.cs"/>    
  819.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_WebApi\_OrgAuth\_SSO\web.config"/>    
  820.         </Rule>    
  821.             
  822.         <!-- Basic MVC Org Auth SSOR Conflict Resolution -->    
  823.         <Rule ID="BasicMvcWithWebApiOrgAuthSSOR">    
  824.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_WebApi\_OrgAuth\_Read\_SSO\web.config"/>    
  825.         </Rule>    
  826.         <Rule ID="BasicMvcWithWebFormsOrgAuthSSOR">    
  827.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_OrgAuth\_Read\_SSO\web.config"/>    
  828.         </Rule>    
  829.         <Rule ID="BasicMvcWithWebApiWebFormsOrgAuthSSOR">    
  830.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_WebApi\_OrgAuth\_Read\_SSO\web.config"/>    
  831.         </Rule>            
  832.     
  833.         <!-- Basic MVC Org Auth OnPrem Conflict Resolution -->    
  834.         <Rule ID="BasicMvcWithWebApiOrgAuthOnPrem">    
  835.             <ReplaceFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_WebApi\_OrgAuth\Global.asax.cs"/>    
  836.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_WebApi\_OrgAuth\_OnPrem\web.config"/>    
  837.         </Rule>    
  838.         <Rule ID="BasicMvcWithWebFormsOrgAuthOnPrem">    
  839.             <ReplaceFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_WebForms\_OrgAuth\Global.asax.cs"/>    
  840.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_OrgAuth\_OnPrem\web.config"/>    
  841.         </Rule>    
  842.         <Rule ID="BasicMvcWithWebApiWebFormsOrgAuthOnPrem">    
  843.             <ReplaceFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_WebApi\_OrgAuth\Global.asax.cs"/>    
  844.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_WebApi\_OrgAuth\_OnPrem\web.config"/>    
  845.         </Rule>    
  846.     
  847.         <!-- Basic MVC Org Auth MultiOrg Conflict Resolution -->    
  848.         <Rule ID="BasicMvcWithWebApiOrgAuthMultiOrg">    
  849.             <ReplaceFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_WebApi\_OrgAuth\Global.asax.cs"/>    
  850.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_WebApi\_OrgAuth\_MultiOrg\web.config"/>    
  851.         </Rule>    
  852.         <Rule ID="BasicMvcWithWebFormsOrgAuthMultiOrg">    
  853.             <ReplaceFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_WebForms\_OrgAuth\Global.asax.cs"/>    
  854.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_OrgAuth\_MultiOrg\web.config"/>    
  855.         </Rule>    
  856.         <Rule ID="BasicMvcWithWebApiWebFormsOrgAuthMultiOrg">    
  857.             <ReplaceFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_WebApi\_OrgAuth\Global.asax.cs"/>    
  858.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_WebApi\_OrgAuth\_MultiOrg\web.config"/>    
  859.         </Rule>    
  860.             
  861.         <!-- Basic MVC Org Auth MultiOrgR Conflict Resolution -->    
  862.         <Rule ID="BasicMvcWithWebApiOrgAuthMultiOrgR">    
  863.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_WebApi\_OrgAuth\_Read\_MultiOrg\web.config"/>    
  864.         </Rule>    
  865.         <Rule ID="BasicMvcWithWebFormsOrgAuthMultiOrgR">    
  866.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_OrgAuth\_Read\_MultiOrg\web.config"/>    
  867.         </Rule>    
  868.         <Rule ID="BasicMvcWithWebApiWebFormsOrgAuthMultiOrgR">    
  869.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_WebApi\_OrgAuth\_Read\_MultiOrg\web.config"/>    
  870.         </Rule>         
  871.     
  872.         <!-- Spa Individual Auth Conflict Resolution -->    
  873.         <Rule ID="SpaWithWebForms">    
  874.             <ReplaceFile Destination="Global.asax.cs" Source="Spav5.0\_WebForms\Global.asax.cs"/>    
  875.             <ReplaceFile Destination="web.config" Source="Spav5.0\_WebForms\web.config"/>    
  876.         </Rule>    
  877.     
  878.         <Rule ID="MVC">    
  879.             <AddFolder Name="App_Data"/>    
  880.             <AddFolder Name="App_Start"/>    
  881.             <AddFolder Name="Controllers"/>    
  882.             <AddFolder Name="Models"/>    
  883.             <AddFolder Name="Views"/>    
  884.             <AddFile Destination="Global.asax.cs" Source="MvcBasicApplicationv5.0\_Empty\Global.asax.cs"/>    
  885.             <AddFile Destination="Global.asax" Source="MvcBasicApplicationv5.0\_Empty\Global.cs.asax"/>    
  886.             <ReplaceFile Destination="web.config" Source="MvcBasicApplicationv5.0\_Empty\web.config"/>    
  887.             <AddFile Destination="App_Start\RouteConfig.cs" Source="MvcBasicApplicationv5.0\App_Start\RouteConfig.cs"/>    
  888.             <AddFile Destination="Views\web.config" Source="MvcBasicApplicationv5.0\_Empty\Views\web.config"/>    
  889.             <AddNugetPackages NugetPackageKey="WebFormsVS16" SkipAssemblyReferences="true" IsPreUnzipped="true">    
  890.                 <Package ID="Microsoft.AspNet.Razor" Version="3.2.7">    
  891.                     <References>    
  892.                         <Reference Include="System.Web.Razor" HintPath="$nugetpackagesfolder$Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll"/>    
  893.                     </References>    
  894.                 </Package>    
  895.                 <Package ID="Microsoft.AspNet.Webpages" Version="3.2.7">    
  896.                     <References>    
  897.                         <Reference Include="System.Web.Webpages" HintPath="$nugetpackagesfolder$Microsoft.AspNet.Webpages.3.2.7\lib\net45\System.Web.Webpages.dll"/>    
  898.                         <Reference Include="System.Web.Webpages.Deployment" HintPath="$nugetpackagesfolder$Microsoft.AspNet.Webpages.3.2.7\lib\net45\System.Web.Webpages.Deployment.dll"/>    
  899.                         <Reference Include="System.Web.Webpages.Razor" HintPath="$nugetpackagesfolder$Microsoft.AspNet.Webpages.3.2.7\lib\net45\System.Web.Webpages.Razor.dll"/>    
  900.                         <Reference Include="System.Web.Helpers" HintPath="$nugetpackagesfolder$Microsoft.AspNet.Webpages.3.2.7\lib\net45\System.Web.Helpers.dll"/>    
  901.                     </References>    
  902.                 </Package>    
  903.                 <Package ID="Microsoft.web.Infrastructure" Version="1.0.0.0">    
  904.                     <References>    
  905.                         <Reference Include="Microsoft.Web.Infrastructure" HintPath="$nugetpackagesfolder$Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll"/>    
  906.                     </References>    
  907.                 </Package>    
  908.                 <Package ID="Microsoft.AspNet.Mvc" Version="5.2.7">    
  909.                     <References>    
  910.                         <Reference Include="System.Web.Mvc" HintPath="$nugetpackagesfolder$Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll"/>    
  911.                     </References>    
  912.                 </Package>    
  913.                    
  914.             </AddNugetPackages>    
  915.         </Rule>    
  916.         <Rule ID="CodeDomPackages">    
  917.             <AddNugetPackages NugetPackageKey="WebFormsVS16" SkipAssemblyReferences="true" IsPreUnzipped="true">    
  918.                 <Package ID="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" Version="2.0.0" MinFrameworkVersion="4.5">    
  919.                   <References>    
  920.                     <Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" HintPath="$nugetpackagesfolder$Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll"/>    
  921.                   </References>    
  922.                 </Package>                    
  923.             </AddNugetPackages>    
  924.         </Rule>    
  925.     </Rules>    
  926. </TemplateDefinition>    
We have completed the changes in the “Templates.xml” file. Please make sure you have added “Mvc-entity.png” file inside the folder.
 

Create an MVC Project with a new template

 
Let us now create a new project using “ASP.NET Web Application (.NET Framework)” template.
 
Easily Create A Custom Project Template For MVC With Entity Framework
 
Give a valid name to the project and choose the correct folder to save. You can see the newly added project template now.
 
Easily Create A Custom Project Template For MVC With Entity Framework
 
You can click the “Create” button to create a new project.
 
Our new MVC project with the EntityFramework library is created now.
 
You can see the EntityFramework library in the Installed section of NuGet Package Manager also.
 
Easily Create A Custom Project Template For MVC With Entity Framework
 

Conclusion

 
There are various methods to add a new project template to Visual Studio. We have used the simplest way. We have added a new project template folder into the installed template location of Visual Studio and added a new Entity Framework package reference in Visual Studio template file. We have also modified the “Templates.xml” file with new “Template” and “BaseTemplate” section. Please make sure you have taken a backup of the existing template folder before making any changes. Please try it on your machine and send me your valuable feedback.


Similar Articles