Click here to Skip to main content
15,896,359 members
Articles / Security

Manage security and redirection for non authorized access in MVC

Rate me:
Please Sign up or sign in to vote.
4.50/5 (7 votes)
18 Jul 2012CPOL2 min read 56.6K   1.4K   26  
How to apply security and redirection to a view when a user cannot access a controller or a controller action in MVC
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>
    </ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{2FB0DA32-C689-4526-8BC9-7B91CBCA871B}</ProjectGuid>
    <ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>MvcSecurityApplication</RootNamespace>
    <AssemblyName>MvcSecurityApplication</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <MvcBuildViews>false</MvcBuildViews>
    <UseIISExpress>true</UseIISExpress>
    <SccProjectName>SAK</SccProjectName>
    <SccLocalPath>SAK</SccLocalPath>
    <SccAuxPath>SAK</SccAuxPath>
    <SccProvider>SAK</SccProvider>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="MvcSiteMapProvider, Version=3.2.1.0, Culture=neutral, PublicKeyToken=1923abe4657913cc, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\BinEx\MvcSiteMapProvider.3.2.1.0\lib\net40\MvcSiteMapProvider.dll</HintPath>
    </Reference>
    <Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\BinEx\SqlServerCompact.4.0.8852.1\lib\net40\System.Data.SqlServerCe.dll</HintPath>
    </Reference>
    <Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\BinEx\SqlServerCompact.4.0.8852.1\lib\net40\System.Data.SqlServerCe.Entity.dll</HintPath>
    </Reference>
    <Reference Include="System.Web.WebPages" />
    <Reference Include="System.Web.Helpers" />
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Web.DynamicData" />
    <Reference Include="System.Web.Entity" />
    <Reference Include="System.Web.ApplicationServices" />
    <Reference Include="System.ComponentModel.DataAnnotations" />
    <Reference Include="System.Core" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Web" />
    <Reference Include="System.Web.Extensions" />
    <Reference Include="System.Web.Abstractions" />
    <Reference Include="System.Web.Routing" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Configuration" />
    <Reference Include="System.Web.Services" />
    <Reference Include="System.EnterpriseServices" />
    <Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
    <Reference Include="Telerik.Web.Mvc, Version=2011.3.1115.340, Culture=neutral, PublicKeyToken=121fae78165ba3d4, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\BinEx\Telerik\Telerik.Web.Mvc.dll</HintPath>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Areas\Area1\Area1AreaRegistration.cs" />
    <Compile Include="Areas\Area1\Controllers\ManagerController.cs" />
    <Compile Include="Areas\Area2\Area2AreaRegistration.cs" />
    <Compile Include="Areas\Area2\Controllers\SecurityController.cs" />
    <Compile Include="Controllers\RoleController.cs" />
    <Compile Include="Controllers\UserController.cs" />
    <Compile Include="Helpers\HtmlHelpers.cs" />
    <Compile Include="Tools\Converters\RoleConverters.cs" />
    <Compile Include="Tools\SecurityInitializer.cs" />
    <Compile Include="Helpers\SecurityHelper.cs" />
    <Compile Include="Tools\Security\HttpUnauthorizedWithRedirectToResultBase.cs" />
    <Compile Include="Tools\Security\HttpUnauthorizedWithRedirectToResultFactory.cs" />
    <Compile Include="Tools\Security\HttpUnauthorizedWithRedirectToViewResult.cs" />
    <Compile Include="Tools\SqlCeMembership\SqlCeMembershipProvider.cs" />
    <Compile Include="Tools\SqlCeMembership\SqlCeMembershipUtils.cs" />
    <Compile Include="Tools\SqlCeMembership\SqlCeProfileProvider.cs" />
    <Compile Include="Tools\SqlCeMembership\SqlCeRoleProvider.cs" />
    <Compile Include="Tools\SqlCeMembership\Sr.cs" />
    <Compile Include="App_GlobalResources\EditorLocalization.designer.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>EditorLocalization.resx</DependentUpon>
    </Compile>
    <Compile Include="App_GlobalResources\GridLocalization.designer.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>GridLocalization.resx</DependentUpon>
    </Compile>
    <Compile Include="Controllers\HomeController.cs" />
    <Compile Include="Global.asax.cs">
      <DependentUpon>Global.asax</DependentUpon>
    </Compile>
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Tools\Security\AuthorizeWithRedirectToViewAttribute.cs" />
    <Compile Include="Tools\Security\HttpUnauthorizedWithRedirectToRouteResult.cs" />
    <Compile Include="ViewModels\RoleMultiSelector.cs" />
    <Compile Include="ViewModels\RolesViewModel.cs" />
    <Compile Include="ViewModels\RoleViewModel.cs" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="App_Data\Security.sdf" />
    <Content Include="Content\2011.3.1306\Default\editor.png" />
    <Content Include="Content\2011.3.1306\Default\imagebrowser.png" />
    <Content Include="Content\2011.3.1306\Default\loading.gif" />
    <Content Include="Content\2011.3.1306\Default\slider-h.gif" />
    <Content Include="Content\2011.3.1306\Default\slider-v.gif" />
    <Content Include="Content\2011.3.1306\Default\sprite-vertical.png" />
    <Content Include="Content\2011.3.1306\Default\sprite.png" />
    <Content Include="Content\2011.3.1306\Default\treeview-line.png" />
    <Content Include="Content\2011.3.1306\Default\treeview-nodes-rtl.png" />
    <Content Include="Content\2011.3.1306\Default\treeview-nodes.png" />
    <Content Include="Content\2011.3.1306\telerik.common.min.css" />
    <Content Include="Content\2011.3.1306\telerik.default.min.css" />
    <Content Include="Content\themes\base\images\ui-bg_flat_0_aaaaaa_40x100.png" />
    <Content Include="Content\themes\base\images\ui-bg_flat_75_ffffff_40x100.png" />
    <Content Include="Content\themes\base\images\ui-bg_glass_55_fbf9ee_1x400.png" />
    <Content Include="Content\themes\base\images\ui-bg_glass_65_ffffff_1x400.png" />
    <Content Include="Content\themes\base\images\ui-bg_glass_75_dadada_1x400.png" />
    <Content Include="Content\themes\base\images\ui-bg_glass_75_e6e6e6_1x400.png" />
    <Content Include="Content\themes\base\images\ui-bg_glass_95_fef1ec_1x400.png" />
    <Content Include="Content\themes\base\images\ui-bg_highlight-soft_75_cccccc_1x100.png" />
    <Content Include="Content\themes\base\images\ui-icons_222222_256x240.png" />
    <Content Include="Content\themes\base\images\ui-icons_2e83ff_256x240.png" />
    <Content Include="Content\themes\base\images\ui-icons_454545_256x240.png" />
    <Content Include="Content\themes\base\images\ui-icons_888888_256x240.png" />
    <Content Include="Content\themes\base\images\ui-icons_cd0a0a_256x240.png" />
    <Content Include="Content\themes\base\jquery-ui.css" />
    <Content Include="Content\themes\base\jquery.ui.accordion.css" />
    <Content Include="Content\themes\base\jquery.ui.all.css" />
    <Content Include="Content\themes\base\jquery.ui.autocomplete.css" />
    <Content Include="Content\themes\base\jquery.ui.base.css" />
    <Content Include="Content\themes\base\jquery.ui.button.css" />
    <Content Include="Content\themes\base\jquery.ui.core.css" />
    <Content Include="Content\themes\base\jquery.ui.datepicker.css" />
    <Content Include="Content\themes\base\jquery.ui.dialog.css" />
    <Content Include="Content\themes\base\jquery.ui.progressbar.css" />
    <Content Include="Content\themes\base\jquery.ui.resizable.css" />
    <Content Include="Content\themes\base\jquery.ui.selectable.css" />
    <Content Include="Content\themes\base\jquery.ui.slider.css" />
    <Content Include="Content\themes\base\jquery.ui.tabs.css" />
    <Content Include="Content\themes\base\jquery.ui.theme.css" />
    <Content Include="Content\themes\base\minified\images\ui-bg_flat_0_aaaaaa_40x100.png" />
    <Content Include="Content\themes\base\minified\images\ui-bg_flat_75_ffffff_40x100.png" />
    <Content Include="Content\themes\base\minified\images\ui-bg_glass_55_fbf9ee_1x400.png" />
    <Content Include="Content\themes\base\minified\images\ui-bg_glass_65_ffffff_1x400.png" />
    <Content Include="Content\themes\base\minified\images\ui-bg_glass_75_dadada_1x400.png" />
    <Content Include="Content\themes\base\minified\images\ui-bg_glass_75_e6e6e6_1x400.png" />
    <Content Include="Content\themes\base\minified\images\ui-bg_glass_95_fef1ec_1x400.png" />
    <Content Include="Content\themes\base\minified\images\ui-bg_highlight-soft_75_cccccc_1x100.png" />
    <Content Include="Content\themes\base\minified\images\ui-icons_222222_256x240.png" />
    <Content Include="Content\themes\base\minified\images\ui-icons_2e83ff_256x240.png" />
    <Content Include="Content\themes\base\minified\images\ui-icons_454545_256x240.png" />
    <Content Include="Content\themes\base\minified\images\ui-icons_888888_256x240.png" />
    <Content Include="Content\themes\base\minified\images\ui-icons_cd0a0a_256x240.png" />
    <Content Include="Content\themes\base\minified\jquery-ui.min.css" />
    <Content Include="Content\themes\base\minified\jquery.ui.accordion.min.css" />
    <Content Include="Content\themes\base\minified\jquery.ui.all.min.css" />
    <Content Include="Content\themes\base\minified\jquery.ui.autocomplete.min.css" />
    <Content Include="Content\themes\base\minified\jquery.ui.base.min.css" />
    <Content Include="Content\themes\base\minified\jquery.ui.button.min.css" />
    <Content Include="Content\themes\base\minified\jquery.ui.core.min.css" />
    <Content Include="Content\themes\base\minified\jquery.ui.datepicker.min.css" />
    <Content Include="Content\themes\base\minified\jquery.ui.dialog.min.css" />
    <Content Include="Content\themes\base\minified\jquery.ui.progressbar.min.css" />
    <Content Include="Content\themes\base\minified\jquery.ui.resizable.min.css" />
    <Content Include="Content\themes\base\minified\jquery.ui.selectable.min.css" />
    <Content Include="Content\themes\base\minified\jquery.ui.slider.min.css" />
    <Content Include="Content\themes\base\minified\jquery.ui.tabs.min.css" />
    <Content Include="Content\themes\base\minified\jquery.ui.theme.min.css" />
    <Content Include="Content\themes\custom\images\ui-bg_diagonals-thick_18_b81900_40x40.png" />
    <Content Include="Content\themes\custom\images\ui-bg_diagonals-thick_20_666666_40x40.png" />
    <Content Include="Content\themes\custom\images\ui-bg_flat_10_000000_40x100.png" />
    <Content Include="Content\themes\custom\images\ui-bg_glass_100_f6f6f6_1x400.png" />
    <Content Include="Content\themes\custom\images\ui-bg_glass_100_fdf5ce_1x400.png" />
    <Content Include="Content\themes\custom\images\ui-bg_glass_65_ffffff_1x400.png" />
    <Content Include="Content\themes\custom\images\ui-bg_gloss-wave_35_f6a828_500x100.png" />
    <Content Include="Content\themes\custom\images\ui-bg_highlight-soft_100_eeeeee_1x100.png" />
    <Content Include="Content\themes\custom\images\ui-bg_highlight-soft_75_ffe45c_1x100.png" />
    <Content Include="Content\themes\custom\images\ui-icons_222222_256x240.png" />
    <Content Include="Content\themes\custom\images\ui-icons_228ef1_256x240.png" />
    <Content Include="Content\themes\custom\images\ui-icons_ef8c08_256x240.png" />
    <Content Include="Content\themes\custom\images\ui-icons_ffd27a_256x240.png" />
    <Content Include="Content\themes\custom\images\ui-icons_ffffff_256x240.png" />
    <Content Include="Content\themes\custom\jquery-ui-1.8.16.custom.css" />
    <Content Include="Global.asax" />
    <Content Include="Scripts\2011.3.1306\jquery-1.6.4.min.js" />
    <Content Include="Scripts\2011.3.1306\jquery.validate.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.autocomplete.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.calendar.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.chart.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.combobox.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.common.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.datepicker.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.datetimepicker.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.draganddrop.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.editor.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.grid.editing.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.grid.filtering.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.grid.grouping.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.grid.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.grid.reordering.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.grid.resizing.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.imagebrowser.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.list.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.menu.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.panelbar.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.slider.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.splitter.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.tabstrip.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.textbox.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.timepicker.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.treeview.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.upload.min.js" />
    <Content Include="Scripts\2011.3.1306\telerik.window.min.js" />
    <Content Include="Scripts\jquery-1.6.4-vsdoc.js" />
    <Content Include="Scripts\jquery-1.6.4.js" />
    <Content Include="Scripts\jquery-1.6.4.min.js" />
    <Content Include="Scripts\jquery-ui-1.8.16.custom.min.js" />
    <Content Include="Scripts\jquery-ui-1.8.16.js" />
    <Content Include="Scripts\jquery-ui-1.8.16.min.js" />
    <Content Include="Scripts\jquery.loading.1.6.4.min.js" />
    <Content Include="Scripts\jquery.watermark.min.js" />
    <Content Include="Scripts\modernizr-2.0.6-development-only.js" />
    <Content Include="Web.config" />
    <Content Include="Web.Debug.config">
      <DependentUpon>Web.config</DependentUpon>
    </Content>
    <Content Include="Web.Release.config">
      <DependentUpon>Web.config</DependentUpon>
    </Content>
    <Content Include="Content\Site.css" />
    <Content Include="Scripts\jquery.unobtrusive-ajax.js" />
    <Content Include="Scripts\jquery.unobtrusive-ajax.min.js" />
    <Content Include="Scripts\jquery.validate.js" />
    <Content Include="Scripts\jquery.validate.min.js" />
    <Content Include="Scripts\jquery.validate.unobtrusive.js" />
    <Content Include="Scripts\jquery.validate.unobtrusive.min.js" />
    <Content Include="Scripts\jquery.validate-vsdoc.js" />
    <Content Include="Scripts\MicrosoftAjax.js" />
    <Content Include="Scripts\MicrosoftAjax.debug.js" />
    <Content Include="Scripts\MicrosoftMvcAjax.js" />
    <Content Include="Scripts\MicrosoftMvcAjax.debug.js" />
    <Content Include="Scripts\MicrosoftMvcValidation.js" />
    <Content Include="Scripts\MicrosoftMvcValidation.debug.js" />
    <Content Include="Views\Web.config">
      <SubType>Designer</SubType>
    </Content>
  </ItemGroup>
  <ItemGroup>
    <Folder Include="Areas\Area1\Models\" />
    <Folder Include="Areas\Area2\Models\" />
    <Folder Include="Areas\Area2\Views\Shared\" />
    <Folder Include="Models\" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Areas\Area1\Views\Manager\About.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Views\Home\Index.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Views\Shared\_Layout.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Views\_ViewStart.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Views\Shared\EditorTemplates\Currency.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Views\Shared\EditorTemplates\Date.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Views\Shared\EditorTemplates\DateTime.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Views\Shared\EditorTemplates\GridForeignKey.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Views\Shared\EditorTemplates\Integer.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Views\Shared\EditorTemplates\Number.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Views\Shared\EditorTemplates\Time.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="App_GlobalResources\EditorLocalization.resx">
      <Generator>GlobalResourceProxyGenerator</Generator>
      <LastGenOutput>EditorLocalization.designer.cs</LastGenOutput>
      <SubType>Designer</SubType>
    </Content>
  </ItemGroup>
  <ItemGroup>
    <Content Include="App_GlobalResources\GridLocalization.resx">
      <Generator>GlobalResourceProxyGenerator</Generator>
      <LastGenOutput>GridLocalization.designer.cs</LastGenOutput>
    </Content>
  </ItemGroup>
  <ItemGroup>
    <Content Include="packages.config" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Views\Shared\_PartialMenu.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Views\Shared\DisplayTemplates\SiteMapTitleHelperModel.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Views\Shared\DisplayTemplates\SiteMapPathHelperModel.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Views\Shared\DisplayTemplates\SiteMapNodeModelList.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Views\Shared\DisplayTemplates\SiteMapNodeModel.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Views\Shared\DisplayTemplates\SiteMapHelperModel.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Views\Shared\DisplayTemplates\MenuHelperModel.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Site.sitemap" />
    <Content Include="Areas\Area1\Views\Web.config" />
    <Content Include="Areas\Area1\Views\Shared\UnauthorizedAccess.cshtml" />
    <Content Include="Areas\Area2\Views\Web.config" />
    <Content Include="Areas\Area2\Views\Security\UnauthorizedAccess.cshtml" />
    <Content Include="Areas\Area1\Views\_ViewStart.cshtml" />
    <Content Include="Areas\Area2\Views\_ViewStart.cshtml" />
    <None Include="MvcSiteMapSchema.xsd">
      <SubType>Designer</SubType>
    </None>
    <Content Include="Views\User\UserInfo.cshtml" />
    <Content Include="Views\Shared\UnauthorizedAccess.cshtml" />
    <Content Include="Views\Home\ViewWithRenderAction.cshtml" />
    <Content Include="Views\Home\RenderViewMessage.cshtml" />
    <Content Include="Views\Shared\_PartialFormButton.cshtml" />
    <Content Include="Views\Role\CurrentUserRoles.cshtml" />
    <Content Include="Views\Shared\EditorTemplates\RoleMultiSelector.cshtml" />
    <Content Include="Views\Shared\UnauthorizedAction.cshtml" />
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
  <!-- 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> -->
  <Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
    <AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
  </Target>
  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
        <WebProjectProperties>
          <UseIIS>False</UseIIS>
          <AutoAssignPort>True</AutoAssignPort>
          <DevelopmentServerPort>58868</DevelopmentServerPort>
          <DevelopmentServerVPath>/</DevelopmentServerVPath>
          <IISUrl>http://localhost:58868/</IISUrl>
          <NTLMAuthentication>True</NTLMAuthentication>
          <UseCustomServer>False</UseCustomServer>
          <CustomServerUrl>
          </CustomServerUrl>
          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
        </WebProjectProperties>
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>
  <PropertyGroup>
    <PostBuildEvent>if not exist "$(TargetDir)x86" md "$(TargetDir)x86"
    xcopy /s /y "$(SolutionDir)packages\SqlServerCompact.4.0.8852.1\NativeBinaries\x86\*.*" "$(TargetDir)x86"
    if not exist "$(TargetDir)amd64" md "$(TargetDir)amd64"
    xcopy /s /y "$(SolutionDir)packages\SqlServerCompact.4.0.8852.1\NativeBinaries\amd64\*.*" "$(TargetDir)amd64"</PostBuildEvent>
  </PropertyGroup>
</Project>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect CGI
Canada Canada
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions