Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<PackageVersion Include="BenchmarkDotNet" Version="$(_BenchmarkDotNetPackageVersion)" />
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="$(_BenchmarkDotNetPackageVersion)" />
<PackageVersion Include="DiffPlex" Version="1.7.2" />
<PackageVersion Include="MessagePack" Version="2.5.301" /> <!-- Update transitive vulnerable package -->
<PackageVersion Include="MessagePack" Version="2.5.303" /> <!-- Update transitive vulnerable package -->
<PackageVersion Include="Microsoft.AspNetCore.App.Runtime.$(NetCoreSDKRuntimeIdentifier)" Version="8.0.32" />
<PackageVersion Include="Microsoft.Build.Framework" Version="$(_MicrosoftBuildPackageVersion)" />
<PackageVersion Include="Microsoft.Build.Locator" Version="1.10.2" />
Expand Down Expand Up @@ -63,7 +63,6 @@
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="$(MicrosoftExtensionsObjectPoolPackageVersion)" />
<PackageVersion Include="Microsoft.Internal.VisualStudio.Shell.Framework" Version="$(_MicrosoftVisualStudioShellPackagesVersion)" />
<PackageVersion Include="Microsoft.Internal.VisualStudio.Interop" Version="$(_MicrosoftVisualStudioShellPackagesVersion)" />
<PackageVersion Include="Microsoft.NET.Sdk.Razor" Version="$(MicrosoftNETSdkRazorPackageVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Copilot" Version="0.2.28-beta" />
<PackageVersion Include="Microsoft.VisualStudio.Editor" Version="$(_MicrosoftVisualStudioPackagesVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Extensibility.Testing.Xunit" Version="$(_MicrosoftVisualStudioExtensibilityTestingVersion)" />
Expand Down
23 changes: 22 additions & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,28 @@ required to debug changes to any libraries licensed under the GNU Lesser General

---------------------------------------------------------

ASP.NET Core Razor design-time assets - Apache-2.0

Source: https://github.com/dotnet/aspnetcore/tree/20b6779cf3af2fed6a8fe64a0865cfab50b776bb/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0
Files: src/Shared/files/RazorDesignTime/Microsoft.NET.Sdk.Razor.DesignTime.targets
src/Shared/files/RazorDesignTime/Rules/*.xaml

Copyright (c) .NET Foundation. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

---------------------------------------------------------

Castle.Core 4.3.1 - Apache-2.0


Expand Down Expand Up @@ -5597,4 +5619,3 @@ CopyrightTableDirectory BoundImportTableDirectory DelayImportTableDirectory
CopyrightAttributesNotFound DefaultArgumentAlreadyDefined DescriptionAttributesNotFound

---------------------------------------------------------

2 changes: 0 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
Versions below this comment are not managed by automation and can be changed as needed.
-->
<PropertyGroup Label="Manual">
<!-- dotnet/runtime packages -->
<MicrosoftNETSdkRazorPackageVersion>6.0.0-alpha.1.21072.5</MicrosoftNETSdkRazorPackageVersion>
<!--
These are properties that control the versions of the various packages that are used in arcade. They control
PackageReference versions directly in arcade.
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"tools": {
"dotnet": "9.0.121",
"dotnet": "9.0.122",
"runtimes": {
"dotnet": [
"2.1.30",
Expand All @@ -16,7 +16,7 @@
}
},
"sdk": {
"version": "9.0.121",
"version": "9.0.122",
"allowPrerelease": false,
"rollForward": "latestPatch"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>$(NetFxVS)</TargetFramework>
<Description>Razor is a markup syntax for adding server-side logic to web pages. This package contains the Razor design-time infrastructure for Visual Studio.</Description>
<EnableApiCheck>false</EnableApiCheck>
<RulesDirectory>$(PkgMicrosoft_NET_Sdk_Razor)\build\netstandard2.0\Rules\</RulesDirectory>
<RulesDirectory>$(SharedFilesRoot)RazorDesignTime\Rules\</RulesDirectory>
<IsShippingPackage>false</IsShippingPackage>
<ExcludeFromSourceOnlyBuild>true</ExcludeFromSourceOnlyBuild>
<IsPackable Condition="'$(OS)' != 'Windows_NT'">false</IsPackable>
Expand All @@ -20,7 +20,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk.Razor" IncludeAssets="None" PrivateAssets="All" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.VisualStudio.Editor" />
<PackageReference Include="Microsoft.VisualStudio.LanguageServices" />
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem.SDK" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
<!-- Import the list of service hub services we proffer, to generate various files to include in the VSIX -->
<Import Project="$(RepositoryEngineeringDir)targets\Services.props" />

<!-- Include Razor SDK design time assets in the VSIX -->
<!-- Include only the copied design-time assets, without restoring the SDK's unused task assemblies. -->
<ItemGroup>
<Content Include="$(PkgMicrosoft_NET_Sdk_Razor)\build\netstandard2.0\Microsoft.NET.Sdk.Razor.DesignTime.targets">
<Content Include="$(SharedFilesRoot)RazorDesignTime\Microsoft.NET.Sdk.Razor.DesignTime.targets">
<IncludeInVsix>true</IncludeInVsix>
<InstallRoot>MSBuild</InstallRoot>
<VSIXSubPath>Microsoft\VisualStudio\Razor\</VSIXSubPath>
</Content>
<Content Include="$(PkgMicrosoft_NET_Sdk_Razor)\build\netstandard2.0\Rules\*.xaml">
<Content Include="$(SharedFilesRoot)RazorDesignTime\Rules\*.xaml">
<IncludeInVsix>true</IncludeInVsix>
<InstallRoot>MSBuild</InstallRoot>
<VSIXSubPath>Microsoft\VisualStudio\Razor\Rules\</VSIXSubPath>
Expand Down Expand Up @@ -200,7 +200,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk.Razor" IncludeAssets="None" PrivateAssets="All" GeneratePathProperty="true" />
<PackageReference Include="System.Resources.Extensions" />
<PackageReference Include="Microsoft.VisualStudio.Shell.15.0" />
<!-- Manually upgrade to address CG alert. When the VS packages
Expand Down
8 changes: 7 additions & 1 deletion src/Razor/src/rzls/Targets/Readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### Note

This (and code in Rules) was pulled from the [sdk](https://github.com/dotnet/sdk/blob/8f983a2c12162e49af7a7f2eb7744d220859f42b/src/RazorSdk/Targets/Microsoft.NET.Sdk.Razor.DesignTime.targets). These files are for tooling to define specific design time behavior and thus should be owned by tooling. As of writing these are only used in VS Code.
This (and code in Rules) was pulled from the [sdk](https://github.com/dotnet/sdk/blob/8f983a2c12162e49af7a7f2eb7744d220859f42b/src/RazorSdk/Targets/Microsoft.NET.Sdk.Razor.DesignTime.targets). These files are for tooling to define specific design time behavior and thus should be owned by tooling. As of writing these are only used in VS Code.

Visual Studio uses a separate copy in `src/Shared/files/RazorDesignTime`. Those six files preserve the exact bytes from `Microsoft.NET.Sdk.Razor` version `6.0.0-alpha.1.21072.5`, including the visible fields in `RazorExtension.xaml`. Their source is [dotnet/aspnetcore at commit 20b6779cf3af2fed6a8fe64a0865cfab50b776bb](https://github.com/dotnet/aspnetcore/tree/20b6779cf3af2fed6a8fe64a0865cfab50b776bb/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0); the package uses CRLF where the source uses LF.

Generated-rule fallback names hash the XAML bytes, so the scoped `.gitattributes` disables line-ending conversion for these files. Preserve their original bytes when updating them.

Keeping only the design-time target and five rules avoids restoring the SDK's unused task assemblies. The scoped `cgmanifest.json` records their provenance, and `NOTICE.txt` includes the Apache-2.0 attribution. Keep the VS and VS Code copies separate unless their behaviour has been checked together.
3 changes: 3 additions & 0 deletions src/Shared/files/RazorDesignTime/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Generated-rule fallback names hash these bytes. Preserve the original package's line endings.
Microsoft.NET.Sdk.Razor.DesignTime.targets -text
Rules/*.xaml -text
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<!--
***********************************************************************************************
Microsoft.NET.Sdk.Razor.DesignTime.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">

<PropertyGroup>
<!--
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.
-->
<UpToDateReloadFileTypes Condition="'$(Language)'=='C#' AND '$(_Targeting30OrNewerRazorLangVersion)' == 'true' AND '$(RazorUpToDateReloadFileTypes)' != ''">$(UpToDateReloadFileTypes);$(RazorUpToDateReloadFileTypes)</UpToDateReloadFileTypes>
</PropertyGroup>

<ItemGroup>
<!--
Defines the generic .NET Core 'Razor' capability.

Note that we don't define any capabilities here that depend on the version of the runtime/toolset
in use by the project. Those capabilities are defined by the relevant runtime packages so that
we use the lack of the capability to detect downlevel scenarios.
-->
<ProjectCapability Include="DotNetCoreRazor"/>

<!--
Defines the ability to understand the configuration for the Razor language service provided by
the runtime/toolset packages. Introduced in 2.1
-->
<ProjectCapability Include="DotNetCoreRazorConfiguration" Condition="'$(_Targeting30OrNewerRazorLangVersion)' == 'true'"/>

<!--
Activates the set of nesting behaviors we want from solution explorer.
-->
<ProjectCapability Include="WebNestingDefaults" />

<!--
Tooling support for TypeScript files.
-->
<ProjectCapability Include="SupportsTypeScriptNuGet" />
</ItemGroup>

<!--
In order to properly support Blazor partial classes we need to ensure that older SDKs don't
add declaration files to the compile list. We do all the compilation work in-memory in latest
VS.
-->
<Target Name="_RemoveRazorDeclartionsFromCompile" AfterTargets="RazorGenerateComponentDeclaration">
<ItemGroup Condition="'$(DesignTimeBuild)'=='true'">
<Compile Remove="@(_RazorComponentDeclaration)" />
</ItemGroup>
</Target>

<!--
WebSdk imports these capabilities for nesting in DotNetCoreWeb projects.
Conditinally import these capabilities if the project isn't targeting the WebSdk.
-->
<ItemGroup Condition="'$(UsingMicrosoftNETSdkWeb)'==''">
<ProjectCapability Include="SupportHierarchyContextSvc" />
<ProjectCapability Include="DynamicDependentFile" />
<ProjectCapability Include="DynamicFileNesting" />
</ItemGroup>

<ItemGroup>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)Rules\RazorConfiguration.xaml">
<Context>File</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)Rules\RazorExtension.xaml">
<Context>File</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)Rules\RazorGeneral.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)Rules\RazorGenerateWithTargetPath.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)Rules\RazorComponentWithTargetPath.xaml">
<Context>Project</Context>
</PropertyPageSchema>
</ItemGroup>

<Target
Name="RazorGenerateDesignTime"
DependsOnTargets="ResolveRazorGenerateInputs;AssignRazorGenerateTargetPaths"
Returns="@(RazorGenerateWithTargetPath)">
</Target>

<!--
Using DependsOnTargets here because real dependencies of this target aren't defined in
a downlevel (pre-3.0) SDK.
-->
<Target
Name="RazorGenerateComponentDesignTime"
DependsOnTargets="$(_RazorGenerateComponentDesignTimeDependsOn)"
Returns="@(RazorComponentWithTargetPath)">
</Target>


<!--
Using DependsOnTargets here because real dependencies of this target aren't defined in
a downlevel (pre-3.0) SDK.

Called by the project system to update generated declaration files
-->
<Target
Name="RazorGenerateComponentDeclarationDesignTime"
DependsOnTargets="$(_RazorGenerateComponentDeclarationDesignTimeDependsOn)">
</Target>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<Rule
Description="Razor Document Properties"
DisplayName="Razor Document Properties"
Name="RazorComponentWithTargetPath"
PageTemplate="generic"
xmlns="http://schemas.microsoft.com/build/2009/properties">
<Rule.DataSource>
<DataSource
Persistence="ProjectFile"
ItemType="RazorComponentWithTargetPath"
MSBuildTarget="RazorGenerateComponentDesignTime"
HasConfigurationCondition="False"
SourceOfDefaultValue="AfterContext"
SourceType="TargetResults" />
</Rule.DataSource>

<Rule.Categories>
<Category
Name="General"
DisplayName="General" />
</Rule.Categories>

<StringProperty
Category="General"
Name="TargetPath"
ReadOnly="True"
Visible="False" />

</Rule>
29 changes: 29 additions & 0 deletions src/Shared/files/RazorDesignTime/Rules/RazorConfiguration.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<Rule
Description="Configuration Properties"
DisplayName="Configuration Properties"
Name="RazorConfiguration"
PageTemplate="generic"
xmlns="http://schemas.microsoft.com/build/2009/properties">
<Rule.DataSource>
<DataSource
Persistence="ProjectFile"
HasConfigurationCondition="True"
ItemType="RazorConfiguration" />
</Rule.DataSource>

<Rule.Categories>
<Category
Name="General"
DisplayName="General" />
</Rule.Categories>

<StringProperty
Category="General"
Description="Razor Extensions"
DisplayName="Razor Extensions"
Name="Extensions"
ReadOnly="True"
Visible="True" />

</Rule>
37 changes: 37 additions & 0 deletions src/Shared/files/RazorDesignTime/Rules/RazorExtension.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<Rule
Description="Extension Properties"
DisplayName="Extension Properties"
Name="RazorExtension"
PageTemplate="generic"
xmlns="http://schemas.microsoft.com/build/2009/properties">
<Rule.DataSource>
<DataSource
Persistence="ProjectFile"
HasConfigurationCondition="True"
ItemType="RazorExtension" />
</Rule.DataSource>

<Rule.Categories>
<Category
Name="General"
DisplayName="General" />
</Rule.Categories>

<StringProperty
Category="General"
Description="Razor Extension Assembly Name"
DisplayName="Razor Extension Assembly Name"
Name="AssemblyName"
ReadOnly="True"
Visible="True" />

<StringProperty
Category="General"
Description="Razor Extension Assembly File Path"
DisplayName="Razor Extension Assembly File Path"
Name="AssemblyFilePath"
ReadOnly="True"
Visible="True" />

</Rule>
36 changes: 36 additions & 0 deletions src/Shared/files/RazorDesignTime/Rules/RazorGeneral.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<Rule
Description="Razor Properties"
DisplayName="Razor Properties"
Name="RazorGeneral"
PageTemplate="generic"
xmlns="http://schemas.microsoft.com/build/2009/properties">
<Rule.DataSource>
<DataSource
Persistence="ProjectFile"
HasConfigurationCondition="True" />
</Rule.DataSource>

<Rule.Categories>
<Category
Name="General"
DisplayName="General" />
</Rule.Categories>

<StringProperty
Category="General"
Description="Razor Language Version"
DisplayName="Razor Language Version"
Name="RazorLangVersion"
ReadOnly="True"
Visible="True" />

<StringProperty
Category="General"
Description="Razor Configuration Name"
DisplayName="Razor Configuration Name"
Name="RazorDefaultConfiguration"
ReadOnly="True"
Visible="True" />

</Rule>
Loading