Unexpected behavior with .Net ResourceManager in Revit 2012

By Saikat Bhattacharya

The existing Revit apps which uses the ResourceManager to pull out values from a resource file (resx) placed within the assembly worked well with Revit 2011 but stopped working when migrated to Revit 2012. During the migration of Revit 2011 apps to work with Revit 2012, after changing the references to API dlls and changing the target framework to .Net 4.0, the project compiles fine but while loading the app in Revit, it displays an dialog prompting the user to select an assembly that can not be resolved automatically (the dialog is the Assembly File Selector dialog). Some in-depth investigation revealed that this behavior was not related to Revit or its API but was due to the new globalization features in .NET Framework 4. For more details, please refer to:  http://msdn.microsoft.com/en-us/netframework/dd890508.aspx

Adding the following entry to the AssemblyInfo.cs file helped resolve the problem:

[assembly: System.Resources.NeutralResourcesLanguage("en-US")]


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading