-
Notifications
You must be signed in to change notification settings - Fork 11
Compilation and debugging
Steps necessary to compile the Agent Mulder extension:
- Clone the repo/download it as ZIP (duh)
- Open the solution, hit Build for the whole solution
- Wait for NuGet packages to download (this might take some time)
- ???
- Profit
After this, you should end up with all the binaries you need. After you compile, you can run nuget.exe to produce an actual NuGet package that can be installed into a compatible ReSharper version. Steps to produce the NuGet package:
- Compile the solution (Debug or Release, both will work)
- Run the buildNuget.ps1 script (located in src/). You need to provide three arguments to the script
- -version - the version of the extension you are packaging (e.g. 2016.3)
- -waveVersion - the wave version the extension is compatible with (see here for details)
- -config - the configuration you compiled for that you wish to package (either Debug or Release)
- The resulting package will be located in /src/nuget
Now comes the fun part. The code can actually be debugged directly from Visual Studio. Unfortunately, because of ReSharper platform limitations, it's not as simple as hitting F5 and sitting back. Nevertheless here's the rundown:
First of all, you will need a Visual Studio experimental instance (also knows as experimental hive). If you don't know what that is, you can find some details here. Agent Mulder solution is hard-coded to use the AgentMulder hive, so just run
devenv /rootsuffix AgentMulder
This will start a new instance of Visual Studio, completely independent of the standard instance you use for work. Next, you need to install ReSharper (whatever version you plan on compiling against) into this experimental instance. Shut down the experimental instance and run the ReSharper installer.
In the installer window click the Options button and you should see a text box called Experimental Hive. Insert AgentMulder into it (the combo might and might not recognize that the hive already exists. If not, just write it in manually). Go back and finish the installation normally.
After the installation is complete, verify that everything worked as expected by running
devenv /rootsuffix AgentMulder
again and checking if ReSharper loads up in the experimental VS instance. If everything checks out, you can register your nuget in the experimental instance. This is required and you can find instructions on how to do it here.
After the extension installer finishes, restart the experimental instance and check that you can see the Agent Mulder extension as installed.
This completes the complicated portion of our programming! You can kill the experimental instance now and come back to your regular VS.
The AgentMulder.ReSharper.Plugin project is configured to take the compilation result and copy it over to the experimental instance. It is also configured to start the experimental instance of VS when you run it, so just set it as your solution's startup project, hit Run, and watch it do its thing.
If everything works as expected, you should now be able to debug the extensions just by hitting Run. There are some conditions, though.
- You MUST first install the extension from a NuGet package manually. This will register the package with ReSharper.
- After this registration, the automatic copy should be sufficient to provide you with debugging capabilities, no need to repeat the whole registration process.
- However, if you add a new binary file (e.g. a support for new DI container) or some other important information about the package changes, you need to repeat the registration with an updated NuGet package. See details here (first few paragraphs).
And that's it. You should now be able to compile, run, and debug the code in comfort.