Unable to add reference to 'StatLight 1.2.3919' because it has no project content

Oct 18, 2010 at 9:19 PM

I contributed a NuPack for StatLight last week. Finally got around to testing the experience of using NuPack with StatLight. If I take the following steps I receive the errore "Unable to add reference to 'StatLight 1.2.3919' because it has no project content"

1. Add a new silverlight test project (don't choose to generate a web project along side the silverlight test project)

2. right click on the test project and choose "Add Package Reference"

3. Search for StatLight and try to install it

That's when I get a the error dialog.

When I click ok and close any dialogs that are open. It appears to have installed correctly into the packages\StatLIght.1.2.3191\tools folder.

Is there something I have mis-configured with my NuPack package that is causing it to try and "add reference" to something (It shouldn't do this...)

Any Thoughts?


Oct 18, 2010 at 11:32 PM

StatLight is a solution level package, meaning that it doesn't contain anything that is project specific.  The VS UI does not currently support correctly installing such packages.  However, you should be able to install it through the Console.

As an aside, is it indeed intentional that it doesn't add anything to the project?  e.g. is StatLight.Core.dll supposed to get added as an assembly reference, or is it only a support assembly for StatLight.exe?

Oct 19, 2010 at 12:01 AM

Thanks for the reply.

Is this scenario (supporting it in the U.I.) on the v1 roadmap?

And yes, StatLight.Core.dll should not be added as a project level reference and is only there to support StatLight.exe.

Oct 19, 2010 at 12:06 AM

I think we had decided that it wouldn't be in v1.  The reasoning is two-fold:

  1. The UI is brought up for a specific project, so it's slightly strange to show packages that would end up not being attached to this project.  I supposed we could have a solution level dialog for those (r click on sln)
  2. Those packages typically bring in new commands that then need to be run from the Console (like StatLight.exe).  So users who install these are bound to use the console, and hence it's not so bad to make them install it via the Console as well.
Oct 19, 2010 at 12:30 AM

I was able to figure it out through the "Package Manager Console" how to add StatLight with NuPack. (Thanks for the tip).

Does this mean for this class of tool I should look into writing a powershell cmdlet to wrap StatLight? Not a bad idea since I generally use it within powershell anyway...

I do think you should consider a G.U.I. install option for the class of tool that sits outside of a project. EX: Unit Testing runners (xunit, nunit) - I know they have an assembly referenced component, but the tooling is not the same.

Thanks for the dialog.

Oct 19, 2010 at 12:48 AM

I don't think you necessarily have to add cmdlets.  Note that after installing the package, you'll find that StatLight.exe is on the path in the Console, so you can just use it.