ReSharper 9.0?

Jan 13, 2015 at 3:41 PM
Any builds yet for ReShaarper 9.0 (Update 1, to be specific)?
Coordinator
Jan 13, 2015 at 3:44 PM
Edited Jan 13, 2015 at 3:44 PM
See http://agunit.codeplex.com/workitem/6459 :

I have no personal interest nor the time anymore to work on AgUnit.
Our customers have all migrated away from Silverlight.

If AgUnit is a useful tool in your workflow, consider putting time into it yourself and send me a pull request. Or hire me to do so ;)
Jan 13, 2015 at 3:51 PM
I just saw that after I posted. It's sad for me, but I understand. Trust me, I'd be happy to move away from Silverlight, but we have 0.5M lines in it at the moment and a growing customer base relying on our product. I'll be forever bitter with Microsoft.

I've actually grabbed the source locally and was going to attempt a build, but I need point it to my local R# libs, so I'm struggling through that first.
Coordinator
Jan 13, 2015 at 4:12 PM
I've looked into the libs: you can get started by editing the .csproj files of AgUnit and change the ReferencePath to:

<ReferencePath>$(Registry:HKEY_CURRENT_USER\Software\JetBrains\ReSharperPlatformVs12\v01@InstallDir)</ReferencePath>

Some of the DLLs are gone/renamed/merged though, so it won't compile. You'll have to go looking where the types live now.

Another route is converting AgUnit to using the ReSharper SDK. That didn't exist when I started AgUnit.
Coordinator
Jan 13, 2015 at 4:34 PM
I fired up dotPeek and added all the assemblies in C:\Users\<name>\AppData\Local\JetBrains\Installations\ReSharperPlatformVs12

It looks like the "Jetbrains.Platform.Resharper" dlls have been renamed to "Jetbrains.Platform".
So you can fix those with a simple find and replace in the .csproj files.

You also need to add a reference to "JetBrains.PsiFeatures.VisualStudio.Core".

And in ProjectInfo.cs you need to remove the using statement and Plugin attributes:
https://github.com/JetBrains/resharper-devguide/issues/15

There are some usings you need to add.

And then you should be left with the MetadataExplorer, which apparently now doesn't need the attribute/interface anymore but a new wrapper IUnitTestElementsSource.
Coordinator
Jan 13, 2015 at 4:46 PM
Jan 13, 2015 at 6:01 PM
I'm right there with you! I didn't do the reference path (I manually added hint paths for each one). I couldn't find a R#9 equivalent for JetBrains.ReSharper.Features.Shared, so I just commented it out, but I have a lot of broken references (e.g. DebugHostProvider, UnitTestElementConsumer). I also tried adding the JetBrains.ReSharper.SDK NuGet package.
Coordinator
Jan 13, 2015 at 6:04 PM
I found DebugHostProvider in JetBrains.PsiFeatures.VisualStudio.Core.

UnitTestElementConsumer was a delegate (Action<UnitTestElement>). See the link from my previous post, they explicitly mention it:
https://www.jetbrains.com/resharper/devguide/Intro/WhatsNew.html#file-and-metadata-explorers
Jan 13, 2015 at 6:06 PM
Ah, I see. IUnitTestElementsSource replaces some old interfaces. Similar for UnitTestElementConsumer being replaced.

I've never been inside AgUnit before, so my inexperience here is slowing me down, but I'm beginning to "get it".
Jan 13, 2015 at 6:18 PM
SDeKock wrote:
I found DebugHostProvider in JetBrains.PsiFeatures.VisualStudio.Core.
Interesting. I didn't get JetBrains.PsiFeatures.VisualStudio.Core when I installed the SDK NuGet package. But it is there in my local ReSharper installation.
Jan 14, 2015 at 2:35 PM
Well, I'm about to give up for now and just run StatLight from the commandline. I was in the middle of writing some code I need to get out, and i was trying to be good and do TDD, and this was the first Ag unit test I was going to run since installing R#9.

I basically got stuck in SilverlightMsTestMetadataExplorer. They've gotten rid of the MetadataUnitTestExplorer attribute and the corresponding interface, replacing it with [SolutionComponent] and IUnitTestElementsSource. Instead of being able to focus exclusively on ExploreAssembly, we now have ExploreSolution, ExploreProjects and ExploreFile. And the UnitTestElementConsumer is replaced by the IUnitTestElementsObserver. I can supposedly leverage a MetadataElementsSource and use, I think, ExploreProjects.

I'll keep it churning on a back-burner.

If I get it working, what are my next steps?
Jan 14, 2015 at 7:15 PM
I made some back-burner progress today (motivated now by the desire to debug my Ag tests). I'm presently stuck on the GetSilverlightProject extension:
        public static IProject GetSilverlightProject(this RemoteTaskPacket sequence, IUnitTestRun run)
        {
            return sequence.GetAllTasksRecursive()
                .Select(task => run.GetElementByRemoteTaskId(task.Task.Id))
                .Where(element => element != null)
                .Select(element => element.GetProject())
                .Where(project => project != null && project.PlatformID != null && project.PlatformID.Identifier == FrameworkIdentifier.Silverlight)
                .FirstOrDefault();
        }
GetProject() no longer exists on IUnitTestElement, so the whole LINQ statement falls apart.

Stumped for now.
Jan 14, 2015 at 7:29 PM
OK, I got past that (element.ID.GetProject()).

And a few more... and now it builds. But now I don't know how we install in R#9. They've changed things so much.
Coordinator
Jan 15, 2015 at 9:53 PM
Set "AgUnit.Runner.Resharper80.TaskRunner" as startup project and press F5.

That should launch a visual studio instance with the plugin loaded and logging enabled (to C:\resharper.log).

It uses the following command line:
devenv.exe /ReSharper.Plugin AgUnit.Runner.Resharper80.dll /ReSharper.LogFile C:\resharper.log /ReSharper.LogLevel Verbose ..\src\DummyTests\VS2010\DummyTests.sln


You can also add /ReSharper.Internal, this enables the internal mode of resharper, which adds a load of stuff for debugging plugins.
Feb 8, 2015 at 12:59 PM
Hi,

Do you have a version that works with ReSharper 9? Can you provide the source code or binaries?

Thank you,
Best regards,
Yann
Coordinator
Feb 8, 2015 at 5:20 PM
Hi zahringer,

I don't have time anymore to do it myself.

If you want to contribute, the earlier posts in this thread are a good starting point.

Best regards,
Steven
Feb 8, 2015 at 5:39 PM
Edited Feb 8, 2015 at 5:40 PM
Hi SDeKock,

Yes I know you do not have time. I asked the question @Trinition

Best regards,
Yann
Feb 26, 2015 at 3:13 AM
Hi Trinition,

We are really keen to get a build of AgUnit for R#9 as well, if you get something working we'd love to know via this thread.

Thanks for taking the time to look into it.

Sam
Feb 26, 2015 at 4:29 AM
I got it to build but never got it to run. I've not had much time to work on it. Another person, Joshua, contacted me earlier and I sent him what I had and he had a go at it. He got it building and running, but it didn't actually function. JetBrains made a significant change to the way plugins like this integrate with R# so it wasn't as simple as a dependency version change like it has been sometimes in the past.

I'm not trying to keep my work secret or anything. It just didn't work and I don't want anyone assuming I knew the proper way to use R#'s new API contract by looking at my code.
Mar 3, 2015 at 6:08 PM
Experimental version available here:
https://github.com/remogloor/AgUnit
Mar 3, 2015 at 9:18 PM
Hi RemoGloor,

Thanks for you experimental version.

File ExtendedDebugTaskRunnerHostController.cs is missing in project, it does not compile...

Best regards,
Yann
Mar 3, 2015 at 11:27 PM
No that is missing by intention. Sorry I can't help you with that.
Use
https://github.com/remogloor/AgUnit/blob/master/src/AgUnit.Runner.Resharper90/UnitTestFramework/ExtendedDebugTaskRunnerHostController2.cs if you can't write that file.
Mar 17, 2015 at 3:10 AM
Hi @RemoGloor & @zahringer,

Thanks for your work on this. I was just wondering what the status is? I'm looking for a solution so that I can upgrade to the latest version of ReSharper but keep AgUnit support. Will it be possible to update the plugin in the ReSharper Gallery?

Kind regards,
Chris
Coordinator
Mar 17, 2015 at 2:04 PM
I'll update the ReSharper Gallery if there is a stable package.
Coordinator
Mar 19, 2015 at 7:37 PM
@RemoGloor: the following exceptions were submitted to the R# bugtracker:

https://youtrack.jetbrains.com/issue/RSPL-6483
https://youtrack.jetbrains.com/issue/RSPL-6482
Mar 20, 2015 at 12:46 PM
Edited Mar 20, 2015 at 12:47 PM
They are not related to my fork because there is no SilverlightMsTestMetadataExplorer class anymore. They must come from some other fork.
Mar 20, 2015 at 1:10 PM
Edited Mar 20, 2015 at 1:29 PM
@chrisduff I'm still waiting for an answer to https://devnet.jetbrains.com/message/5536666 so that I can add the debug support. But feel free to compile the sources yourself.
Coordinator
Mar 20, 2015 at 1:15 PM
@RemoGloor I did ask that question a long time ago and the answer was that it was against their policy to reverse engineer the code. That's why I wen't to great lenghts to use reflection in the previous versions of that class.

I'll ping @citizenmatt on Twitter, he might be of help.
Coordinator
Mar 20, 2015 at 1:25 PM
@RemoGloor: He has poked the devs, you should get a response soon.
Apr 15, 2015 at 2:31 AM
Hi Guys, just checking if there's been any update on this?
Sep 10, 2015 at 1:09 AM
Edited Sep 10, 2015 at 5:11 AM
Do you guys have default.ps1 as that seems to be missing from the repo and build.vs2012.bat references it.

Thank you.

*Edit*
Nevermind, I found them in the StatLight code and figured out that I have to copy the StatLight code to .\lib\sl\StatLight before running build.vs2012.bat.

Has anyone been able to build and test installing the nuget package using ReSharper's Extension Manager?
I added a custom nuget repository where the AgUnit nupkg was deployed in ReSharper's settings, but it didn't show up in the list when trying to browse the extensions.
Any ideas?
Coordinator
Sep 10, 2015 at 5:31 AM
icnocop:

"git submodule update --init" should pull down the StatLight code for you.

I'm not up to date on the extension manager, you might need to change the .nuspec to reference he right ReSharper version.
You can also always copy the plugin manually to the plugins folder (C:\Program Files (x86)\JetBrains\ReSharper\vX.X\Bin\Plugins\AgUnit).
Sep 10, 2015 at 7:01 AM
Edited Sep 10, 2015 at 7:02 AM
Thank you.

I think you're right and I'll need to update the references which are specific to ReSharper 9.2.

For reference,
Starting from ReSharper 9.0 ... JetBrains ... products are installed in the following directory by default: %LOCALAPPDATA%\JetBrains\Installations
https://www.jetbrains.com/dotcover/help/Installation_Guide.html
In order to manually test an extension, ... it must first be installed into the ReSharper Platform.
To install locally:
...
Package the extension into a custom NuGet package.
Install the local copy of the extension into ReSharper, using a custom extension source.
https://www.jetbrains.com/resharper/devguide/Extensions/Deployment/LocalInstallation.html

I'll have to continue to do some more research and troubleshooting.

Thank you.
Coordinator
Sep 10, 2015 at 7:36 AM
If I'm not mistaken. Some people already did the necessary changes.
You should look through the forks on GitHub.
Sep 11, 2015 at 11:24 AM
I tried to make the changes, but couldn't figure out out. I don't understand the ReSharper model, so adapting the AgUnit code from the 8.x model to the 9.x model was intimidating. I failed and don't have more time to spend on it.

Sadly, I've reverted to running StatLight from the command line.
Jun 15, 2016 at 10:53 AM
@Remo: nice job :)
Jun 16, 2016 at 5:29 AM
Have you guys got this working now? @SDeKock previously said he'd update the ReSharper Gallery if there is a stable package?