Code analysis, VSLangProj and EnvDTE

Tuesday, 27 November 2007

If you have a Visual Studio add-in that references the VSLangProj assembly, that assembly implicitly refererences the EnvDTE assembly (version 7.0.3300.0). However that version of EnvDTE doesn't ship with VS2008.

There is a binding redirect in place for Visual Studio (via a devenv.exe.config file), but this doesn't appear to work for the Code Analysis command. I tried modifying the fxcopcmd.exe.config file to no avail.

The is the error I'm seeing:

Running Code Analysis...
C:\Program Files\Microsoft Visual Studio 9.0\Team Tools\Static Analysis Tools\FxCop\FxCopCmd.exe  /outputCulture:1033 /out:"bin\Debug\Altinoren.ActiveWriter.Dsl.dll.CodeAnalysisLog.xml" /file:"bin\Debug\Altinoren.ActiveWriter.Dsl.dll" /dictionary:"..\CodeAnalysisDictionary.xml" /directory:"C:\Program Files\Common Files\Microsoft Shared\MSEnv\PublicAssemblies" /directory:"C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PublicAssemblies" /directory:"C:\Windows\Microsoft.NET\Framework\v2.0.50727" /directory:"C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies" /directory:"C:\Program Files\Microsoft Visual Studio 2008 SDK\VisualStudioIntegration\Common\Assemblies" /directory:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5" /rule:"C:\Program Files\Microsoft Visual Studio 9.0\Team Tools\Static Analysis Tools\FxCop\Rules" /searchgac /ignoreinvalidtargets /forceoutput /successfile /ignoregeneratedcode /saveMessagesToReport:Active /timeout:120
MSBUILD : error : CA0001 : The following error was encountered while reading module 'Altinoren.ActiveWriter.Dsl': Assembly reference not resolved: EnvDTE, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
MSBUILD : error : CA0058 : The referenced assembly 'EnvDTE, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' could not be found. This assembly is required for analysis and was referenced by: 'Altinoren.ActiveWriter.Dsl.dll'.
Code Analysis Complete -- 2 error(s), 0 warning(s)

Update 29th November 2007:

David Kean has responded to my query in the MSDN forums with a workaround to this problem.

ActiveWriter for VS 2008

Monday, 26 November 2007

One of the recent additions to our toolkit has been ActiveWriter - a GUI for generating NHibernate classes and mapping files.

So before we can make the final jump to using 2008 for all our development, ActiveWriter needs to work.

Gökhan is planning an update that will work on 2008 - hopefully in a few weeks.

Wondering if it might not be too hard to do the port myself, I dove in and pointed VS 2008 at the latest source code.

Ouch!

I'm not an expert in the DSL tools stuff (which probably doesn't help), but things do appear have changed a little between 2005 and 2008. I wonder if you're better off creating new projects and copying over the content rather than just doing an upgrade.

Specifically in the ActiveWriter code, it makes use of the IVsDataConnectionsService interface. I'm not sure of the history of this interface, but it does appear that it has disappeared from the 2008 SDK.

Curiously, this interface doesn't even appear documented in the 2005 SDK, and I'm not clear what the appropriate replacement should be.

RikMigrations (database migration)

Monday, 26 November 2007

Roy mentions RikMigrations. I too am quite ignorant about Ruby, though I am certainly aware of how popular it has become.

Something to keep an eye on which might be useful in the future.

Currently we use Red Gate's SQL Compare to do a diff between our test and production databases. SQL Compare then generates the necessary T-SQL to modify the production schema to synchronise it to the same as test.

This works very well for us, so I'm interested as to what benefits a tool like RikMigrations would bring.

New phone

Thursday, 22 November 2007

My new phone was delivered this afternoon.

It is a HTC TyTN II.

It came in a very cool box.

I've unpacked it, and it is now charging.

I'm being very patient.

Visual Studio 2008 RTM - First impressions

Thursday, 22 November 2007

I haven't done heaps with 2008 since installing it yesterday.

I did investigate opening one of our existing projects to see if I could create a 2008 solution, while leaving the 2005 solution intact so that other people could still use 2005 to work on the code. I'd read that this is possible.

I struck a problem though - it looks like this strategy doesn't work for web applications projects.

The upgrade wizard modifies the path in the project file to where the web application project msbuild stuff gets included from. This would obviously not work for other team members who didn't also have 2008 installed on their machines.

So it looks like the best plan is to make sure everyone on the team starts using 2008 at the same time.

I also need to confirm that all our various addins and dependencies also continue to work - things like PageMethods and ActiveWriter are good examples.

It is nice to have the IDE start without requiring it to run in Admin mode on Vista though.