Spaces:
Running
Running
File size: 43,706 Bytes
090629c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 |
<!--
***********************************************************************************************
Sdk.Razor.CurrentVersion.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
-->
<Project ToolsVersion="14.0" TreatAsLocalProperty="_RazorSdkTasksTFM;_Targeting30OrNewerRazorLangVersion">
<PropertyGroup>
<EnableDefaultContentItems Condition=" '$(EnableDefaultContentItems)' == '' ">true</EnableDefaultContentItems>
</PropertyGroup>
<!--
Targets supporting Razor MSBuild integration. Contain support for generating C# code using Razor
and including the generated code in the project lifecycle, including compiling, publishing and producing
nuget packages.
-->
<!--
This is a hook to import a set of targets before the Razor targets. By default this is unused.
-->
<Import Project="$(CustomBeforeRazorSdkTargets)" Condition="'$(CustomBeforeRazorSdkTargets)' != '' and Exists('$(CustomBeforeRazorSdkTargets)')"/>
<PropertyGroup>
<!-- Paths to tools, tasks, and extensions are calculated relative to the RazorSdkDirectoryRoot. This can be modified to test a local build. -->
<RazorSdkDirectoryRoot Condition="'$(RazorSdkDirectoryRoot)'==''">$(MSBuildThisFileDirectory)..\</RazorSdkDirectoryRoot>
<RazorSdkBuildTasksDirectoryRoot Condition="'$(RazorSdkBuildTasksDirectoryRoot)'==''">$(RazorSdkDirectoryRoot)tasks\</RazorSdkBuildTasksDirectoryRoot>
<_RazorSdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net8.0</_RazorSdkTasksTFM>
<_RazorSdkTasksTFM Condition=" '$(_RazorSdkTasksTFM)' == ''">net472</_RazorSdkTasksTFM>
<RazorSdkBuildTasksAssembly>$(RazorSdkBuildTasksDirectoryRoot)$(_RazorSdkTasksTFM)\Microsoft.NET.Sdk.Razor.Tasks.dll</RazorSdkBuildTasksAssembly>
<_RazorSdkToolAssembly>$(RazorSdkDirectoryRoot)tools\rzc.dll</_RazorSdkToolAssembly>
</PropertyGroup>
<PropertyGroup Condition="'$(DOTNET_HOST_PATH)' == ''">
<_RazorSdkDotNetHostDirectory>$(NetCoreRoot)</_RazorSdkDotNetHostDirectory>
<_RazorSdkDotNetHostFileName>dotnet</_RazorSdkDotNetHostFileName>
<_RazorSdkDotNetHostFileName Condition="'$(OS)' == 'Windows_NT'">dotnet.exe</_RazorSdkDotNetHostFileName>
</PropertyGroup>
<!-- Resolve the TFM-specific attributes conditionally. -->
<Choose>
<When Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '8.0')) ">
<PropertyGroup>
<_TargetingNETCoreApp30OrLater>true</_TargetingNETCoreApp30OrLater>
<_TargetingNET50OrLater>true</_TargetingNET50OrLater>
<_TargetingNET60OrLater>true</_TargetingNET60OrLater>
<_TargetingNET70OrLater>true</_TargetingNET70OrLater>
<_TargetingNET80OrLater>true</_TargetingNET80OrLater>
<UseRazorSourceGenerator Condition="'$(Language)' == 'C#' AND '$(UseRazorSourceGenerator)' == '' ">true</UseRazorSourceGenerator>
<RazorLangVersion Condition="'$(RazorLangVersion)' == '' ">8.0</RazorLangVersion>
</PropertyGroup>
</When>
<When Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '7.0')) ">
<PropertyGroup>
<_TargetingNETCoreApp30OrLater>true</_TargetingNETCoreApp30OrLater>
<_TargetingNET50OrLater>true</_TargetingNET50OrLater>
<_TargetingNET60OrLater>true</_TargetingNET60OrLater>
<_TargetingNET70OrLater>true</_TargetingNET70OrLater>
<UseRazorSourceGenerator Condition="'$(Language)' == 'C#' AND '$(UseRazorSourceGenerator)' == '' ">true</UseRazorSourceGenerator>
<RazorLangVersion Condition="'$(RazorLangVersion)' == '' ">7.0</RazorLangVersion>
</PropertyGroup>
</When>
<When Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '6.0')) ">
<PropertyGroup>
<_TargetingNETCoreApp30OrLater>true</_TargetingNETCoreApp30OrLater>
<_TargetingNET50OrLater>true</_TargetingNET50OrLater>
<_TargetingNET60OrLater>true</_TargetingNET60OrLater>
<UseRazorSourceGenerator Condition="'$(Language)' == 'C#' AND '$(UseRazorSourceGenerator)' == '' ">true</UseRazorSourceGenerator>
<RazorLangVersion Condition="'$(RazorLangVersion)' == '' ">6.0</RazorLangVersion>
</PropertyGroup>
</When>
<When Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '5.0')) ">
<PropertyGroup>
<_TargetingNETCoreApp30OrLater>true</_TargetingNETCoreApp30OrLater>
<_TargetingNET50OrLater>true</_TargetingNET50OrLater>
<UseRazorSourceGenerator>false</UseRazorSourceGenerator>
<RazorLangVersion Condition="'$(RazorLangVersion)' == '' ">5.0</RazorLangVersion>
</PropertyGroup>
</When>
<When Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '3.0')) ">
<PropertyGroup>
<_TargetingNETCoreApp30OrLater>true</_TargetingNETCoreApp30OrLater>
<UseRazorSourceGenerator>false</UseRazorSourceGenerator>
<RazorLangVersion Condition="'$(RazorLangVersion)' == '' ">3.0</RazorLangVersion>
</PropertyGroup>
</When>
<When Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard' AND $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '2.1')) ">
<PropertyGroup>
<_TargetingNETStandard21OrLater>true</_TargetingNETStandard21OrLater>
</PropertyGroup>
</When>
<When Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard' AND $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '2.0')) ">
<PropertyGroup>
<_TargetingNETStandard20OrLater>true</_TargetingNETStandard20OrLater>
</PropertyGroup>
</When>
</Choose>
<PropertyGroup>
<!--
In 3.0, we expect RazorLangVersion to either be specified in the template or inferred via TFM. In 2.x, RazorLangVersion is
specified via the Razor.Design package. We'll default to a version of 2.1, the earliest version that the SDK supports.
A 2.1 version should result in a build warning if the project contains Components.
-->
<RazorLangVersion Condition="'$(RazorLangVersion)' == ''">2.1</RazorLangVersion>
<!-- Keep this in sync with RazorLangVersion.cs if we introduce new text based values. -->
<_Targeting30OrNewerRazorLangVersion Condition="
'$(RazorLangVersion)' == 'Latest' OR
'$(RazorLangVersion)' == 'Experimental' OR
('$(RazorLangVersion)' != '' AND '$(RazorLangVersion)' >= '3.0')">true</_Targeting30OrNewerRazorLangVersion>
</PropertyGroup>
<PropertyGroup>
<!--
The property IsRazorCompilerReferenced is defined by the 2.x Razor.Design package. We can use this as a best guess to determine if a project is targeting 2.x or earlier.
This is useful to provide 3.0 or newer specific build warnings. However, since it's not very reliable, we should not use this to make build-altering decisions.
-->
<_IsTargetingRazor2X Condition="'$(IsRazorCompilerReferenced)'=='true'">true</_IsTargetingRazor2X>
</PropertyGroup>
<!--
These are the targets that actually do compilation using CSC, separated from the main file for ease of maintenance.
RazorCoreCompile and any other targets that are needed for two-step compilation should be defined there.
-->
<Import Project="Microsoft.NET.Sdk.Razor.Compilation.targets" Condition="'$(UseRazorSourceGenerator)' != 'true'"/>
<!--
Razor defines two primary targets:
'RazorGenerate' - which updates generated code
'RazorCompile' - compiles an assembly from generated code
Use these properties and targets to attach behavior to the corresponding phase.
-->
<PropertyGroup>
<PrepareForRazorGenerateDependsOn>
ResolveRazorConfiguration;
ResolveRazorGenerateInputs;
AssignRazorGenerateTargetPaths;
_ResolveGeneratedRazorCompileInputs;
_CheckForIncorrectMvcConfiguration;
</PrepareForRazorGenerateDependsOn>
<PrepareForRazorGenerateDependsOn Condition="'$(UseRazorSourceGenerator)' != 'true'">
$(PrepareForRazorGenerateDependsOn);
ResolveAssemblyReferenceRazorGenerateInputs;
_CheckForMissingRazorCompiler;
ResolveTagHelperRazorGenerateInputs
</PrepareForRazorGenerateDependsOn>
<PrepareForRazorComponentGenerateDependsOn>
ResolveRazorConfiguration;
ResolveRazorComponentInputs;
_CheckForIncorrectComponentsConfiguration;
AssignRazorComponentTargetPaths;
</PrepareForRazorComponentGenerateDependsOn>
<RazorGenerateDependsOn>
PrepareForRazorGenerate;
</RazorGenerateDependsOn>
<RazorGenerateDependsOn Condition="'$(UseRazorSourceGenerator)' != 'true'">
$(RazorGenerateDependsOn);
_CheckForMissingRazorCompiler;
RazorCoreGenerate
</RazorGenerateDependsOn>
<RazorComponentGenerateDependsOn>
PrepareForRazorComponentGenerate
</RazorComponentGenerateDependsOn>
<PrepareForRazorCompileDependsOn>
RazorGenerate;
ResolveRazorCompileInputs;
GenerateRazorTargetAssemblyInfo
</PrepareForRazorCompileDependsOn>
<ResolveRazorCompileInputsDependsOn>
ResolveRazorEmbeddedResources;
</ResolveRazorCompileInputsDependsOn>
<ResolveScopedCssOutputsDependsOn>
$(ResolveScopedCssOutputsDependsOn);
ResolveCssScopes;
</ResolveScopedCssOutputsDependsOn>
<DebugSymbolsProjectOutputGroupDependsOn>
$(DebugSymbolsProjectOutputGroupDependsOn);
_RazorAddDebugSymbolsProjectOutputGroupOutput
</DebugSymbolsProjectOutputGroupDependsOn>
<PrepareForBuildDependsOn>
$(PrepareForBuildDependsOn);
ResolveRazorGenerateInputs
</PrepareForBuildDependsOn>
<GenerateNuspecDependsOn>
ResolveRazorGenerateInputs;
$(GenerateNuspecDependsOn)
</GenerateNuspecDependsOn>
<PrepareForRunDependsOn>
_RazorPrepareForRun;
$(PrepareForRunDependsOn)
</PrepareForRunDependsOn>
<_RazorGenerateComponentDesignTimeDependsOn>
ResolveRazorComponentInputs;
AssignRazorComponentTargetPaths
</_RazorGenerateComponentDesignTimeDependsOn>
</PropertyGroup>
<!--
Default values for properties that affect Razor targets to the standard build lifecycle.
-->
<PropertyGroup Condition="'$(RazorCompileOnBuild)'=='' AND '$(Language)'=='C#'">
<RazorCompileOnBuild>true</RazorCompileOnBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(RazorCompileOnPublish)'=='' AND '$(Language)'=='C#'">
<!-- Always compile on publish by default if we're compiling on build -->
<RazorCompileOnPublish Condition="'$(RazorCompileOnBuild)'=='true'">true</RazorCompileOnPublish>
<!-- Compatibility with the old MVC Precompilation setting -->
<RazorCompileOnPublish Condition="'$(RazorCompileOnPublish)'==''">$(MvcRazorCompileOnPublish)</RazorCompileOnPublish>
<!-- Default to on if MvcRazorCompileOnPublish isn't set for some reason -->
<RazorCompileOnPublish Condition="'$(RazorCompileOnPublish)'==''">true</RazorCompileOnPublish>
</PropertyGroup>
<!--
Properties that configure Razor SDK, but need to be defined in targets due to evaluation order.
-->
<PropertyGroup>
<!-- Output directory used for generated files -->
<RazorGenerateIntermediateOutputPath Condition="'$(RazorGenerateIntermediateOutputPath)'==''">$(IntermediateOutputPath)Razor\</RazorGenerateIntermediateOutputPath>
<_RazorComponentDeclarationOutputPath Condition="'$(_RazorComponentDeclarationOutputPath)'==''">$(IntermediateOutputPath)RazorDeclaration\</_RazorComponentDeclarationOutputPath>
<!--
Use the suffix .Views when producing compiled view assemblies. This matches the requirements for Mvc's ViewsFeatureProvider.
-->
<RazorTargetNameSuffix Condition="'$(RazorTargetNameSuffix)'=='' AND '$(_Targeting30OrNewerRazorLangVersion)' == 'true'">.Views</RazorTargetNameSuffix>
<!-- Suffix appended to $(TargetName) to produce $(RazorTargetName), the name of the assembly produced by Razor -->
<RazorTargetNameSuffix Condition="'$(RazorTargetNameSuffix)' == ''">.Razor</RazorTargetNameSuffix>
<!-- File name (without extension) of the assembly produced by Razor -->
<RazorTargetName Condition="'$(RazorTargetName)'==''">$(TargetName)$(RazorTargetNameSuffix)</RazorTargetName>
<!--
The compatibility zone - these properties were provided by the MVC Precompilation tool and they
map to supported settings in Razor SDK.
We want to set the defaults for these in the .props file, but we need to process the old settings here
in case they were set in the project file. The consequence of this is that the old settings will override
the new ones if they are set to conflicting values.
-->
<CopyRazorGenerateFilesToPublishDirectory Condition="'$(MvcRazorExcludeViewFilesFromPublish)'=='true'">false</CopyRazorGenerateFilesToPublishDirectory>
<CopyRazorGenerateFilesToPublishDirectory Condition="'$(MvcRazorExcludeViewFilesFromPublish)'=='false'">true</CopyRazorGenerateFilesToPublishDirectory>
<CopyRefAssembliesToPublishDirectory Condition="'$(MvcRazorExcludeRefAssembliesFromPublish)'=='true'">false</CopyRefAssembliesToPublishDirectory>
<CopyRefAssembliesToPublishDirectory Condition="'$(MvcRazorExcludeRefAssembliesFromPublish)'=='false'">true</CopyRefAssembliesToPublishDirectory>
<!-- Use PreserveCompilationReferences to determine the behavior of CopyRefAssembliesToPublishDirectory if not explicitly specified by the project. -->
<CopyRefAssembliesToPublishDirectory Condition="'$(CopyRefAssembliesToPublishDirectory)'==''">$(PreserveCompilationReferences)</CopyRefAssembliesToPublishDirectory>
<!-- For 2.x projects desktop and .NET Core projects, if they're opting in to runtime compilation (indicated by PreserveCompilationContext=true), set PreserveCompilationReferences = true -->
<PreserveCompilationReferences Condition=" '$(PreserveCompilationContext)' == 'true' AND
('$(TargetFrameworkIdentifier)' == '.NETFramework' OR
('$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND
'$(_TargetingNETCoreApp30OrLater)' != 'true')) ">true</PreserveCompilationReferences>
<!--
We can't set the actual default value here due to evaluation order (depends on $(OutDir)).
This handles a compatibility case with MVC Precompilation.
-->
<RazorOutputPath Condition="'$(MvcRazorOutputPath)'!=''">$([MSBuild]::EnsureTrailingSlash('$(MvcRazorOutputPath)'))</RazorOutputPath>
<!--
Configures whether all of the @(RazorGenerate) items will be added as embedded files to the produced assembly.
When true, everything in @(RazorGenerate) will be added to @(RazorEmbeddedFiles) and passed to CSC.
-->
<EmbedRazorGenerateSources Condition="'$(MvcRazorEmbedViewSources)'!=''">$(MvcRazorEmbedViewSources)</EmbedRazorGenerateSources>
<EmbedRazorGenerateSources Condition="'$(EmbedRazorGenerateSources)'==''">false</EmbedRazorGenerateSources>
<!--
Set to false to disable Razor code generation from using a persistent build server process.
-->
<UseRazorBuildServer Condition="'$(UseRazorBuildServer)'==''">$(UseSharedCompilation)</UseRazorBuildServer>
<UseRazorBuildServer Condition="'$(UseRazorBuildServer)'==''">true</UseRazorBuildServer>
</PropertyGroup>
<PropertyGroup>
<!-- Similar to https://github.com/Microsoft/msbuild/blob/908cc9ccd4961441628f68e37a148183a87bb067/src/Tasks/Microsoft.Common.CurrentVersion.targets#L146-L153 -->
<_RazorDebugSymbolsProduced>false</_RazorDebugSymbolsProduced>
<_RazorDebugSymbolsProduced Condition="'$(DebugSymbols)'=='true'">true</_RazorDebugSymbolsProduced>
<_RazorDebugSymbolsProduced Condition="'$(DebugType)'=='none'">false</_RazorDebugSymbolsProduced>
<_RazorDebugSymbolsProduced Condition="'$(DebugType)'=='pdbonly'">true</_RazorDebugSymbolsProduced>
<_RazorDebugSymbolsProduced Condition="'$(DebugType)'=='full'">true</_RazorDebugSymbolsProduced>
<_RazorDebugSymbolsProduced Condition="'$(DebugType)'=='portable'">true</_RazorDebugSymbolsProduced>
<_RazorDebugSymbolsProduced Condition="'$(DebugType)'=='embedded'">false</_RazorDebugSymbolsProduced>
</PropertyGroup>
<!--
Resolve the toolset to use. This specifically applies to compilation with 2.x projects where compilation could be performed either using
the PrecompilationTool (Microsoft.AspNetCore.Mvc.Razor.ViewCompilation) or the RazorSDK and we have to infer the tool that is to be used.
In 3.0 or later, there is only the RazorSdk.
-->
<PropertyGroup Condition="'$(_Targeting30OrNewerRazorLangVersion)' == 'true'">
<ResolvedRazorCompileToolset>RazorSdk</ResolvedRazorCompileToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(ResolvedRazorCompileToolset)' == ''">
<!-- Default value for the property 'MvcRazorCompileOnPublish' is empty. If it has been explicitly enabled, continue using precompilation. -->
<ResolvedRazorCompileToolset Condition="'$(MvcRazorCompileOnPublish)' == 'true'">PrecompilationTool</ResolvedRazorCompileToolset>
<!-- The default value for 'RazorCompileToolset' was not modified. In this case, infer the toolset to use as RazorSdk. -->
<ResolvedRazorCompileToolset Condition="'$(MvcRazorCompileOnPublish)' == '' AND '$(RazorCompileToolset)' == 'Implicit'">RazorSdk</ResolvedRazorCompileToolset>
<ResolvedRazorCompileToolset Condition="'$(MvcRazorCompileOnPublish)' == '' AND '$(RazorCompileToolset)' == 'PrecompilationTool'">$(RazorCompileToolset)</ResolvedRazorCompileToolset>
<ResolvedRazorCompileToolset Condition="'$(MvcRazorCompileOnPublish)' == '' AND '$(RazorCompileToolset)' == 'RazorSdk'">$(RazorCompileToolset)</ResolvedRazorCompileToolset>
<!-- If RazorSdk is not referenced, fall-back to Precompilation tool when referenced by a 2.2 or earlier targeting project. -->
<ResolvedRazorCompileToolset Condition="'$(ResolvedRazorCompileToolset)' == 'RazorSdk' And '$(IsRazorCompilerReferenced)' != 'true'">PrecompilationTool</ResolvedRazorCompileToolset>
<!-- Previous versions of the precompilation tool still depends on the msbuild property 'MvcRazorCompileOnPublish'. Hence, setting it to the old default value -->
<MvcRazorCompileOnPublish Condition="'$(MvcRazorCompileOnPublish)' == ''">true</MvcRazorCompileOnPublish>
</PropertyGroup>
<!-- Back-compat for PrecompilationTool -->
<PropertyGroup>
<!--
For 2.x desktop targeting projects using MvcPrecompilation, ref assemblies are required to compile the PrecompiledViews.dll,
but are removed by the tool once done. Set PreserveCompilationReferences = true, ignoring any value configured in the project,
if the project is using the precompilation tool.
-->
<PreserveCompilationReferences Condition="'$(ResolvedRazorCompileToolset)'=='PrecompilationTool'">true</PreserveCompilationReferences>
</PropertyGroup>
<!--
Properties that configure Razor SDK, but need to be defined in targets due to evaluation order.
-->
<ItemGroup>
<!-- Used to creating the final compiled Razor dll -->
<RazorIntermediateAssembly Condition="'$(RazorIntermediateAssembly)'==''" Include="$(IntermediateOutputPath)$(RazorTargetName).dll" />
<!-- Used in Compilation.targets -->
<_RazorDebugSymbolsIntermediatePath Condition="'$(_RazorDebugSymbolsProduced)'=='true'" Include="$(IntermediateOutputPath)$(RazorTargetName).pdb" />
</ItemGroup>
<ItemGroup>
<!--
Add all .razor files to UpToDateCheckInput. Component compilation is not controlled by RazorCompileOnBuild,
which is why this itemgroup is unconditional.
-->
<UpToDateCheckInput Include="@(Content->WithMetadataValue('Extension', '.razor'))" />
</ItemGroup>
<!-- For apps building with the source generator, a separate Views assembly is produced out of the source
CSHTML files. In that scenario, the source CSHTML files and the output assembly
are treated in a separate set. -->
<ItemGroup Condition="'$(UseRazorSourceGenerator)' != 'true'">
<!--
Add all cshtml files to UpToDateCheckInput - a collection of files used by FastUpToDateCheck to determine
if any of the the project inputs have changed.
-->
<UpToDateCheckInput Condition="'$(RazorCompileOnBuild)'=='true'" Include="@(Content->WithMetadataValue('Extension', '.cshtml'))" Set="RazorViews" />
<!--
Add Razor output files to UpToDateCheckBuilt - a collection of files used by FastUpToDateCheck to determine
if any of the project's outputs have changed.
-->
<UpToDateCheckBuilt Include="@(RazorIntermediateAssembly)"
Condition="'$(RazorCompileOnBuild)'=='true' AND '@(Content->WithMetadataValue('Extension', '.cshtml'))' != ''" Set="RazorViews" />
</ItemGroup>
<!-- For apps building with the source generator, add .cshtml files to the default set since they are compiled into the app binary. -->
<ItemGroup Condition="'$(UseRazorSourceGenerator)' == 'true'">
<UpToDateCheckInput Include="@(Content->WithMetadataValue('Extension', '.cshtml'))" />
</ItemGroup>
<!--
These are the targets that generate code using Razor, separated from the main file for ease of maintenance.
Most targets related to Razor code generation are defined there.
-->
<!-- Determine what compiler and versions of the language to target. For 2.x targeting projects, these are carried by packages referenced by the project. Use this -->
<!-- When targeting 3.x and later projects, we have to infer configuration by inspecting the project. -->
<Import Project="Microsoft.NET.Sdk.Razor.Configuration.targets" Condition="'$(_Targeting30OrNewerRazorLangVersion)' == 'true'" />
<Import Project="Microsoft.NET.Sdk.Razor.CodeGeneration.targets" />
<Import Project="Microsoft.NET.Sdk.Razor.Component.targets" Condition="'$(_Targeting30OrNewerRazorLangVersion)' == 'true' AND '$(UseRazorSourceGenerator)' != 'true'" />
<Import Project="Microsoft.NET.Sdk.Razor.SourceGenerators.targets" Condition="'$(UseRazorSourceGenerator)' == 'true'" />
<Import Project="Microsoft.NET.Sdk.Razor.GenerateAssemblyInfo.targets" />
<Import Project="Microsoft.NET.Sdk.Razor.MvcApplicationPartsDiscovery.targets" Condition="'$(_TargetingNETCoreApp30OrLater)' == 'true'" />
<Target Name="PrepareForRazorGenerate" DependsOnTargets="$(PrepareForRazorGenerateDependsOn)">
</Target>
<Target Name="PrepareForRazorComponentGenerate" DependsOnTargets="$(PrepareForRazorComponentGenerateDependsOn)">
</Target>
<Target Name="RazorGenerate" DependsOnTargets="$(RazorGenerateDependsOn)">
</Target>
<Target Name="RazorComponentGenerate" DependsOnTargets="$(RazorComponentGenerateDependsOn)">
</Target>
<Target Name="PrepareForRazorCompile" DependsOnTargets="$(PrepareForRazorCompileDependsOn)">
</Target>
<Target Name="RazorCompile" DependsOnTargets="$(RazorCompileDependsOn)" Condition="'$(_UseSourceGenerators)' == ''">
</Target>
<!--
Computes the applicable @(ResolvedRazorConfiguration) and @(ResolvedRazorExtension) items that match the project's
configuration.
-->
<Target Name="ResolveRazorConfiguration">
<ItemGroup Condition="'$(RazorDefaultConfiguration)'!=''">
<ResolvedRazorConfiguration Include="@(RazorConfiguration->WithMetadataValue('Identity', '$(RazorDefaultConfiguration)')->Distinct())" />
</ItemGroup>
<!--
ResolvedRazorConfiguration should only ever have one item in it. If misconfigured, we may resolve more than one item which
may result in incorrect results or poorly worded build errors.
-->
<Warning Text="Unable to resolve a Razor configuration for the value '$(RazorDefaultConfiguration)'. Available configurations '@(RazorConfiguration->'%(Identity)', ', ')'.'"
Code="RAZORSDK1000"
Condition="'$(_Targeting30OrNewerRazorLangVersion)' == 'true' AND '@(ResolvedRazorConfiguration->Count())' == '0'" />
<Warning Text="More than one Razor configuration was resolved for the value '$(RazorDefaultConfiguration)'. Available configurations '@(RazorConfiguration->'%(Identity)', ', ')'."
Code="RAZORSDK1001"
Condition="'$(_Targeting30OrNewerRazorLangVersion)' == 'true' AND '@(ResolvedRazorConfiguration->Count())' > '1'" />
<!-- For a 3.0 project, targeting a RazorLangVersion is nearly always an error condition -->
<Warning Text="Detected Razor language version downgrade. This is typically caused by a reference to the Microsoft.AspNetCore.Razor.Design package. Consider removing this package reference."
Code="RAZORSDK1006"
Condition="'$(_Targeting30OrNewerRazorLangVersion)' != 'true' AND '$(_TargetingNETCoreApp30OrLater)' == 'true'" />
<FindInList
List="@(RazorExtension)"
ItemSpecToFind="@(ResolvedRazorConfiguration->Metadata('Extensions'))"
Condition="'@(ResolvedRazorConfiguration->HasMetadata('Extensions')->Count())' != '0'">
<Output TaskParameter="ItemFound" ItemName="ResolvedRazorExtension" />
</FindInList>
</Target>
<!--
Gets assembly attributes in support for Razor runtime code generation. This is a set of standard
metadata attributes (defined in Microsoft.AspNetCore.Razor.Runtime) that capture the build-time
Razor configuration of an application to be used at runtime.
This allows the project file to act as the source of truth for the applicable Razor configuration regardless
of how Razor is used.
The SDK expects configurations that use runtime compilation to set $(GenerateRazorHostingAssemblyInfo) to true,
it will be unset by default.
-->
<Target
Name="RazorGetAssemblyAttributes"
Condition="'$(GenerateRazorHostingAssemblyInfo)'=='true' and '$(RazorDefaultConfiguration)'!=''"
DependsOnTargets="ResolveRazorConfiguration">
<ItemGroup>
<_RazorAssemblyAttribute Include="Microsoft.AspNetCore.Razor.Hosting.RazorLanguageVersionAttribute">
<_Parameter1>$(RazorLangVersion)</_Parameter1>
</_RazorAssemblyAttribute>
<_RazorAssemblyAttribute Include="Microsoft.AspNetCore.Razor.Hosting.RazorConfigurationNameAttribute">
<_Parameter1>$(RazorDefaultConfiguration)</_Parameter1>
</_RazorAssemblyAttribute>
<_RazorAssemblyAttribute Include="Microsoft.AspNetCore.Razor.Hosting.RazorExtensionAssemblyNameAttribute" Condition="'%(ResolvedRazorExtension.AssemblyName)'!=''">
<_Parameter1>%(ResolvedRazorExtension.Identity)</_Parameter1>
<_Parameter2>%(ResolvedRazorExtension.AssemblyName)</_Parameter2>
</_RazorAssemblyAttribute>
</ItemGroup>
</Target>
<!--
Gathers input source files for code generation. This is a separate target so that we can avoid
lots of work when there are no inputs for code generation.
This target runs as part of PrepareForBuild. This gives us an opportunitity to change things like CopyToPublishDirectory
for Content items before they are processed by other Build targets.
NOTE: This target is called as part of an incremental build scenario in VS. Do not perform any work
outside of calculating RazorGenerate items in this target.
-->
<Target Name="ResolveRazorGenerateInputs">
<!--
In MVC Precompilation MvcRazorFilesToCompile also had the effect of suppressing the default
items for Razor code generation. As with all of these MVC Precompilation back-compat settings,
using the old thing, overrides the new thing.
-->
<PropertyGroup Condition="'@(MvcRazorFilesToCompile)'!=''">
<EnableDefaultRazorGenerateItems>false</EnableDefaultRazorGenerateItems>
</PropertyGroup>
<ItemGroup>
<RazorGenerate Include="@(MvcRazorFilesToCompile)" />
</ItemGroup>
<ItemGroup Condition="'$(EnableDefaultRazorGenerateItems)'=='true'">
<RazorGenerate
Include="@(Content)"
Exclude="$(_RazorComponentInclude)"
Condition="'%(Content.Extension)'=='.cshtml'" />
</ItemGroup>
<!--
Ideally we want to able to update all Content items that also appear in RazorGenerate to have
CopyToPublishDirectory=Never. However, there isn't a simple way to do this (https://github.com/Microsoft/msbuild/issues/1618).
Instead, we'll update all cshtml Content items when EnableDefaultRazorGenerateItems=true and Razor Sdk is used for publishing.
-->
<ItemGroup Condition="
'$(EnableDefaultRazorGenerateItems)'=='true' and
'$(CopyRazorGenerateFilesToPublishDirectory)'=='false' and
'$(ResolvedRazorCompileToolset)'=='RazorSdk' and
'$(RazorCompileOnPublish)'=='true'">
<Content Condition="'%(Content.Extension)'=='.cshtml'" CopyToPublishDirectory="Never" />
</ItemGroup>
<ItemGroup Condition="
'$(ResolvedRazorCompileToolset)'=='RazorSdk' and
'$(EnableDefaultRazorGenerateItems)'=='true'">
<Content Condition="'%(Content.Extension)'=='.cshtml'" Pack="$(IncludeRazorContentInPack)" />
<Content Condition="'%(Content.Extension)'=='.razor'" Pack="$(IncludeRazorContentInPack)" />
</ItemGroup>
</Target>
<Target Name="ResolveRazorComponentInputs">
<!--
Gathers input source files for Razor component generation. This is a separate target so that we can avoid
lots of work when there are no inputs for code generation.
NOTE: This target is called as part of an incremental build scenario in VS. Do not perform any work
outside of calculating RazorComponent items in this target.
-->
<ItemGroup Condition="'$(EnableDefaultRazorComponentItems)'=='true'">
<RazorComponent Include="@(Content)" Condition="'%(Content.Extension)'=='.razor'" />
<RazorComponent Include="$(_RazorComponentInclude)" />
</ItemGroup>
<ItemGroup>
<Content Condition="'%(Content.Extension)'=='.razor'" CopyToPublishDirectory="Never" />
</ItemGroup>
</Target>
<!-- This target validates that there is at most one scoped css file per component, that there are no scoped css files without a
matching component, and then adds the associated scope to the razor components that have a matching scoped css file.
-->
<Target
Name="ResolveCssScopes"
Condition="'$(ScopedCssEnabled)' == 'true'"
BeforeTargets="AssignRazorComponentTargetPaths;AssignRazorGenerateTargetPaths"
DependsOnTargets="ComputeCssScope;ResolveRazorComponentInputs;ResolveRazorGenerateInputs">
<ApplyCssScopes RazorComponents="@(RazorComponent)" RazorGenerate="@(RazorGenerate)" ScopedCss="@(_ScopedCss)">
<Output TaskParameter="RazorComponentsWithScopes" ItemName="_RazorComponentsWithScopes" />
<Output TaskParameter="RazorGenerateWithScopes" ItemName="_RazorGenerateWithScopes" />
</ApplyCssScopes>
<ItemGroup>
<RazorComponent Remove="@(_RazorComponentsWithScopes)" />
<RazorComponent Include="@(_RazorComponentsWithScopes)" />
<RazorGenerate Remove="@(_RazorGenerateWithScopes)" />
<RazorGenerate Include="@(_RazorGenerateWithScopes)" />
</ItemGroup>
</Target>
<!--
Temporarary workaround for https://github.com/dotnet/aspnetcore/issues/6859. This can be removed after a VS insertion with a newer copy of the DesignTime targets.
-->
<ItemGroup>
<Content Update="$(_RazorComponentInclude)">
<Generator>MSBuild:RazorGenerateComponentDeclarationDesignTime</Generator>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</Content>
</ItemGroup>
<Target Name="AssignRazorComponentTargetPaths" Condition="'@(RazorComponent)' != ''">
<AssignTargetPath Files="@(RazorComponent)" RootFolder="$(MSBuildProjectDirectory)">
<Output TaskParameter="AssignedFiles" ItemName="RazorComponentWithTargetPath" />
</AssignTargetPath>
<ItemGroup>
<RazorComponentWithTargetPath Condition="'%(RazorComponentWithTargetPath.GeneratedOutput)' == ''">
<GeneratedOutput>$(RazorGenerateIntermediateOutputPath)%(RazorComponentWithTargetPath.TargetPath)$(RazorGenerateOutputFileExtension)</GeneratedOutput>
</RazorComponentWithTargetPath>
<RazorComponentWithTargetPath Condition="'%(RazorComponentWithTargetPath.GeneratedDeclaration)' == ''">
<GeneratedDeclaration>$(_RazorComponentDeclarationOutputPath)%(RazorComponentWithTargetPath.TargetPath)$(RazorGenerateOutputFileExtension)</GeneratedDeclaration>
</RazorComponentWithTargetPath>
<RazorComponentWithTargetPath Condition="'%(RazorComponentWithTargetPath.DocumentKind)' == ''">
<DocumentKind>component</DocumentKind>
</RazorComponentWithTargetPath>
</ItemGroup>
</Target>
<Target Name="AssignRazorGenerateTargetPaths" Condition="'@(RazorGenerate)' != ''">
<AssignTargetPath Files="@(RazorGenerate)" RootFolder="$(MSBuildProjectDirectory)">
<Output TaskParameter="AssignedFiles" ItemName="RazorGenerateWithTargetPath" />
</AssignTargetPath>
<ItemGroup>
<RazorGenerateWithTargetPath Condition="'%(RazorGenerateWithTargetPath.GeneratedOutput)' == ''">
<GeneratedOutput>$(RazorGenerateIntermediateOutputPath)%(RazorGenerateWithTargetPath.TargetPath)$(RazorGenerateOutputFileExtension)</GeneratedOutput>
</RazorGenerateWithTargetPath>
<RazorGenerateWithTargetPath Condition="'%(RazorGenerateWithTargetPath.DocumentKind)' == ''">
<DocumentKind>mvc</DocumentKind>
</RazorGenerateWithTargetPath>
</ItemGroup>
</Target>
<!--
Gathers input assemblies for Tag Helper discovery and compilation. Add items to @(ReferencePath)
-->
<Target
Name="ResolveAssemblyReferenceRazorGenerateInputs"
DependsOnTargets="ResolveReferences">
<ItemGroup>
<RazorReferencePath Include="@(ReferencePath)"/>
<!--
RazorReferencePath must include the closure of assemblies required for tag helper discovery to keep parity with the 2.1 Razor.Design package.
Use the component declaration assembly, if available or the IntermediateAssembly if no components are involved in the build.
-->
<RazorReferencePath
Include="$(_RazorComponentDeclarationAssemblyFullPath)"
Condition="'$(_RazorComponentDeclarationAssemblyFullPath)' != ''" />
<RazorReferencePath
Include="@(IntermediateAssembly->Metadata('FullPath'))"
Condition="'$(_RazorComponentDeclarationAssemblyFullPath)' == ''" />
</ItemGroup>
</Target>
<!--
Gathers inputs to the RazorCoreCompile target into the @(RazorCompile) itemgroup.
This is marker target so that the code generation targets can attach.
-->
<Target Name="ResolveRazorCompileInputs" DependsOnTargets="$(ResolveRazorCompileInputsDependsOn)">
</Target>
<Target Name="ResolveRazorEmbeddedResources" Condition="'$(EmbedRazorGenerateSources)'=='true'">
<ItemGroup>
<RazorEmbeddedResource Include="@(RazorGenerateWithTargetPath)">
<LogicalName>/$([System.String]::Copy('%(RazorGenerateWithTargetPath.TargetPath)').Replace('\','/'))</LogicalName>
<Type>Non-Resx</Type>
<WithCulture>false</WithCulture>
</RazorEmbeddedResource>
<!-- Similar to _GenerateCompileInputs -->
<_RazorCoreCompileResourceInputs
Include="@(RazorEmbeddedResource)"
Condition="'%(RazorEmbeddedResource.WithCulture)'=='false' and '%(RazorEmbeddedResource.Type)'=='Non-Resx' " />
</ItemGroup>
</Target>
<!--
This target is called after PrepareForPublish when RazorCompileOnPublish=true so that we can hook into publish.
This target just hooks up other targets since Publish and PrepareForPublish don't have a DependsOnTargets
property we can use.
-->
<Target
Name="_RazorPrepareForPublish"
AfterTargets="PrepareForPublish"
DependsOnTargets="RazorCompile"
Condition="'$(ResolvedRazorCompileToolset)'=='RazorSdk' and '$(RazorCompileOnPublish)'=='true' and '$(NoBuild)'!='true'">
</Target>
<Target
Name="_RazorAddDebugSymbolsProjectOutputGroupOutput"
DependsOnTargets="_ResolveRazorTargetPath;ResolveRazorGenerateInputs"
Condition="'$(ResolvedRazorCompileToolset)'=='RazorSdk' and '$(RazorCompileOnBuild)'=='true'">
<ItemGroup Condition="Exists('@(_RazorDebugSymbolsIntermediatePath)')">
<DebugSymbolsProjectOutputGroupOutput Include="%(_RazorDebugSymbolsIntermediatePath.FullPath)" FinalOutputPath="$(RazorTargetDir)$(RazorTargetName).pdb" />
</ItemGroup>
</Target>
<!--
Set up RazorCompile to run before PrepareForRun. This should ensure that the Razor dll and pdbs are available to be copied
as part of GetCopyToOutputDirectoryItems which is invoked during PrepareForRun.
-->
<Target
Name="_RazorPrepareForRun"
DependsOnTargets="RazorCompile"
Condition="'$(ResolvedRazorCompileToolset)'=='RazorSdk' and '$(RazorCompileOnBuild)'=='true'" />
<Target
Name="_RazorRemoveRefAssembliesFromPublish"
BeforeTargets="PrepareForPublish"
Condition="'$(ResolvedRazorCompileToolset)'=='RazorSdk' and '$(RazorCompileOnPublish)'=='true' AND '$(CopyRefAssembliesToPublishDirectory)' != ''">
<!--
Setting PreserveCompilationReferences affects both Build and Publish, but we want CopyRefAssembliesToPublishDirectory to only affect publishing.
Use the value of CopyRefAssembliesToPublishDirectory to determine PreserveCompilationReferences during publish.
-->
<PropertyGroup>
<PreserveCompilationReferences>$(CopyRefAssembliesToPublishDirectory)</PreserveCompilationReferences>
</PropertyGroup>
</Target>
<Target Name="_CheckForMissingRazorCompiler" Condition="'$(IsRazorCompilerReferenced)' != 'true'">
<Error
Code="RAZORSDK1003"
Text="A PackageReference for 'Microsoft.AspNetCore.Razor.Design' was not included in your project. This package is required to compile Razor files. Typically, a
transitive reference to 'Microsoft.AspNetCore.Razor.Design' and references required to compile Razor files are obtained by adding a PackageReference
for 'Microsoft.AspNetCore.Mvc' in your project. For more information, see https://go.microsoft.com/fwlink/?linkid=868374." />
</Target>
<Target Name="_CheckForIncorrectMvcConfiguration"
Condition="'@(ResolvedRazorConfiguration)' == 'Default' AND
('$(RazorCompileOnBuild)' == 'true' OR '$(RazorCompileOnPublish)' =='true') AND
'@(RazorGenerate->Count())' != '0' AND
'$(_Targeting30OrNewerRazorLangVersion)' == 'true' AND
'$(_IsTargetingRazor2X)' != 'true'">
<Warning
Code="RAZORSDK1004"
Text="One or more Razor view or page files were found, but the project is not configured to add Razor support for MVC. The MSBuild property 'AddRazorSupportForMvc' must be set to correctly compile Razor files that target MVC. For more information, see https://go.microsoft.com/fwlink/?linkid=868374." />
</Target>
<Target Name="_CheckForIncorrectComponentsConfiguration"
Condition="('$(RazorCompileOnBuild)' == 'true' OR '$(RazorCompileOnPublish)' =='true') AND
'@(RazorComponent->Count())' != '0' AND
'$(_Targeting30OrNewerRazorLangVersion)' != 'true' AND
'$(_IsTargetingRazor2X)' != 'true'">
<Warning
Code="RAZORSDK1005"
Text="One or more Razor component files (.razor) were found, but the project is not configured to compile Razor Components. Configure the project by targeting RazorLangVersion 3.0 or newer. For more information, see https://go.microsoft.com/fwlink/?linkid=868374." />
</Target>
<Target Name="_ResolveRazorTargetPath">
<PropertyGroup>
<RazorOutputPath Condition="'$(RazorOutputPath)'==''">$([MSBuild]::EnsureTrailingSlash('$(OutDir)'))</RazorOutputPath>
<RazorTargetDir>$([MSBuild]::Escape($([MSBuild]::EnsureTrailingSlash($([System.IO.Path]::GetFullPath('$([System.IO.Path]::Combine('$(MSBuildProjectDirectory)', '$(RazorOutputPath)'))'))))))</RazorTargetDir>
<!-- Example, c:\MyProjects\MyProject\bin\debug\MyAssembly.Views.dll -->
<RazorTargetPath Condition=" '$(RazorTargetPath)' == '' ">$(RazorTargetDir)$(RazorTargetName).dll</RazorTargetPath>
</PropertyGroup>
</Target>
<Target Name="_ResolveGeneratedRazorCompileInputs">
<ItemGroup>
<RazorCompile
Include="%(RazorGenerateWithTargetPath.GeneratedOutput)"
Condition="'%(RazorGenerateWithTargetPath.DocumentKind)'=='mvc'" />
</ItemGroup>
</Target>
<Target Name="_RazorSdkCustomCollectWatchItems">
<ItemGroup>
<Watch Include="%(Content.FullPath)" Condition="'%(Content.Extension)' == '.razor' AND '%(Content.Watch)' != 'false'" />
<Watch Include="%(None.FullPath)" Condition="($([System.String]::Copy('%(None.FullPath)').EndsWith('.razor.css')) OR $([System.String]::Copy('%(None.FullPath)').EndsWith('.cshtml.css'))) AND '%(None.Watch)' != 'false'" />
<Watch Include="%(Content.FullPath)"
Condition="'$(_Targeting30OrNewerRazorLangVersion)' == 'true' AND '$(AddCshtmlFilesToDotNetWatchList)' != 'false' AND '%(Content.Extension)' == '.cshtml' AND '%(Content.Watch)' != 'false'" />
</ItemGroup>
</Target>
<PropertyGroup Condition="'$(RazorDesignTimeTargets)'==''">
<RazorDesignTimeTargets>$(MSBuildExtensionsPath)\Microsoft\VisualStudio\Razor\Microsoft.NET.Sdk.Razor.DesignTime.targets</RazorDesignTimeTargets>
<RazorDesignTimeTargets Condition="!Exists('$(RazorDesignTimeTargets)')">$(MSBuildThisFileDirectory)Microsoft.NET.Sdk.Razor.DesignTime.targets</RazorDesignTimeTargets>
</PropertyGroup>
<Import Project="$(RazorDesignTimeTargets)" />
<PropertyGroup Condition="'$(_RazorUpToDateReloadFileTypesAllowWorkaround)' != 'false'">
<!--
Defines the list of file extensions that VS will monitor to reload the application.
We'll only define these for C# projects targeting RazorLangVersion 3.0 or later, and let VS use defaults in other cases.
This property can be removed after the next insertion in to VS.
-->
<UpToDateReloadFileTypes Condition="'$(Language)'=='C#' AND '$(_Targeting30OrNewerRazorLangVersion)' == 'true' AND '$(UpToDateReloadFileTypes)' == ''">$(RazorUpToDateReloadFileTypes)</UpToDateReloadFileTypes>
</PropertyGroup>
<!--
This is a hook to import a set of targets after the Razor targets. By default this is unused.
-->
<Import Project="$(CustomAfterRazorSdkTargets)" Condition="'$(CustomAfterRazorSdkTargets)' != '' and Exists('$(CustomAfterRazorSdkTargets)')"/>
</Project>
|