Loading plugins

Aug 13, 2012 at 10:56 PM

I was making some alterations to Statlight to better support extensions, in area of what they are capable of (which has no impact on AgUnit) and in how they are located/loaded (which does). https://github.com/staxmanade/StatLight/pull/11


The scenario I wanted to talk about is this: I want to have solution (or project) specific plugins for Statlight, that live somewhere in the project and therefore whoever uses the project doesn't need to make the additional step of making sure they get the extension into their Extensions folder (and update if needed) in order to be running the tests.


This is handed in StatLight.exe by specifying extension assemblies from the command line. Now my question to you is, what would be the best way to support that in AgUnit?

The solution I've implemented on my team at the moment is that we're looking in the folder where we load .xap file from for .NET assemblies named *.StatLightExtension.dll and loading them from there, and we have an MsBuild task to copy the extension to the output folder of our Silverlight project.


While it does work for us, I do realise this is not really a low-friction solution. What do you think would be a better option to support this in AgUnit?

Sep 1, 2012 at 7:03 AM

is anyone interested in this?

Sep 1, 2012 at 8:42 AM


I kind of forgot to answer to your question, sorry :)

We can make the search folder for plugins relative to the project/solution or make it configurable (in the R# options?).

Other than that I don't really see a better way of doing things.

Sep 1, 2012 at 8:50 AM

sure, that sounds good.


I wasn't sure how much access R# API gives you.


I guess there are two nice scenarios here:

1 - the plugin is in another project in the same solution (that's the case for us). Currently I'm doing some msbuild trickery to pull this off but if in ReSharper (team-shared) settings I could point AgUnit to that other project (let's call it MyExtension), and have AgUnit load it when running tests.

2 - have a binary (nuget or otherwise) in a folder relative to the .sln file, and make it work the same way as above.


BTW, the pull request has been pulled into Statlight now.

Sep 1, 2012 at 10:33 AM

What about changing the output folder of the plugin ? Or using an xcopy in the post-build events ?
I don't think this is a scenario that's quite common, so I don't think a perfect solution is really necessary ...

In AgUnit I have access to the full Visual Studio EnvDTE and R# API's so I can get any info that would be necessary.

I'd rather avoid adding a setting, because AgUnit doesn't have a settings screen right now.
I would have to research the R# settings APIs. So that is going to be a lot of work for a feature that will probably not be used by many people ...

Sep 1, 2012 at 10:41 AM

fair enough