Jump to content

Version of C# to use?


Go to solution Solved by Luke,

Recommended Posts

HawkXP71
Posted

Blame this question as a remnant of my C++ work.

Does it matter what version of C# a plugin uses?  Ie, can I use the latest and greatest release? or must I use a range of versions?

  • Solution
Posted

Hi, it doesn't matter.

HawkXP71
Posted

Thanks!

1 minute ago, Luke said:

Hi, it doesn't matter.

 

pünktchen
Posted
49 minutes ago, Luke said:

Hi, it doesn't matter.

But plugins should target .Net Standard 2.0 and that is only C# 7.3.

  • Thanks 1
yocker
Posted
25 minutes ago, pünktchen said:

But plugins should target .Net Standard 2.0 and that is only C# 7.3.

*SHOULD!* :) 

Posted
15 minutes ago, yocker said:

*SHOULD!* :) 

You don't have any in the catalog targeting higher than that, do you?

yocker
Posted (edited)
49 minutes ago, Luke said:

You don't have any in the catalog targeting higher than that, do you?

.net 6
If that's a problem i guess i have my work cut out for me converting them.

Edited by yocker
Posted
Just now, yocker said:

.net 6

in the catalog?

yocker
Posted
Just now, Luke said:

in the catalog?

Yes.
Never knew that would be a problem, sorry if it is.

Posted

Yea which ones? We will have to remove those because it will cause server crashes on platforms that still use the mono runtime and not dotnet.

Alternatively, if you can get them down to netstandard 2.0 then that would be best. 

yocker
Posted
3 minutes ago, Luke said:

Yea which ones? We will have to remove those because it will cause server crashes on platforms that still use the mono runtime and not dotnet.

Alternatively, if you can get them down to netstandard 2.0 then that would be best. 

All 3, EmbyCredits, EmbyIcons and TimeMarkEdit.
Damn.. I have a lot of work in front of me.

I do have a version of EmbyCredit on netstandard 2.0 i have maintained along side the main one but it isn't tested properly.

Anyway, good to know so it can be fixed and i won't cause problems.

  • Thanks 1
Posted

if cover art can do it then I'm sure those can too.

yocker
Posted
1 minute ago, Luke said:

if cover art can do it then I'm sure those can too.

Just hard work, though TimeMarkEdit should be rather easy as it isn't the biggest plugin out there.

  • Thanks 1
Posted

C# Version

The C# version is largely irrelevant and (mostly) independent of the target framework.

The C# compiler version determines the language features which the source code can use - but it still needs to compile code in a way that is compatible with the targeted framework. There exist a few very specific exceptions but but this doesn't change the big picture: You can compile a class library targeting netstandard2.0 with the latest C# compiler version just fine.

Posted

netstandard2.0 TargetFramework

This is a hard requirement for EmbyServer plugins as documented.

Since yesterday, the plugin portal rejects plugin dlls which are not targeting netstandard2.0. It is not a change of policy - it's just an added check which should have been there ever since.

@yocker - We are in the same boat in this regard. But it doesn't meant that all code needs to be rewritten. We have solutions for most of the typical issues (like via extension methods etc.)
If you can assemble a list of code changes that are biting you, we can share the solutions we have, so that you don't need to rewrite all your code.

  • Thanks 1
yocker
Posted
18 minutes ago, softworkz said:

@yocker - We are in the same boat in this regard. But it doesn't meant that all code needs to be rewritten. We have solutions for most of the typical issues (like via extension methods etc.)
If you can assemble a list of code changes that are biting you, we can share the solutions we have, so that you don't need to rewrite all your code.

Many, many thanks for the offer! :) 
It's only EmbyIcons really and It shouldn't be too difficult, just hard work. An AI should be able to make a summery of the problems i will face and need to fix to lessen the work.

It's kinda funny, i actually started the plugin as netstandard.

Speaking of the portal, it seems to have problems deleting old versions.
In case you are not aware.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...