Skip to content

Commit bf87807

Browse files
authored
Merge pull request #93 from rido-min/net7
Update to .NET 7, new Docker toolchain
2 parents 49fa875 + de5f6a7 commit bf87807

20 files changed

+116
-227
lines changed

IotEdgeModuleTemplate.sln

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.8.34004.107
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleModule", "content\dotnet-template-azure-iot-edge-module\CSharp\SampleModule.csproj", "{076FF2B0-9939-48A5-A2A6-B2003637A744}"
7+
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test", "Test\Test.csproj", "{2EA37308-0FBE-4C6D-B532-3671D33ED2BB}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{076FF2B0-9939-48A5-A2A6-B2003637A744}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{076FF2B0-9939-48A5-A2A6-B2003637A744}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{076FF2B0-9939-48A5-A2A6-B2003637A744}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{076FF2B0-9939-48A5-A2A6-B2003637A744}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{2EA37308-0FBE-4C6D-B532-3671D33ED2BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{2EA37308-0FBE-4C6D-B532-3671D33ED2BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{2EA37308-0FBE-4C6D-B532-3671D33ED2BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{2EA37308-0FBE-4C6D-B532-3671D33ED2BB}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {04A15845-D8E7-4F71-95F8-8B58F9FC5627}
30+
EndGlobalSection
31+
EndGlobal

Microsoft.Azure.IoT.Edge.Module.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package>
33
<metadata>
44
<id>Microsoft.Azure.IoT.Edge.Module</id>
5-
<version>3.2.0</version>
5+
<version>7.0.0</version>
66
<title>Azure IoT Edge Module</title>
77
<authors>Microsoft</authors>
88
<owners>microsoft, nugetazureiotedge</owners>

README.md

Lines changed: 23 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ The template will set up all necessary files for you to focus on functionality p
99

1010
## Get Started
1111

12-
Make sure you have [.NET 6.0 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) installed.
12+
Make sure you have [.NET 7.0 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/7.0) installed.
1313

1414
Run `dotnet` command to install the template:
1515

1616
```
17-
dotnet new -i Microsoft.Azure.IoT.Edge.Module
17+
dotnet new install Microsoft.Azure.IoT.Edge.Module
1818
```
1919
You could find the template with short name *aziotedgemodule* in output:
2020

@@ -45,52 +45,36 @@ MVC ViewStart viewstart
4545
Check out the template details:
4646
```
4747
PS C:\> dotnet new aziotedgemodule --help
48-
Usage: new [options]
49-
50-
Options:
51-
-h, --help Displays help for this command.
52-
-l, --list Lists templates containing the specified name. If no name is specified, lists all templates.
53-
-n, --name The name for the output being created. If no name is specified, the name of the current directory is used.
54-
-o, --output Location to place the generated output.
55-
-i, --install Installs a source or a template pack.
56-
-u, --uninstall Uninstalls a source or a template pack.
57-
--type Filters templates based on available types. Predefined values are "project", "item" or "other".
58-
--force Forces content to be generated even if it would change existing files.
59-
-lang, --language Specifies the language of the template to create.
60-
61-
6248
Azure IoT Edge Module (C#)
6349
Author: Microsoft
64-
Options:
65-
-s|--skipRestore
66-
bool - Optional
67-
Default: false
68-
69-
-r|--repository
70-
string - Optional
71-
Default: <registry>/<repo-name>
72-
73-
-lang|--language
74-
string - Optional
75-
Default: C#
7650
77-
```
51+
Usage:
52+
dotnet new aziotedgemodule [options] [template options]
7853
79-
Parameter `-s` means if you want to skip the restore of packages referenced in module project.
80-
81-
Parameter `-r` means the Docker repository to host your Azure IoT Edge module.
54+
Options:
55+
-n, --name <name> The name for the output being created. If no name is specified, the name of the output
56+
directory is used.
57+
-o, --output <output> Location to place the generated output.
58+
--dry-run Displays a summary of what would happen if the given command line were run if it would result
59+
in a template creation.
60+
--force Forces content to be generated even if it would change existing files.
61+
--no-update-check Disables checking for the template package updates when instantiating a template.
62+
--project <project> The project that should be used for context evaluation.
63+
-lang, --language <C#> Specifies the template language to instantiate.
64+
--type <project> Specifies the template type to instantiate.
65+
66+
Template options:
67+
-s, --skipRestore Type: bool
68+
Default: false
69+
-r, --repository <repository> Type: string
70+
Default: <registry>/<repo-name>
8271
83-
Now create the Azure IoT Edge module by the template with name:
72+
```
8473

8574
```
86-
dotnet new aziotedgemodule -n <your_module_name>
75+
dotnet new aziotedgemodule -o <your_module_name>
8776
```
8877

89-
Optionally, to create an F# module use the `-lang` or `--language` flag as follows:
90-
91-
```
92-
dotnet new aziotedgemodule -lang F# -n <your_module_name>
93-
```
9478

9579
## Support
9680
The team monitors the issue section on regular basis and will try to assist with troubleshooting or questions related IoT Edge tools on a best effort basis.

Test/Test.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,11 @@ private static string BeforeEach(string lang, string repository, bool skipRestor
4747

4848
[Theory]
4949
[InlineData(CSharp, true)]
50-
[InlineData(CSharp, false)]
5150
public void TestArchitecture(string lang, bool skipRestore)
5251
{
5352
var repository = "test.azurecr.io/test";
5453
var scaffoldName = BeforeEach(lang, repository, skipRestore);
55-
var filesToCheck = new List<string> { ".gitignore", "module.json", "Dockerfile.amd64", "Dockerfile.amd64.debug", "Dockerfile.arm32v7", "Dockerfile.arm32v7.debug", "Dockerfile.windows-amd64", "Dockerfile.arm64v8", ".dockerignore" };
54+
var filesToCheck = new List<string> { ".gitignore" };
5655

5756
if (skipRestore)
5857
{
@@ -65,17 +64,14 @@ public void TestArchitecture(string lang, bool skipRestore)
6564

6665
if (lang == CSharp)
6766
{
68-
filesToCheck.AddRange(new List<string> { "Program.cs", scaffoldName + ".csproj", "Dockerfile.arm64v8.debug" });
67+
filesToCheck.AddRange(new List<string> { "Program.cs", scaffoldName + ".csproj"});
6968
}
7069

7170
foreach (var file in filesToCheck)
7271
{
7372
Assert.True(File.Exists(Path.Combine(scaffoldName, file)));
7473
}
75-
76-
string text = File.ReadAllText(Path.Combine(scaffoldName, "module.json"));
77-
Assert.Contains(repository, text);
78-
74+
7975
Directory.Delete(scaffoldName, true);
8076
}
8177
}

Test/Test.csproj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
9-
<PackageReference Include="xunit" Version="2.3.1" />
8+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
9+
<PackageReference Include="xunit" Version="2.5.1" />
1010
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
11-
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
11+
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.1">
12+
<PrivateAssets>all</PrivateAssets>
13+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
14+
</PackageReference>
1215
</ItemGroup>
1316

1417
</Project>

azure-pipelines.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ pool:
1212
- ImageOverride -equals MMSUbuntu18.04TLS
1313

1414
steps:
15+
- task: UseDotNet@2
16+
displayName: 'Install .NET Core SDK'
17+
inputs:
18+
version: 7.x
19+
1520
- task: NuGetToolInstaller@1
1621
inputs:
1722
versionSpec:

content/dotnet-template-azure-iot-edge-module/CSharp/.dockerignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

content/dotnet-template-azure-iot-edge-module/CSharp/Dockerfile.amd64

Lines changed: 0 additions & 17 deletions
This file was deleted.

content/dotnet-template-azure-iot-edge-module/CSharp/Dockerfile.amd64.debug

Lines changed: 0 additions & 24 deletions
This file was deleted.

content/dotnet-template-azure-iot-edge-module/CSharp/Dockerfile.arm32v7

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)