10000 Merge pull request #591 from filipw/bugfix/compilation-dependency-res… · dotnet-script/dotnet-script@fc98fff · GitHub
[go: up one dir, main page]

Skip to content

Commit fc98fff

Browse files
authored
Merge pull request #591 from filipw/bugfix/compilation-dependency-resolver-5.0
fixed CompilationDependencyResolver for .NET 5.0
2 parents 069b2d3 + 2fa9253 commit fc98fff

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/Dotnet.Script.DependencyModel/Compilation/CompilationDependencyResolver.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ public IEnumerable<CompilationDependency> GetDependencies(string targetDirectory
4444
}
4545

4646
// On .Net Core, we need to fetch the compilation references for framework assemblies separately.
47-
if (defaultTargetFramework.StartsWith("netcoreapp3", StringComparison.InvariantCultureIgnoreCase))
47+
if (defaultTargetFramework.StartsWith("netcoreapp3", StringComparison.InvariantCultureIgnoreCase) ||
48+
defaultTargetFramework.StartsWith("net5", StringComparison.InvariantCultureIgnoreCase))
4849
{
4950
var compilationreferences = _compilationReferenceReader.Read(projectFileInfo);
50-
result.Add(new CompilationDependency("Microsoft.NETCore.App", "3.0", compilationreferences.Select(cr => cr.Path).ToArray(), Array.Empty<string>()));
51+
result.Add(new CompilationDependency("Dotnet.Script.Default.Dependencies", "99.0", compilationreferences.Select(cr => cr.Path).ToArray(), Array.Empty<string>()));
5152
}
5253

5354
return result;

src/Dotnet.Script.DependencyModel/Compilation/CompilationReferencesReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public IEnumerable<CompilationReference> Read(ProjectFileInfo projectFile)
4848
{
4949
File.Delete(referencePathsFile);
5050
}
51-
var exitCode = _commandRunner.Execute("dotnet", $"build \"{pathToCompilationProjectFile}\" /p:OutputType=Library -o {outputDirectory}", workingDirectory);
51+
var exitCode = _commandRunner.Execute("dotnet", $"build \"{pathToCompilationProjectFile}\" /p:OutputType=Library -o {outputDirectory} --nologo", workingDirectory);
5252
if (exitCode != 0)
5353
{
5454
throw new Exception($"Unable to read compilation dependencies for '{projectFile.Path}'. Make sure that all script files contains valid NuGet references");

src/Dotnet.Script.DependencyModel/Dotnet.Script.DependencyModel.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<RepositoryUrl>https://github.com/filipw/dotnet-script.git</RepositoryUrl>
1212
<RepositoryType>git</RepositoryType>
1313
<PackageTags>script;csx;csharp;roslyn;omnisharp</PackageTags>
14-
<Version>1.0.1</Version>
14+
<Version>1.0.2</Version>
1515
<LangVersion>latest</LangVersion>
1616
</PropertyGroup>
1717

0 commit comments

Comments
 (0)
0