Welcome to AspAdvice Sign in | Join | Help

ResXFileCodeGeneratorEx and Visual Studio 2008

A couple of months ago I found a great Extended Strongly Typed Resource Generator that would let me use Resource files in shared libraries (Brendan blogged about it and set it up).  The default resource generator in Visual Studio generates code that is marked with the internal keyword, making it difficult to share the resources between assemblies or projects.  The Extended Strongly Typed Resource Generator avoids the problem and adds some other enhancements that make it a great tool.  However, at present it doesn't work with Visual Studio 2008.

There's a fix that will get you partway there.  I found it in a comment on the CodeProject version of the code, and I've included it below:

we need to change the path from
@"SOFTWARE\Microsoft\VisualStudio\8.0\Generators\{0}\{1}"
to
@"SOFTWARE\Microsoft\VisualStudio\9.0\Generators\{0}\{1}"
inside method "registryKeyPathBuilder" in registryKeyPathBuilder.cs file and all working fine

Make this change to the source project, and you'll at least be using the right path for VS2008.  However, then you'll run into a nasty VS2008 bug:

"The assembly 'Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not registered for COM Interop. Please register it with regasm.exe /tlb."

 

This is described in this forum thread, and apparently it's a known issue that will be fixed in SP1, and in the meantime you can get a hotfix if you contact Ed Dore of Microsoft.  I'm sending him an email now and hope to have a fix soon, but in the meantime I'm keeping VS2005 around so that I can compile my resource files using this tool.
Published Monday, January 28, 2008 2:12 AM by ssmith
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# ResXFileCodeGeneratorEx and Visual Studio 2008

Monday, January 28, 2008 6:00 AM by ResXFileCodeGeneratorEx and Visual Studio 2008

# re: ResXFileCodeGeneratorEx and Visual Studio 2008

VS2008 can generate public as well as internal code, or no code generation at all if you prefer. Check "Access Modifier" dropdown on top of the resx designer.

His "formatted output" support is cool, though.

Monday, January 28, 2008 10:34 AM by Gokhan

# re: ResXFileCodeGeneratorEx and Visual Studio 2008

The hotfix is now available to correct the Shell.Interop.dll issue:

https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=10671

Wednesday, January 30, 2008 3:22 PM by ssmith

# re: ResXFileCodeGeneratorEx and Visual Studio 2008

I'm happy to inform that the new version of the ResXFileCodeGeneratorEx has been released. It supports both VS.NET 2005 and VS.NET 2008, it's compatible with Vista and has many useful hotfixes.

You can download it from http://dmytro.kryvko.googlepages.com/.

Sunday, February 10, 2008 9:19 PM by Dmytro Kryvko

Leave a Comment

(required) 
required 
(required) 
Enter the code you see below