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

Upgrade to .NET 5.0 #46

Merged
merged 1 commit into from
Feb 5, 2022
Merged

Upgrade to .NET 5.0 #46

merged 1 commit into from
Feb 5, 2022

Conversation

lekhmanrus
Copy link
Collaborator

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Refactoring
  • Build related changes
  • Documentation
  • Other:

What is the current behavior?

.net framework v4.6.1
Issue Number: #44

What is the new behavior?

.net 5

Does this PR introduce a breaking change?

  • Yes
  • No

Requires Git Extensions >=v3.6.

@lekhmanrus lekhmanrus changed the title Net5 Upgrade to .NET 5.0 Oct 25, 2021
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<TargetFramework>net5.0-windows7.0</TargetFramework>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<TargetFramework>net5.0-windows7.0</TargetFramework>
<TargetFramework>net5.0-windows</TargetFramework>

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Getting an error:

Error	NU1012	Some included files are included under TFMs which are missing a platform version: net5.0-windows
GitExtensions.GerritPlugin	C:\Program Files\dotnet\sdk\5.0.402\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets	221	

<dependency id="GitExtensions.Extensibility" version="[0.1.0, 1.0.0)" />
</group>
<!-- To fix Warning NU5128 Add a dependency group for net5.0-windows7.0 to the nuspec -->
<group targetFramework="net5.0-windows7.0">
Copy link
Member

Choose a reason for hiding this comment

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

Can this be just net5.0-windows?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was not able to resolve an error that VS throws after changing to net5.0-windows:

Error	NU1012	Some dependency group TFMs are missing a platform version: net5.0-windows	
GitExtensions.GerritPlugin	C:\Program Files\dotnet\sdk\5.0.402\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets	221

@RussKie
Copy link
Member

RussKie commented Oct 29, 2021

IIUIC @maraf is still working on a port to .NET for the Plugin Manager, gitextensions/gitextensions.pluginmanager#57.
I think it is worth waiting until the PM is available to test before merging.

@maraf
Copy link
Member

maraf commented Oct 29, 2021

I'm sorry for the delay. As I'm starting a new job on Monday, last few weeks were a bit hectic. I try to finish the PM this weekend.

@lekhmanrus
Copy link
Collaborator Author

Hi, is there a way to tie GitExtensions plugin to the specific GE version? E.g. Gerrit plugin with .net5 support to GE >=3.5.

@maraf
Copy link
Member

maraf commented Feb 1, 2022

Yes, see gitextensions/gitextensions.pluginmanager#64.
Plugins are tied to GitExtensions.Extensibility version. GE on .NET5 supports GitExtensions.Extensibility >= 0.2.0.


<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2021.2.0">
<PackageReference Include="JetBrains.Annotations" Version="2021.3.0">
Copy link
Member

Choose a reason for hiding this comment

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

You may want to consider use Roslyn annotations instead of those provided by JetBrains.

</group>
</dependencies>
</metadata>
<files>
<file src="..\..\LICENSE.md" target="\" />
<file src="bin\$configuration$\net461\GitExtensions.GerritPlugin.dll" target="\lib\net461\" />
<file src="bin\$configuration$\net5.0-windows7.0\GitExtensions.GerritPlugin.dll" target="\lib\net5.0-windows7.0\" />
Copy link
Member

Choose a reason for hiding this comment

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

I don't think Plugin Manager will look at this TFM. Have you tested installing the nuget?

Copy link
Collaborator Author

@lekhmanrus lekhmanrus Feb 6, 2022

Choose a reason for hiding this comment

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

Hi @maraf,
Just tested - you are right. I'm able to install Gerrit plugin v2, but looks like it is not installed even if I see it's installed at Plugin manager. How can I fix that? If I switch TFM to just net5.0-windows without version I have an error:

Error	NU1012	Some dependency group TFMs are missing a platform version: net5.0-windows	
GitExtensions.GerritPlugin	C:\Program Files\dotnet\sdk\6.0.101\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets	221	

Looks like a target platform version is required (based on this issue)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Would this work?

<file src="bin\$configuration$\net5.0-windows7.0\GitExtensions.GerritPlugin.dll" target="\lib\" />

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

How can I fix that? If I switch TFM to just net5.0-windows without version I have an error:

I have never seen that, but according the issue you mentioned and PR inside it, it seems you are doing it correctly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks @maraf! I'll do PR to fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants