File tree 14 files changed +61
-16
lines changed
Dotnet.Script.DependencyModel
Dotnet.Script.DependencyModel.Nuget
14 files changed +61
-16
lines changed Original file line number Diff line number Diff line change 9
9
steps :
10
10
- uses : actions/checkout@v3
11
11
- name : Install .Net Core
12
- uses : actions/setup-dotnet@v2
12
+ uses : actions/setup-dotnet@v3
13
13
with :
14
14
dotnet-version : |
15
15
6.0.x
16
16
7.0.x
17
+ 8.0.x
17
18
include-prerelease : true
18
19
- name : Install dotnet-script
19
20
run : dotnet tool install dotnet-script --global
@@ -27,11 +28,12 @@ jobs:
27
28
steps :
28
29
- uses : actions/checkout@v3
29
30
- name : Install .Net Core
30
- uses : actions/setup-dotnet@v2
31
+ uses : actions/setup-dotnet@v3
31
32
with :
32
33
dotnet-version : |
33
34
6.0.x
34
35
7.0.x
36
+ 8.0.x
35
37
include-prerelease : true
36
38
- name : Install dotnet-script
37
39
run : dotnet tool install dotnet-script --global
@@ -45,11 +47,12 @@ jobs:
45
47
steps :
46
48
- uses : actions/checkout@v3
47
49
- name : Install .Net Core
48
- uses : actions/setup-dotnet@v2
50
+ uses : actions/setup-dotnet@v3
49
51
with :
50
52
dotnet-version : |
51
53
6.0.x
52
54
7.0.x
55
+ 8.0.x
53
56
include-prerelease : true
54
57
- name : Install dotnet-script
55
58
run : dotnet tool install dotnet-script --global
Original file line number Diff line number Diff line change 1
1
{
2
2
"sdk" : {
3
- "version" : " 7 .0.100" ,
3
+ "version" : " 8 .0.100-rc.2.23502.2 " ,
4
4
"rollForward" : " latestFeature"
5
5
}
6
6
}
Original file line number Diff line number Diff line change 2
2
<Project Sdk =" Microsoft.NET.Sdk" >
3
3
<PropertyGroup >
4
4
<Description >A cross platform library allowing you to run C# (CSX) scripts with support for debugging and inline NuGet packages. Based on Roslyn.</Description >
5
- <VersionPrefix >1.4 .0</VersionPrefix >
5
+ <VersionPrefix >1.5 .0</VersionPrefix >
6
6
<Authors >filipw</Authors >
7
- <TargetFrameworks >net6.0;netstandard2.0</TargetFrameworks >
7
+ <TargetFrameworks >net8.0;net7.0; net6.0;netstandard2.0</TargetFrameworks >
8
8
<AssemblyName >Dotnet.Script.Core</AssemblyName >
9
9
<PackageId >Dotnet.Script.Core</PackageId >
10
10
<PackageTags >script;csx;csharp;roslyn</PackageTags >
Original file line number Diff line number Diff line change 8
8
<RepositoryUrl >https://github.com/dotnet-script/dotnet-script.git</RepositoryUrl >
9
9
<RepositoryType >git</RepositoryType >
10
10
<PackageTags >script;csx;csharp;roslyn;nuget</PackageTags >
11
- <Version >1.4 .0</Version >
11
+ <Version >1.5 .0</Version >
12
12
<Description >A MetadataReferenceResolver that allows inline nuget references to be specified in script(csx) files.</Description >
13
13
<Authors >dotnet-script</Authors >
14
14
<Company >dotnet-script</Company >
Original file line number Diff line number Diff line change 11
11
<RepositoryUrl >https://github.com/dotnet-script/dotnet-script.git</RepositoryUrl >
12
12
<RepositoryType >git</RepositoryType >
13
13
<PackageTags >script;csx;csharp;roslyn;omnisharp</PackageTags >
14
- <Version >1.4 .0</Version >
14
+ <Version >1.5 .0</Version >
15
15
<LangVersion >latest</LangVersion >
16
16
<SignAssembly >true</SignAssembly >
17
17
<AssemblyOriginatorKeyFile >../dotnet-script.snk</AssemblyOriginatorKeyFile >
Original file line number Diff line number Diff line change @@ -133,10 +133,16 @@ private static string GetProcessArchitecture()
133
133
private static string GetRuntimeIdentifier ( )
134
134
{
135
135
var platformIdentifier = GetPlatformIdentifier ( ) ;
136
+
137
+ #if NET8_0
138
+ return $ "{ platformIdentifier } -{ GetProcessArchitecture ( ) } ";
139
+ #endif
140
+
136
141
if ( platformIdentifier == "osx" || platformIdentifier == "linux" )
137
142
{
138
143
return $ "{ platformIdentifier } -{ GetProcessArchitecture ( ) } ";
139
144
}
145
+
140
146
var runtimeIdentifier = RuntimeEnvironment . GetRuntimeIdentifier ( ) ;
141
147
return runtimeIdentifier ;
142
148
}
Original file line number Diff line number Diff line change 3
3
<OutputType>Exe</OutputType>
4
4
<TargetFramework>net5.0</TargetFramework>
5
5
<LangVersion>latest</LangVersion>
6
+ <UseRidGraph>true</UseRidGraph>
6
7
</PropertyGroup>
7
8
<ItemGroup>
8
9
</ItemGroup>
Original file line number Diff line number Diff line change 1
1
<Project Sdk =" Microsoft.NET.Sdk" >
2
2
<PropertyGroup >
3
- <TargetFrameworks >net7.0;net6.0</TargetFrameworks >
3
+ <TargetFrameworks >net8.0; net7.0;net6.0</TargetFrameworks >
4
4
<GenerateAssemblyInfo >false</GenerateAssemblyInfo >
5
5
<SignAssembly >true</SignAssembly >
6
6
<AssemblyOriginatorKeyFile >../dotnet-script.snk</AssemblyOriginatorKeyFile >
Original file line number Diff line number Diff line change @@ -19,8 +19,7 @@ public async Task ShouldCompileAndExecuteWithWebSdk()
19
19
{
20
20
@"#r ""sdk:Microsoft.NET.Sdk.Web""" ,
21
21
"using Microsoft.AspNetCore.Builder;" ,
22
- "var a = WebApplication.Create();" ,
23
- @"a.GetType()" ,
22
+ @"typeof(WebApplication)" ,
24
23
"#exit"
25
24
} ;
26
25
Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . IO ;
3
+ using System . Reflection ;
4
+ using System . Runtime . InteropServices ;
3
5
using System . Text ;
4
6
using Dotnet . Script . DependencyModel . Environment ;
5
7
using Dotnet . Script . Shared . Tests ;
@@ -479,13 +481,34 @@ public void ShouldSetCurrentContextualReflectionContext()
479
481
Assert . Contains ( "Dotnet.Script.Core.ScriptAssemblyLoadContext" , output ) ;
480
482
}
481
483
484
+ #if NET6_0
485
+ [ Fact ]
486
+ public void ShouldCompileAndExecuteWithWebSdk ( )
487
+ {
488
+ var processResult = ScriptTestRunner . Default . ExecuteFixture ( "WebApiNet6" , "--no-cache" ) ;
489
+ Assert . Equal ( 0 , processResult . ExitCode ) ;
490
+ }
491
+ #endif
492
+
493
+ #if NET7_0
482
494
[ Fact ]
483
495
public void ShouldCompileAndExecuteWithWebSdk ( )
484
496
{
485
497
var processResult = ScriptTestRunner . Default . ExecuteFixture ( "WebApi" , "--no-cache" ) ;
486
498
Assert . Equal ( 0 , processResult . ExitCode ) ;
487
499
}
488
-
500
+ #endif
501
+
502
+ #if NET8_0
503
+ // .NET 8.0 only works with isolated load context
504
+ [ Fact ]
505
+ public void ShouldCompileAndExecuteWithWebSdk ( )
506
+ {
507
+ var processResult = ScriptTestRunner . Default . ExecuteFixture ( "WebApi" , "--no-cache --isolated-load-context" ) ;
508
+ Assert . Equal ( 0 , processResult . ExitCode ) ;
509
+ }
510
+ #endif
511
+
489
512
[ Fact ]
490
513
public void ShouldThrowExceptionWhenSdkIsNotSupported ( )
491
514
{
Original file line number Diff line number Diff line change @@ -49,7 +49,11 @@ public void SimplePublishTest()
49
49
public void SimplePublishTestToDifferentRuntimeId ( )
50
50
{
51
51
using var workspaceFolder = new DisposableFolder ( ) ;
52
+ #if NET8_0
53
+ var runtimeId = _scriptEnvironment . RuntimeIdentifier == "win-x64" ? "osx-x64" : "win10-x64" ;
54
+ #else
52
55
var runtimeId = _scriptEnvironment . RuntimeIdentifier == "win10-x64" ? "osx-x64" : "win10-x64" ;
56
+ #endif
53
57
var code = @"WriteLine(""hello world"");" ;
54
58
var mainPath = Path . Combine ( workspaceFolder . Path , "main.csx" ) ;
55
59
File . WriteAllText ( mainPath , code ) ;
Original file line number Diff line number Diff line change 1
1
#r "sdk:Microsoft.NET.Sdk.Web"
2
+ #r "nuget : Microsoft . Extensions . DependencyInjection . Abstractions , 8.0 .0 - rc . 2.23479 .6 "
2
3
3
4
using Microsoft . AspNetCore . Builder ;
4
5
5
- var a = WebApplication . Create ( ) ;
6
- a . MapGet ( "/" , ( ) => "Hello world" ) ;
6
+ var builder = WebApplication . CreateBuilder ( ) ;
7
+ var app = builder . Build ( ) ;
8
+
9
+ app . MapGet ( "/" , ( ) => "Hello World!" ) ;
Original file line number Diff line number Diff line change
1
+ #r "sdk:Microsoft.NET.Sdk.Web"
2
+
3
+ using Microsoft . AspNetCore . Builder ;
4
+
5
+ var a = WebApplication . Create ( ) ;
6
+ a . MapGet ( "/" , ( ) => "Hello world" ) ;
Original file line number Diff line number Diff line change 2
2
<Project Sdk =" Microsoft.NET.Sdk" >
3
3
<PropertyGroup >
4
4
<Description >Dotnet CLI tool allowing you to run C# (CSX) scripts.</Description >
5
- <VersionPrefix >1.4 .0</VersionPrefix >
5
+ <VersionPrefix >1.5 .0</VersionPrefix >
6
6
<Authors >filipw</Authors >
7
7
<PackageId >Dotnet.Script</PackageId >
8
- <TargetFrameworks >net7.0;net6.0</TargetFrameworks >
8
+ <TargetFrameworks >net8.0; net7.0;net6.0</TargetFrameworks >
9
9
<DebugType >portable</DebugType >
10
10
<AssemblyName >dotnet-script</AssemblyName >
11
11
<OutputType >Exe</OutputType >
You can’t perform that action at this time.
0 commit comments