Visual Studio 2008 Compatibility

May 16, 2012 at 11:24 PM

First off, thanks for the hard work on release 4.7.22 so quickly.

I'm not sure which update (but I believe it is somewhere after 4.7.19) broke it, but Visual Studio 2008 is now reporting errors loading StyleCop.dll.

More specifically, MSBuild v3.5 can't load something:

 

The "StyleCopTask" task could not be loaded from the assembly C:\Program Files (x86)\MSBuild\..\StyleCop 4.7\StyleCop.dll. Could not load file or assembly 'file:///C:\Program Files (x86)\StyleCop 4.7\StyleCop.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. Confirm that the  declaration is correct, and that the assembly and all its dependencies are available.

 

My question is: is building StyleCop using a newer runtime intentional (i.e., is Visual Studio 2008 support being deprecated)?

Coordinator
May 16, 2012 at 11:54 PM
Edited May 17, 2012 at 11:20 AM
I changed the dlls to target framework 4 instead of 3.5.
But if you have 4.0 framework installed it should work fine.
Or so I thought. :-)
Do you have 4.0 installed?
May 16, 2012 at 11:59 PM

I do have 4.0 installed. Everything works fine under Visual Studio 2010 and MSBuild 4.0.

I'm working on a project that targets both 3.5 and 4.0. I don't do full builds until I'm about to release, and primarily work in the 4.0 environment. That's why I didn't discover the issue immediately.

Anyway, it appears as if you can't import 4.0 DLLs into MSBuild 3.5 build scripts.

Coordinator
May 17, 2012 at 11:52 AM

Removing support for VS2008 was not my intention. I'm rolling this back now.

Coordinator
May 17, 2012 at 2:47 PM

Fixed in checkin 07f64ec59887

May 17, 2012 at 5:15 PM

Thank you for this. That is great news.