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
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)eng\BannedSymbols.txt" />
<AdditionalFiles Include="$(RepositoryEngineeringDir)BannedSymbols.txt" />

<!--
This language support type (used for init-only properties) is linked directly into every project to avoid conflicts with
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<NoWarn>$(NoWarn);Nullable</NoWarn>
</PropertyGroup>

<Import Project="eng\targets\Common.targets" />
<Import Project="$(RepositoryEngineeringDir)targets\Common.targets" />

<!-- Global Analyzer Config -->
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion eng/Version.Details.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
This file is auto-generated by the Maestro dependency flow system.
Do not edit it manually, as it will get overwritten by automation.
This file should be imported by eng/Versions.props
This file should be imported by $(RepositoryEngineeringDir)Versions.props
-->
<Project>
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(NetVS);netstandard2.0</TargetFrameworks>
Expand All @@ -25,7 +25,7 @@
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="$(RepoRoot)eng\BannedSymbols.MEFv1.txt" />
<AdditionalFiles Include="$(RepositoryEngineeringDir)BannedSymbols.MEFv1.txt" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>$(NetFxVS)</TargetFramework>
Expand All @@ -12,7 +12,7 @@
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="$(RepoRoot)eng\BannedSymbols.MEFv2.txt" />
<AdditionalFiles Include="$(RepositoryEngineeringDir)BannedSymbols.MEFv2.txt" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public override async Task InitializeAsync()

_projectFilePath = await CreateAndOpenBlazorProjectAsync(ControlledHangMitigatingCancellationToken);

await TestServices.SolutionExplorer.RestoreNuGetPackagesAsync(ControlledHangMitigatingCancellationToken);
await TestServices.Workspace.WaitForProjectSystemAsync(ControlledHangMitigatingCancellationToken);

// We open the Index.razor file, and wait for 3 RazorComponentElement's to be classified, as that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Razor.Test.Common;
using Microsoft.VisualStudio.Razor.IntegrationTests;
using Microsoft.VisualStudio.Razor.IntegrationTests.InProcess;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.TextManager.Interop;
using Microsoft.VisualStudio.Threading;
using NuGet.SolutionRestoreManager;
using Xunit;
using Task = System.Threading.Tasks.Task;

Expand Down Expand Up @@ -43,44 +41,6 @@ public async Task AddProjectAsync(string projectName, string projectTemplate, st
ErrorHandler.ThrowOnFailure(solution.AddNewProjectFromTemplate(projectTemplatePath, args.Any() ? args.ToArray() : null, null, projectPath, projectName, null, out _));
}

public async Task RestoreNuGetPackagesAsync(CancellationToken cancellationToken)
{
await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

var dte = await GetRequiredGlobalServiceAsync<SDTE, EnvDTE.DTE>(cancellationToken);
var solution = (EnvDTE80.Solution2)dte.Solution;
foreach (var project in solution.Projects.OfType<EnvDTE.Project>())
{
await RestoreNuGetPackagesAsync(project.FullName, cancellationToken);
}
}

public async Task RestoreNuGetPackagesAsync(string projectName, CancellationToken cancellationToken)
{
await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

await TestServices.Workspace.WaitForProjectSystemAsync(cancellationToken);

var solutionRestoreService = await GetComponentModelServiceAsync<IVsSolutionRestoreService>(cancellationToken);
await solutionRestoreService.CurrentRestoreOperation;

var projectFullPath = (await GetProjectAsync(projectName, cancellationToken)).FullName;
var solutionRestoreStatusProvider = await GetComponentModelServiceAsync<IVsSolutionRestoreStatusProvider>(cancellationToken);
if (await solutionRestoreStatusProvider.IsRestoreCompleteAsync(cancellationToken))
{
return;
}

var solutionRestoreService2 = (IVsSolutionRestoreService2)solutionRestoreService;
await solutionRestoreService2.NominateProjectAsync(projectFullPath, cancellationToken);

// Check IsRestoreCompleteAsync until it returns true (this stops the retry because true != default(bool))
await Helper.RetryAsync(
cancellationToken => solutionRestoreStatusProvider.IsRestoreCompleteAsync(cancellationToken),
TimeSpan.FromMilliseconds(50),
cancellationToken);
}

public async Task CloseSolutionAndWaitAsync(CancellationToken cancellationToken)
{
await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
Expand Down