Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the sample to target net5 #4096

Merged
merged 3 commits into from
Jan 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>net5</TargetFramework>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version is called out in the readme too.

</PropertyGroup>

<ItemGroup>
Expand Down
12 changes: 6 additions & 6 deletions core/extensions/AppWithPlugin/AppWithPlugin/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ static void Main(string[] args)

string[] pluginPaths = new string[]
{
@"HelloPlugin\bin\Debug\netcoreapp3.0\HelloPlugin.dll",
@"JsonPlugin\bin\Debug\netcoreapp3.0\JsonPlugin.dll",
@"XcopyablePlugin\bin\Debug\netcoreapp3.0\XcopyablePlugin.dll",
@"OldJsonPlugin\bin\Debug\netcoreapp2.1\OldJsonPlugin.dll",
@"FrenchPlugin\bin\Debug\netcoreapp2.1\FrenchPlugin.dll",
@"UVPlugin\bin\Debug\netcoreapp2.1\UVPlugin.dll",
@"HelloPlugin\bin\Debug\net5\HelloPlugin.dll",
@"JsonPlugin\bin\Debug\net5\JsonPlugin.dll",
@"XcopyablePlugin\bin\Debug\net5\XcopyablePlugin.dll",
@"OldJsonPlugin\bin\Debug\net5\OldJsonPlugin.dll",
@"FrenchPlugin\bin\Debug\net5\FrenchPlugin.dll",
@"UVPlugin\bin\Debug\net5\UVPlugin.dll",
};

IEnumerable<ICommand> commands = pluginPaths.SelectMany(pluginPath =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>net5</TargetFramework>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to add a Directory.Build.props to set TargetFramework for all these projects?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elinor-fung That's an interesting idea. We're looking at how to update all the samples on the release cadence. See dotnet/docs#22271. Can you add thoughts on how to make that easier on that issue?

</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>net5</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion core/extensions/AppWithPlugin/JsonPlugin/JsonPlugin.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>net5</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>net5</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion core/extensions/AppWithPlugin/PluginBase/PluginBase.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>net5</TargetFramework>
</PropertyGroup>

</Project>
4 changes: 2 additions & 2 deletions core/extensions/AppWithPlugin/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ By using `AssemblyDependencyResolver` along with a custom `AssemblyLoadContext`,

## Build and Run

1. Install .NET Core 3.0 Preview 2 or newer.
2. Use the .NET Core SDK to build the project via `dotnet build`.
1. Install .NET 5 or newer. The sample targets .NET 5, but support for all the features it uses was added in .NET Core 3.0.
2. Use the .NET SDK to build the project via `dotnet build`.
- The AppWithPlugin project does not contain any references to the plugin projects, so you need to build the solution.
3. Go to the AppWithPlugin directory and use `dotnet run` to run the app.
- You should see the app output a list of installed commands.
Expand Down
2 changes: 1 addition & 1 deletion core/extensions/AppWithPlugin/UVPlugin/UVPlugin.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>net5</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>net5</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

Expand Down