Skip to content

Latest commit

 

History

History
90 lines (61 loc) · 4.85 KB

File metadata and controls

90 lines (61 loc) · 4.85 KB

MSBuild.SDK.SystemWeb.RazorLibrary

Build Status NuGet package NuGet downloads

This project complements the MSBuild.SDK.SystemWeb SDK (based on the discussion and ideas in Add support for ASP.NET (non-Core) projects) by adding an SDK project type for Razor Libraries. This uses the RazorGenerator project to provide compile time support for MVC5 views with-in a library.

How can I use this SDKs?

When using an MSBuild Project SDK obtained via NuGet (such as the SDKs in this repo) a specific version must be specified.

Either append the version to the package name:

<Project Sdk="MSBuild.SDK.SystemWeb.RazorLibrary/4.0.88">
  ...

Or omit the version from the SDK attribute and specify it in the version in global.json, which can be useful to synchronise versions across multiple projects in a solution:

{
  "msbuild-sdks": {
    "MSBuild.SDK.SystemWeb.RazorLibrary" : "4.0.88"
  }
}

You can also use the templates to easily create new projects.

Documentation

For more information see

Source Docs

Properties

Common Properties

Property Default value Description
ExcludeSDKDefaultPackages false Do not include the default packages Microsoft.Net.Compilers.Toolset and Microsoft.CodeDom.Providers.DotNetCompilerPlatform
ApplySDKDefaultPackageVersions true* Apply default version numbers to packages unless using a Central Package Management system
GeneratedBindingRedirectsAction None Set the desired default behavior of what to do with SuggestedBindingRedirects if not yet set.
See automatically generated binding redirects
  • None - Do nothing except show the warning
  • Preview - Creates new Web.BindingRedirects.config file showing proposed changes
  • Overwrite - Updates the $(AppConfig) aka web.config in the project root and any RazorAppConfigFiles files

*Version numbers are not applied if you are using Microsoft.Build.CentralPackageVersions version 2.1.1 or higher. Remember to include the packages in your central package versions file.

Specific Properties

Property Default value Description
MvcBuildViews true if Configuration is Release
false otherwise
Whether to invoke the AspNetCompiler automatically after build
EnableWebFormsDefaultItems Same as EnableDefaultItems Whether to automatically include WebForms files as content
  • *.asax
  • *.ascx
  • *.ashx
  • *.asmx
  • *.aspx
  • *.master
  • *.svc

Deprecated Properties

Property Default value Description
ExcludeDefaultRazorPackages false Use ExcludeSDKDefaultPackages instead
OverwriteAppConfigWithBindingRedirects false If set, then any automatically generated binding redirects will be copied into your web.config and RazorAppConfigFiles files.

Automatic Default Packages

Common Packages

Package Default Version Property
Microsoft.Net.Compilers.Toolset 4.5.0 MicrosoftNetCompilersToolset_Version
Microsoft.CodeDom.Providers.DotNetCompilerPlatform 3.6.0 MicrosoftCodeDomProvidersDotNetCompilerPlatform_Version

Specific Packages

Package Default Version Property
RazorGenerator.MsBuild 2.5.0 RazorGeneratorMSBuild_Version
RazorGenerator.MVC 2.4.9 RazorGeneratorMVC_Version
Microsoft.AspNet.Mvc 5.2.9 MicrosoftAspNetMvc_Version

Items

Common Items

Item Name Default Description
RazorAppConfigFiles Views/web.config
Areas/**/web.config
List of config files that will be updated with binding redirects in addition to $(AppConfig)