Skip to content

Commit 425f370

Browse files
Merge pull request #1214 from icsharpcode/christophwille/net10func
Migrate Azure Functions to net10, add Bruno test collection
2 parents 8f0eefb + 3e64876 commit 425f370

File tree

5 files changed

+62
-15
lines changed

5 files changed

+62
-15
lines changed

Func/Func.csproj

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net8.0</TargetFramework>
3+
<TargetFramework>net10.0</TargetFramework>
44
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
55
<OutputType>Exe</OutputType>
66
<ImplicitUsings>enable</ImplicitUsings>
@@ -9,15 +9,21 @@
99
<AssemblyName>ICSharpCode.CodeConverter.Func</AssemblyName>
1010
<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
1111
</PropertyGroup>
12-
12+
13+
<ItemGroup>
14+
<Compile Remove="TestingWithBruno\**" />
15+
<EmbeddedResource Remove="TestingWithBruno\**" />
16+
<None Remove="TestingWithBruno\**" />
17+
</ItemGroup>
18+
1319
<ItemGroup>
1420
<Compile Include="..\CodeConverter\Common\DefaultReferences.cs" Link="DefaultReferences.cs" />
1521
</ItemGroup>
16-
22+
1723
<ItemGroup>
1824
<ProjectReference Include="..\CodeConverter\CodeConverter.csproj" />
19-
</ItemGroup>
20-
25+
</ItemGroup>
26+
2127
<ItemGroup>
2228
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="2.51.0" />
2329
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.3.0" />
@@ -27,7 +33,7 @@
2733
<PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.4.0" />
2834
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.1.4" />
2935
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
30-
36+
3137
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.2" />
3238
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
3339
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0" />

Func/Program.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@
44

55
var host = new HostBuilder()
66
.ConfigureFunctionsWebApplication()
7-
.ConfigureServices(services =>
8-
{
9-
services.AddApplicationInsightsTelemetryWorkerService();
10-
services.ConfigureFunctionsApplicationInsights();
11-
12-
services.AddCors(options =>
13-
{
14-
options.AddPolicy("AllowWeb", builder =>
15-
{
7+
.ConfigureServices(services => {
8+
services.AddApplicationInsightsTelemetryWorkerService()
9+
.ConfigureFunctionsApplicationInsights();
10+
11+
services.AddCors(options => {
12+
options.AddPolicy("AllowWeb", builder => {
1613
builder.WithOrigins("http://localhost:5173")
1714
.AllowAnyMethod()
1815
.AllowAnyHeader();

Func/TestingWithBruno/bruno.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"version": "1",
3+
"name": "CodeConverter",
4+
"type": "collection",
5+
"ignore": [
6+
"node_modules",
7+
".git"
8+
]
9+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
meta {
2+
name: getVersion
3+
type: http
4+
seq: 1
5+
}
6+
7+
get {
8+
url: http://localhost:7144/api/Version
9+
body: none
10+
auth: inherit
11+
}
12+
13+
settings {
14+
encodeUrl: true
15+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
meta {
2+
name: postConversion
3+
type: http
4+
seq: 2
5+
}
6+
7+
post {
8+
url: http://localhost:7144/api/Convert
9+
body: json
10+
auth: inherit
11+
}
12+
13+
body:json {
14+
{"code": "usingSystem;usingSystem.Collections.Generic;usingSystem.Collections.Immutable;usingSystem.Diagnostics;usingSystem.Diagnostics.CodeAnalysis;usingSystem.Linq;usingSystem.Threading;usingSystem.Threading.Tasks;classProgram{staticvoidMain(){Console.WriteLine(\"Hello.\");}}","requestedConversion":"cs2vbnet"}
15+
}
16+
17+
settings {
18+
encodeUrl: true
19+
timeout: 0
20+
}

0 commit comments

Comments
 (0)