DiscordRPCVS icon indicating copy to clipboard operation
DiscordRPCVS copied to clipboard

Update 2.0 (AsyncPackage, .NET framework 4.7, 2019 Compatibility, PackageReference, Settings file)

Open BlowaXD opened this issue 6 years ago • 43 comments

Update 2.0

Hi, There is the pull request that will close #27 It requires #25 to be merged to work

Changelog

  • [x] Move to AsyncPackage
  • [x] Update dependencies
  • [x] Switch to .NET Framework 4.7
  • [x] Add support for VS 2019
  • [x] Migrate to Package Reference

If you have any feedback, do not hesitate (I fixed some naming style, brackets style to follow most common C# coding styles)

BlowaXD avatar Dec 07 '18 06:12 BlowaXD

I've tested your pull, but for me it didn't quite worked out well. Could you compile your pull so i can try it out? ~~Optionally, there's another pull 25, that conflicts sadly with your changes, no clue if that could be fixed/avoided somehow~~

Macleykun avatar Dec 25 '18 21:12 Macleykun

@Macley-Kun can you please give some details, I'm a bit busy those days because of exams.

Did you have any compilation error ?

BlowaXD avatar Dec 26 '18 15:12 BlowaXD

Oh I got it compiled, I just couldn’t enable it with vs 2019. Hence I asked if I could get a compiled version from you

Also good luck with your exams!

Outlook voor iOShttps://aka.ms/o0ukef downloaden


Van: Blowa [email protected] Verzonden: woensdag, december 26, 2018 4:52 PM Aan: Swan/DiscordRPCVS CC: Macley; Mention Onderwerp: Re: [Swan/DiscordRPCVS] to Async Package + Update Package + Add VS 2019 support (#28)

@Macley-Kunhttps://github.com/Macley-Kun can you please give some details, I'm a bit busy those days because of exams.

Did you have any compilation error ?

― You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Swan/DiscordRPCVS/pull/28#issuecomment-449984909, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AZKMcwnmTQmfRY0Z5IQSq7K_5x5zF86eks5u85s9gaJpZM4ZH3v2.

Macleykun avatar Dec 26 '18 15:12 Macleykun

error screen shot

I extracted this from %AppData%\Microsoft\VisualStudio\16.0_9cec2b30Exp\ActivityLog.xml after getting that error:

SetSite failed for package [DiscordRPCVSPackage]
Source: "discord-rpc-vs"
Description: Could not load file or assembly "Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" or one of its dependencies.
The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly "Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" or one of its dependencies.
The system cannot find the file specified.
File name: "Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed"
   at discord_rpc_vs.Config.Configuration.Deserialize()
   at discord_rpc_vs.DiscordRPCVSPackage.<InitializeAsync>d__20.MoveNext() in D:\Source\DiscordRPCVS\discord-rpc-vs\DiscordRPCVSPackage.cs:line 130
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Shell.AsyncPackage.<>c__DisplayClass21_0.<<Microsoft-VisualStudio-Shell-Interop-IAsyncLoadablePackageInitialize-Initialize>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Shell.UIThreadReentrancyScope.WaitOnTaskCompleteInternal(Task task, CancellationToken cancel, Int32 ms)
   at Microsoft.VisualStudio.Services.VsTask.<>c__DisplayClass100_1.<InternalGetResult>b__1()
   at Microsoft.VisualStudio.Services.VsTask.IgnoreObjectDisposedException(Action action)
   at Microsoft.VisualStudio.Services.VsTask.<>c__DisplayClass100_0.<InternalGetResult>b__0()
   at Microsoft.VisualStudio.Services.VsTask.<>c__DisplayClass108_0.<InvokeWithWaitDialog>b__0()
   at Microsoft.VisualStudio.Services.VsTask.InvokeWithWaitDialog[T](Func`1 function)
   at Microsoft.VisualStudio.Services.VsTask.InvokeWithWaitDialog(Action action)
   at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck)
   at Microsoft.VisualStudio.Services.VsTask.GetResult()

The source is discord_rpc_vs.Config.Configuration.Deserialize(). And ultimately because of the dependency on Newtonsoft.Json version 12.0. I actually removed that dependency altogether in #25.

@Macley-Kun is this the same error you got?

FurkanKambay avatar Dec 29 '18 00:12 FurkanKambay

I got it to work in 2019 after resolving the issue by the way. The extension only has the issues from before as far as I can tell.

FurkanKambay avatar Dec 29 '18 01:12 FurkanKambay

Ooh that’s great! Could I maybe have that compiled extension you got working?

Macleykun avatar Dec 29 '18 09:12 Macleykun

late edit: the link was outdated. see BlowaXD's comment down below for the latest build. (without the latest Swan/master merge. for that, build this PR from source)

@Macley-Kun Here it ~~is~~ was. I built both debug and release packages. The changes are:

  • migrate from packages.config to PackageReference (we should probably do that too)
  • remove json.net dependency in Configuration.cs and use a Flags enum instead. I just use the enum's string representation in the file. (Also changed config.json to config)
  • one unrelated change (in menu commands, when "display time" is unchecked, disable the "reset" command instead of hiding it. same as #30)

@BlowaXD since this PR handles a considerable amount of things, can you also migrate to PackageReference? (Not that migrating will fix the error I posted before)

FurkanKambay avatar Dec 29 '18 13:12 FurkanKambay

@FurkanKambay Um, i got it installed and enabled, but doens't seem to work proper, you had this issue too? image

Macleykun avatar Dec 29 '18 14:12 Macleykun

@Macley-Kun ¯_(ツ)_/¯ works on my machine. You need to change the active window after enabling the presence. It's a bug.

FurkanKambay avatar Dec 29 '18 15:12 FurkanKambay

Change the active window? I re-added the presence from discord but no luck sadly :P ...

Macleykun avatar Dec 29 '18 15:12 Macleykun

@Macley-Kun inside visual studio, the active window is the one that's highlighted blue. Either open another code file and switch between them or go to solution explorer, team explorer etc. When the focus changes, the active window is changed. The extension doesn't work if you never changed the active window basically. This conversation is getting long and since it's not directly related to the PR, if you have any other issues maybe add me on Discord FurkanKambay#3114. (I might go to sleep soon though, I need it so bad)

FurkanKambay avatar Dec 29 '18 16:12 FurkanKambay

I will take a look as soon as possible

BlowaXD avatar Dec 29 '18 16:12 BlowaXD

Thanks dude it worked! Hope @Swan will have time someday to look at the pulls! I tried contacting him trough mail, but no luck sadly.

Macleykun avatar Dec 29 '18 17:12 Macleykun

I will be able to take a look this weekend :)

BlowaXD avatar Jan 02 '19 20:01 BlowaXD

Sorry for the delay, here is the migration and some more cleanup

BlowaXD avatar Jan 10 '19 15:01 BlowaXD

@BlowaXD you should delete MigrationBackup/ since we have git for that, lol.

FurkanKambay avatar Jan 10 '19 19:01 FurkanKambay

It has been tested and it's now ready to be merged.

BlowaXD avatar Jan 11 '19 10:01 BlowaXD

Any news @Swan ?

BlowaXD avatar Jan 18 '19 23:01 BlowaXD

Updated to fit with #25 that was recently merged.

BlowaXD avatar Jan 19 '19 23:01 BlowaXD

Builded the extension with the up-to-date git + this pull. So other people can test/switch to visual studio 2019. discord-rpc-vs.zip

Btw, .NET Framework has 4.7.2, so idk if it's an idea to update to that, instead of 4.7. https://dotnet.microsoft.com/download/visual-studio-sdks?utm_source=getdotnetsdk&utm_medium=referral

EDIT ~~Great work btw! Extension works flawlessly :-)~~

I just had a little issue with the extension/pull. It seems that when you set the enable (twice) it works, but if you close vs 2019 and start it again, and you would continue working. The extension has all the options back to off.

So i'm assuming that it doesn't hold those settings inbetween restarts?

Macleykun avatar Jan 20 '19 10:01 Macleykun

@Macley-Kun Just tested it. I think it resets because of the same reason you have to enable it twice. The package doesn't initialize unless you interact with a menu command. This happened after moving to 2019 in this PR. If it's not a bug in the PR, it might be VS2019's issue. I'll investigate later.

FurkanKambay avatar Jan 20 '19 14:01 FurkanKambay

Sorry for the late reply, I just fixed that in my last commit. I simply changed something at the beginning that shouldn't have been changed like that

Here is the zip (Both debug & release) in case people want to use it. discord_rpc_vs_2.zip

Next step is probably to remove unnecessary references.

BlowaXD avatar Jan 28 '19 03:01 BlowaXD

Bump

BlowaXD avatar Feb 03 '19 04:02 BlowaXD

Bump @Swan

BlowaXD avatar Feb 20 '19 16:02 BlowaXD

Doesn't work on VS 2019 RC

Could you please tell what does not work ? I'm using it actually and it works.

BlowaXD avatar Mar 04 '19 05:03 BlowaXD

bump~ small conflict 😮

Macleykun avatar Mar 22 '19 10:03 Macleykun

4 months later, still waiting for merge.

BlowaXD avatar Mar 26 '19 05:03 BlowaXD

What about forking this instead of waiting forever for @Swan?

GGG-KILLER avatar Mar 26 '19 11:03 GGG-KILLER

@GGG-KILLER BlowaXD would have to release .vsix builds on GitHub so people can download but yeah. Though obviously it will not be downloaded as much.

Swan seems to be very busy with his other project. I'm sure he'll take a look at some point.

FurkanKambay avatar Mar 27 '19 11:03 FurkanKambay

@FurkanKambay afaik the main branch of this project doesn't support VS 2019, so once 2019 assumes, his version would then be the most downloaded

GGG-KILLER avatar Mar 27 '19 11:03 GGG-KILLER