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
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="$(MicrosoftCodeAnalysisPackageVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="$(MicrosoftCodeAnalysisPackageVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="$(MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.ExternalAccess.HotReload" Version="$(MicrosoftCodeAnalysisExternalAccessHotReloadPackageVersion)" />

<!-- roslyn-sdk dependencies-->
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" Version="1.1.2" />
Expand Down
4 changes: 4 additions & 0 deletions eng/Publishing.props
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
<Artifact Remove="@(MsiPackages)" />
</ItemGroup>

<ItemGroup Condition="'$(PublishingWorkloadMsiInternal)' == 'true'">
<Artifact Update="$(ArtifactsShippingPackagesDir)*.Msi.*.nupkg" Visibility="Internal" />
</ItemGroup>

<Target Name="GetNonStableProductVersion">
<!-- Retrieve the non-stable product version. -->
<MSBuild Projects="$(RepoRoot)src\Layout\redist\redist.csproj"
Expand Down
228 changes: 114 additions & 114 deletions eng/Version.Details.props

Large diffs are not rendered by default.

330 changes: 167 additions & 163 deletions eng/Version.Details.xml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
At usage sites, either we use MicrosoftBuildMinimumVersion, or MicrosoftBuildVersion in source-only modes.

Additionally, set the MinimumVSVersion for the installer UI that's required for targeting NetCurrent -->
<MicrosoftBuildMinimumVersion Condition="'$(DotNetBuildSourceOnly)' != 'true'">17.14.8</MicrosoftBuildMinimumVersion>
<MicrosoftBuildMinimumVersion Condition="'$(DotNetBuildSourceOnly)' != 'true'">17.14.28</MicrosoftBuildMinimumVersion>
<MinimumVSVersion>18.0</MinimumVSVersion>
</PropertyGroup>
<PropertyGroup>
Expand All @@ -126,7 +126,7 @@
</PropertyGroup>
<PropertyGroup Label="Manually updated">
<!-- Dependencies from https://github.com/microsoft/MSBuildLocator -->
<MicrosoftBuildLocatorPackageVersion>1.8.1</MicrosoftBuildLocatorPackageVersion>
<MicrosoftBuildLocatorPackageVersion>1.10.2</MicrosoftBuildLocatorPackageVersion>
<MicrosoftCodeAnalysisCSharpAnalyzerPinnedVersionPackageVersion>4.0.1</MicrosoftCodeAnalysisCSharpAnalyzerPinnedVersionPackageVersion>
</PropertyGroup>
<!-- Get .NET Framework reference assemblies from NuGet packages -->
Expand Down
17 changes: 15 additions & 2 deletions eng/common/SetupNugetSources.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This script adds internal feeds required to build commits that depend on internal package sources. For instance,
# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables
# disabled internal Maestro (darc-int*) feeds.
# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. Similarly,
# dotnet-eng-internal and dotnet-tools-internal are added if dotnet-eng and dotnet-tools are present.
# In addition, this script also enables disabled internal Maestro (darc-int*) feeds.
#
# Optionally, this script also adds a credential entry for each of the internal feeds if supplied.
#
Expand Down Expand Up @@ -173,4 +174,16 @@ foreach ($dotnetVersion in $dotnetVersions) {
}
}

# Check for dotnet-eng and add dotnet-eng-internal if present
$dotnetEngSource = $sources.SelectSingleNode("add[@key='dotnet-eng']")
if ($dotnetEngSource -ne $null) {
AddOrEnablePackageSource -Sources $sources -DisabledPackageSources $disabledSources -SourceName "dotnet-eng-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-eng-internal/nuget/$feedSuffix" -Creds $creds -Username $userName -pwd $Password
}

# Check for dotnet-tools and add dotnet-tools-internal if present
$dotnetToolsSource = $sources.SelectSingleNode("add[@key='dotnet-tools']")
if ($dotnetToolsSource -ne $null) {
AddOrEnablePackageSource -Sources $sources -DisabledPackageSources $disabledSources -SourceName "dotnet-tools-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/$feedSuffix" -Creds $creds -Username $userName -pwd $Password
}

$doc.Save($filename)
17 changes: 15 additions & 2 deletions eng/common/SetupNugetSources.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env bash

# This script adds internal feeds required to build commits that depend on internal package sources. For instance,
# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables
# disabled internal Maestro (darc-int*) feeds.
# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. Similarly,
# dotnet-eng-internal and dotnet-tools-internal are added if dotnet-eng and dotnet-tools are present.
# In addition, this script also enables disabled internal Maestro (darc-int*) feeds.
#
# Optionally, this script also adds a credential entry for each of the internal feeds if supplied.
#
Expand Down Expand Up @@ -173,6 +174,18 @@ for DotNetVersion in ${DotNetVersions[@]} ; do
fi
done

# Check for dotnet-eng and add dotnet-eng-internal if present
grep -i "<add key=\"dotnet-eng\"" $ConfigFile > /dev/null
if [ "$?" == "0" ]; then
AddOrEnablePackageSource "dotnet-eng-internal" "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-eng-internal/nuget/$FeedSuffix"
fi

# Check for dotnet-tools and add dotnet-tools-internal if present
grep -i "<add key=\"dotnet-tools\"" $ConfigFile > /dev/null
if [ "$?" == "0" ]; then
AddOrEnablePackageSource "dotnet-tools-internal" "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/$FeedSuffix"
fi

# I want things split line by line
PrevIFS=$IFS
IFS=$'\n'
Expand Down
5 changes: 5 additions & 0 deletions eng/common/core-templates/job/publish-build-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ jobs:
PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }}
is1ESPipeline: ${{ parameters.is1ESPipeline }}

# Darc is targeting 8.0, so make sure it's installed
- task: UseDotNet@2
inputs:
version: 8.0.x

- task: AzureCLI@2
displayName: Publish Using Darc
inputs:
Expand Down
5 changes: 5 additions & 0 deletions eng/common/core-templates/post-build/post-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,11 @@ stages:

- task: NuGetAuthenticate@1

# Darc is targeting 8.0, so make sure it's installed
- task: UseDotNet@2
inputs:
version: 8.0.x

- task: AzureCLI@2
displayName: Publish Using Darc
inputs:
Expand Down
6 changes: 3 additions & 3 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"errorMessage": "The .NET SDK is not installed or is not configured correctly. Please run ./build to install the correct SDK version locally."
},
"tools": {
"dotnet": "10.0.100-rc.1.25451.107",
"dotnet": "10.0.100-rc.2.25502.107",
"runtimes": {
"dotnet": [
"$(MicrosoftNETCorePlatformsPackageVersion)"
Expand All @@ -21,8 +21,8 @@
}
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25522.2",
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25522.2",
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25556.109",
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25556.109",
"Microsoft.Build.NoTargets": "3.7.0",
"Microsoft.Build.Traversal": "3.4.0",
"Microsoft.WixToolset.Sdk": "5.0.2-dotnet.2811440"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
-->
<TargetFrameworks>net6.0;net10.0</TargetFrameworks>
<StrongNameKeyId>MicrosoftAspNetCore</StrongNameKeyId>

<DisableTransitiveFrameworkReferenceDownloads Condition="'$(DotNetBuildSourceOnly)' == 'true'">true</DisableTransitiveFrameworkReferenceDownloads>
</PropertyGroup>

<!-- Reference 6.0.0 targeting packs in Source Build -->
Expand Down
32 changes: 16 additions & 16 deletions src/BuiltInTools/dotnet-watch/HotReload/CompilationHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.Build.Graph;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.ExternalAccess.Watch.Api;
using Microsoft.CodeAnalysis.ExternalAccess.HotReload.Api;
using Microsoft.DotNet.HotReload;
using Microsoft.Extensions.Logging;

Expand All @@ -16,7 +16,7 @@ internal sealed class CompilationHandler : IDisposable
{
public readonly IncrementalMSBuildWorkspace Workspace;
private readonly ILogger _logger;
private readonly WatchHotReloadService _hotReloadService;
private readonly HotReloadService _hotReloadService;
private readonly ProcessRunner _processRunner;

/// <summary>
Expand All @@ -35,7 +35,7 @@ internal sealed class CompilationHandler : IDisposable
/// <summary>
/// All updates that were attempted. Includes updates whose application failed.
/// </summary>
private ImmutableList<WatchHotReloadService.Update> _previousUpdates = [];
private ImmutableList<HotReloadService.Update> _previousUpdates = [];

private bool _isDisposed;

Expand All @@ -44,7 +44,7 @@ public CompilationHandler(ILogger logger, ProcessRunner processRunner)
_logger = logger;
_processRunner = processRunner;
Workspace = new IncrementalMSBuildWorkspace(logger);
_hotReloadService = new WatchHotReloadService(Workspace.CurrentSolution.Services, () => ValueTask.FromResult(GetAggregateCapabilities()));
_hotReloadService = new HotReloadService(Workspace.CurrentSolution.Services, () => ValueTask.FromResult(GetAggregateCapabilities()));
}

public void Dispose()
Expand Down Expand Up @@ -299,7 +299,7 @@ private static void PrepareCompilations(Solution solution, string projectPath, C
}

public async ValueTask<(
ImmutableArray<WatchHotReloadService.Update> projectUpdates,
ImmutableArray<HotReloadService.Update> projectUpdates,
ImmutableArray<string> projectsToRebuild,
ImmutableArray<string> projectsToRedeploy,
ImmutableArray<RunningProject> projectsToRestart)> HandleManagedCodeChangesAsync(
Expand All @@ -315,14 +315,14 @@ private static void PrepareCompilations(Solution solution, string projectPath, C
let runningProject = GetCorrespondingRunningProject(project, runningProjects)
where runningProject != null
let autoRestartProject = autoRestart || runningProject.ProjectNode.IsAutoRestartEnabled()
select (project.Id, info: new WatchHotReloadService.RunningProjectInfo() { RestartWhenChangesHaveNoEffect = autoRestartProject }))
select (project.Id, info: new HotReloadService.RunningProjectInfo() { RestartWhenChangesHaveNoEffect = autoRestartProject }))
.ToImmutableDictionary(e => e.Id, e => e.info);

var updates = await _hotReloadService.GetUpdatesAsync(currentSolution, runningProjectInfos, cancellationToken);

await DisplayResultsAsync(updates, runningProjectInfos, cancellationToken);

if (updates.Status is WatchHotReloadService.Status.NoChangesToApply or WatchHotReloadService.Status.Blocked)
if (updates.Status is HotReloadService.Status.NoChangesToApply or HotReloadService.Status.Blocked)
{
// If Hot Reload is blocked (due to compilation error) we ignore the current
// changes and await the next file change.
Expand Down Expand Up @@ -364,7 +364,7 @@ private static void PrepareCompilations(Solution solution, string projectPath, C
return (updates.ProjectUpdates, projectsToRebuild, projectsToRedeploy, projectsToRestart);
}

public async ValueTask ApplyUpdatesAsync(ImmutableArray<WatchHotReloadService.Update> updates, CancellationToken cancellationToken)
public async ValueTask ApplyUpdatesAsync(ImmutableArray<HotReloadService.Update> updates, CancellationToken cancellationToken)
{
Debug.Assert(!updates.IsEmpty);

Expand Down Expand Up @@ -403,7 +403,7 @@ await ForEachProjectAsync(projectsToUpdate, async (runningProject, cancellationT
}

// msbuild workspace doesn't set TFM if the project is not multi-targeted
var tfm = WatchHotReloadService.GetTargetFramework(project);
var tfm = HotReloadService.GetTargetFramework(project);
if (tfm == null)
{
return projectsWithPath[0];
Expand All @@ -412,18 +412,18 @@ await ForEachProjectAsync(projectsToUpdate, async (runningProject, cancellationT
return projectsWithPath.SingleOrDefault(p => string.Equals(p.ProjectNode.GetTargetFramework(), tfm, StringComparison.OrdinalIgnoreCase));
}

private async ValueTask DisplayResultsAsync(WatchHotReloadService.Updates2 updates, ImmutableDictionary<ProjectId, WatchHotReloadService.RunningProjectInfo> runningProjectInfos, CancellationToken cancellationToken)
private async ValueTask DisplayResultsAsync(HotReloadService.Updates updates, ImmutableDictionary<ProjectId, HotReloadService.RunningProjectInfo> runningProjectInfos, CancellationToken cancellationToken)
{
switch (updates.Status)
{
case WatchHotReloadService.Status.ReadyToApply:
case HotReloadService.Status.ReadyToApply:
break;

case WatchHotReloadService.Status.NoChangesToApply:
case HotReloadService.Status.NoChangesToApply:
_logger.Log(MessageDescriptor.NoCSharpChangesToApply);
break;

case WatchHotReloadService.Status.Blocked:
case HotReloadService.Status.Blocked:
_logger.Log(MessageDescriptor.UnableToApplyChanges);
break;

Expand Down Expand Up @@ -451,7 +451,7 @@ await ForEachProjectAsync(

void ReportCompilationDiagnostics(DiagnosticSeverity severity)
{
foreach (var diagnostic in updates.CompilationDiagnostics)
foreach (var diagnostic in updates.PersistentDiagnostics)
{
if (diagnostic.Id == "CS8002")
{
Expand Down Expand Up @@ -492,7 +492,7 @@ void ReportRudeEdits()
.Where(p => !updates.ProjectsToRestart.ContainsKey(p))
.ToHashSet();

foreach (var (projectId, diagnostics) in updates.RudeEdits)
foreach (var (projectId, diagnostics) in updates.TransientDiagnostics)
{
foreach (var diagnostic in diagnostics)
{
Expand Down Expand Up @@ -689,7 +689,7 @@ public bool TryGetRunningProject(string projectPath, out ImmutableArray<RunningP
private static Task ForEachProjectAsync(ImmutableDictionary<string, ImmutableArray<RunningProject>> projects, Func<RunningProject, CancellationToken, Task> action, CancellationToken cancellationToken)
=> Task.WhenAll(projects.SelectMany(entry => entry.Value).Select(project => action(project, cancellationToken))).WaitAsync(cancellationToken);

private static ImmutableArray<HotReloadManagedCodeUpdate> ToManagedCodeUpdates(ImmutableArray<WatchHotReloadService.Update> updates)
private static ImmutableArray<HotReloadManagedCodeUpdate> ToManagedCodeUpdates(ImmutableArray<HotReloadService.Update> updates)
=> [.. updates.Select(update => new HotReloadManagedCodeUpdate(update.ModuleId, update.MetadataDelta, update.ILDelta, update.PdbDelta, update.UpdatedTypes, update.RequiredCapabilities))];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Collections.Immutable;
using System.Diagnostics;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.ExternalAccess.Watch.Api;
using Microsoft.CodeAnalysis.ExternalAccess.HotReload.Api;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.MSBuild;
using Microsoft.CodeAnalysis.Text;
Expand Down Expand Up @@ -76,7 +76,7 @@ public async Task UpdateProjectConeAsync(string rootProjectPath, CancellationTok
continue;
}

newSolution = WatchHotReloadService.WithProjectInfo(newSolution, ProjectInfo.Create(
newSolution = HotReloadService.WithProjectInfo(newSolution, ProjectInfo.Create(
oldProjectId,
newProjectInfo.Version,
newProjectInfo.Name,
Expand Down
1 change: 1 addition & 0 deletions src/BuiltInTools/dotnet-watch/dotnet-watch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<PackageReference Include="Microsoft.Build.Locator" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" />
<PackageReference Include="Microsoft.CodeAnalysis.ExternalAccess.HotReload" />
<PackageReference Include="Microsoft.NET.StringTools" ExcludeAssets="runtime" PrivateAssets="All" />

<Compile Include="$(RepoRoot)src\Common\PathUtilities.cs" LinkBase="Common" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ private IEnumerable<string> GetCscArguments(
[
"/unsafe-",
"/checked-",
"/nowarn:1701,1702,IL2121,1701,1702",
"/nowarn:1701,1702,IL2121,1701,1702,8002",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Needed due to dotnet/roslyn#80596

"/fullpaths",
"/nostdlib+",
"/errorreport:prompt",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,8 @@ internal class GlobalPrefixRemover : CSharpSyntaxRewriter
{
public static readonly GlobalPrefixRemover Singleton = new();

private const string GlobalPrefix = "global";

public override SyntaxNode? VisitQualifiedName(QualifiedNameSyntax node)
{
if (node.Left is AliasQualifiedNameSyntax alias &&
alias.Alias.Identifier.Text == GlobalPrefix)
{
node = SyntaxFactory.QualifiedName(alias.Name, node.Right).WithTriviaFrom(node);
}
return base.VisitQualifiedName(node);
}
public override SyntaxNode? VisitAliasQualifiedName(AliasQualifiedNameSyntax node)
=> node.Alias.Identifier.IsKind(SyntaxKind.GlobalKeyword)
? node.Name.WithTriviaFrom(node)
: base.VisitAliasQualifiedName(node);
}
2 changes: 2 additions & 0 deletions src/RazorSdk/Tool/GenerateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#nullable disable

using System.Diagnostics;
using System.Threading;
using Microsoft.AspNetCore.Razor.Language;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.NET.Sdk.Razor.Tool.CommandLineUtils;
Expand Down Expand Up @@ -433,6 +434,7 @@ private class StaticTagHelperFeature : RazorEngineFeatureBase, ITagHelperFeature
{
public IReadOnlyList<TagHelperDescriptor> TagHelpers { get; set; }

public IReadOnlyList<TagHelperDescriptor> GetDescriptors(CancellationToken cancellationToken) => TagHelpers;
public IReadOnlyList<TagHelperDescriptor> GetDescriptors() => TagHelpers;
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/Microsoft.NET.Build.Tests/RoslynBuildTaskTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void FullMSBuild_SdkStyle_ToolsetPackage(bool useSharedCompilation, Langu
{
var testAsset = CreateProject(useSharedCompilation, language, AddCompilersToolsetPackage);
var buildCommand = BuildAndRunUsingMSBuild(testAsset);
VerifyCompiler(buildCommand, AppHostCompilerFileName(language), useSharedCompilation, toolsetPackage: true);
VerifyCompiler(buildCommand, DotNetExecCompilerFileName(language), useSharedCompilation, toolsetPackage: true);
}

[Theory, CombinatorialData]
Expand Down
Loading