Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to net9 #11535

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
8 changes: 6 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@

<DefaultNetFxTargetFramework>net472</DefaultNetFxTargetFramework>

<NetVS>net8.0</NetVS>
<NetVSCode>net9.0</NetVSCode>
<NetRazorAll>net8.0;net9.0</NetRazorAll>

<!-- Uncomment this line to run formatting on runtime code-gen if FUSE is turned on -->
<!-- <DefineConstants>$(DefineConstants);FORMAT_FUSE</DefineConstants> -->
</PropertyGroup>
Expand Down Expand Up @@ -81,8 +85,8 @@
-->
<Otherwise>
<PropertyGroup>
<DefaultNetCoreTargetFramework>net8.0</DefaultNetCoreTargetFramework>
<DefaultNetCoreTargetFrameworks>$(DefaultNetCoreTargetFramework)</DefaultNetCoreTargetFrameworks>
<DefaultNetCoreTargetFramework>$(NetVS)</DefaultNetCoreTargetFramework>
<DefaultNetCoreTargetFrameworks>$(NetRazorAll)</DefaultNetCoreTargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ public static byte[] GetResourceBytes(string name, string? folder = null)
using var stream = GetResourceStream(name, folder);

value = new byte[stream.Length];

#if NET
stream.ReadExactly(value);
#else
stream.Read(value, 0, value.Length);
#endif

s_bytesMap.Add(key, value);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public static void WriteSize(this Stream stream, int length)
public unsafe static int ReadSize(this Stream stream)
{
Span<byte> bytes = stackalloc byte[4];
stream.Read(bytes);
stream.ReadExactly(bytes);
return BitConverter.ToInt32(bytes);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<TargetFramework>$(NetVSCode)</TargetFramework>
<OutputType>Library</OutputType>
<Description>Razor is a markup syntax for adding server-side logic to web pages. This package contains the language server assets for C# DevKit.</Description>
<EnableApiCheck>false</EnableApiCheck>
Expand Down
2 changes: 1 addition & 1 deletion src/Razor/src/rzls/rzls.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<TargetFramework>$(NetVSCode)</TargetFramework>
<OutputType>Exe</OutputType>
<Description>Razor is a markup syntax for adding server-side logic to web pages. This package
contains a Razor language server.</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ public static byte[] GetResourceBytes(string name, string? folder = null)
using var stream = GetResourceStream(name, folder);

value = new byte[stream.Length];

#if NET
stream.ReadExactly(value);
#else
stream.Read(value, 0, value.Length);
#endif

s_bytesMap.Add(key, value);

Expand Down