MPF projects in the solution block "Create Unit Tests" wizard


To repro, you have to do the following:
  1. You create a solution, with a standard c# class library.
  2. You add a custom project to the solution that is based on MPF.
  3. Go to "Class1" class of the class library.
  4. Select "Create Unit Tests..." from the context menu of the class.
    The window will be empty, and you cannot select Class1. If you unload the MPF-based project, the wizard works again.

file attachments


GasparNagy wrote Dec 4, 2008 at 2:41 PM

It seems that the problem is, that VS gets the OUTPUTLOC property from the Microsoft.VisualStudio.Project.Output class of the MPF-based project (get_Property). As this property is not supported, the method throws a NotImplementedException, but the wizard does not catch the exceptions by project so the entire wizard is disabled.

I have fixed it for myself by returning the output assembly path for this property:
if (string.Equals(szProperty, "OUTPUTLOC", StringComparison.OrdinalIgnoreCase))
value = output.GetMetadata(ProjectFileConstants.Include);

It could be also fixed in the ProjectElement class as well, but this is rather related to the IVsOutput2 interface, so it is better here IMHO. I did not find any documentation for OUTPUTLOC anyway...

It is very good that MPF came to codeplex. I would be happy to contribute as well.

GasparNagy wrote Dec 5, 2008 at 6:58 AM

Here is my fix for the problem. The change is in the Output.cs and I have extended the unit test environment as well to be able to test this.

wrote Dec 5, 2008 at 6:58 AM

wrote Feb 13, 2013 at 11:30 PM