DiscordRPCVS
DiscordRPCVS copied to clipboard
Update 2.0 (AsyncPackage, .NET framework 4.7, 2019 Compatibility, PackageReference, Settings file)
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)
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~~
@Macley-Kun can you please give some details, I'm a bit busy those days because of exams.
Did you have any compilation error ?
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.
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?
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.
Ooh that’s great! Could I maybe have that compiled extension you got working?
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
toconfig
) - 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
Um, i got it installed and enabled, but doens't seem to work proper, you had this issue too?
@Macley-Kun ¯_(ツ)_/¯ works on my machine. You need to change the active window after enabling the presence. It's a bug.
Change the active window? I re-added the presence from discord but no luck sadly :P ...
@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)
I will take a look as soon as possible
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.
I will be able to take a look this weekend :)
Sorry for the delay, here is the migration and some more cleanup
@BlowaXD you should delete MigrationBackup/
since we have git for that, lol.
It has been tested and it's now ready to be merged.
Any news @Swan ?
Updated to fit with #25 that was recently merged.
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?
@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.
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.
Bump
Bump @Swan
Doesn't work on VS 2019 RC
Could you please tell what does not work ? I'm using it actually and it works.
bump~ small conflict 😮
4 months later, still waiting for merge.
What about forking this instead of waiting forever for @Swan?
@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 afaik the main branch of this project doesn't support VS 2019, so once 2019 assumes, his version would then be the most downloaded