Skip to content

Commit ce2aa7c

Browse files
committed
More updates
1 parent 185ba8e commit ce2aa7c

File tree

4 files changed

+5
-19
lines changed

4 files changed

+5
-19
lines changed

src/Components/Shared/src/ResourceCollectionProvider.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
namespace Microsoft.AspNetCore.Components;
99

10+
using static Microsoft.AspNetCore.Internal.LinkerFlags;
11+
1012
internal class ResourceCollectionProvider
1113
{
1214
private const string ResourceCollectionUrlKey = "__ResourceCollectionUrl";
@@ -52,6 +54,7 @@ internal void SetResourceCollection(ResourceAssetCollection resourceCollection)
5254
_resourceCollection = resourceCollection;
5355
}
5456

57+
[DynamicDependency(JsonSerialized, typeof(ResourceAsset))]
5558
private async Task<ResourceAssetCollection> LoadResourceCollection()
5659
{
5760
if (_url == null)

src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868

6969
<ItemGroup>
7070
<_ExistingFilesFromLastRun Include="$(TestTemplateCreationFolder)**\*" />
71-
<!-- <_ExistingFilesFromLastRun Include="$(TemplateTestDotNetRoot)**\*" /> -->
7271
</ItemGroup>
7372

7473
<Delete Files="@(_ExistingFilesFromLastRun)" ContinueOnError="true" />

src/Shared/CommandLineUtils/Utilities/DotNetMuxer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using System;
1010
using System.Diagnostics;
1111
using System.IO;
12+
using System.Linq;
1213
using System.Reflection;
1314
using System.Runtime.InteropServices;
1415

src/Shared/test/Shared.Tests/DotNetMuxerTests.cs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,11 @@ public class DotNetMuxerTests
1414
[Fact]
1515
public void FindsTheMuxer()
1616
{
17-
18-
var muxerPath = DotNetMuxer.TryFindMuxerPath(GetDotnetPath());
17+
var muxerPath = DotNetMuxer.MuxerPath;
1918
Assert.NotNull(muxerPath);
2019
Assert.True(File.Exists(muxerPath), "The file did not exist");
2120
Assert.True(Path.IsPathRooted(muxerPath), "The path should be rooted");
2221
Assert.Equal("dotnet", Path.GetFileNameWithoutExtension(muxerPath), ignoreCase: true);
23-
24-
static string GetDotnetPath()
25-
{
26-
// Process.MainModule is app[.exe] and not `dotnet`. We can instead calculate the dotnet SDK path
27-
// by looking at the shared fx directory instead.
28-
// depsFile = /dotnet/shared/Microsoft.NETCore.App/6.0-preview2/Microsoft.NETCore.App.deps.json
29-
var depsFile = (string)AppContext.GetData("FX_DEPS_FILE");
30-
return Path.GetFullPath(Path.Combine(Path.GetDirectoryName(depsFile), "..", "..", "..", "dotnet" + (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".exe" : "")));
31-
}
32-
}
33-
34-
[Fact]
35-
public void ReturnsNullIfMainModuleIsNotDotNet()
36-
{
37-
var muxerPath = DotNetMuxer.TryFindMuxerPath(@"d:\some-path\testhost.exe");
38-
Assert.Null(muxerPath);
3922
}
4023
}
4124
#endif

0 commit comments

Comments
 (0)