<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to make generated resource class public</title><link>http://blogs.msdn.com/lifenglu/archive/2006/03/16/553348.aspx</link><description>If you create managed application in Visual Studio 2005, you will notice that a resource class is generated when you add resources to the resx file. The class makes getting resource values much easier. But some are troubled because the class is generated</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: How to make generated resource class public</title><link>http://blogs.msdn.com/lifenglu/archive/2006/03/16/553348.aspx#2490721</link><pubDate>Wed, 09 May 2007 03:16:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2490721</guid><dc:creator>Lifeng Lu</dc:creator><description>&lt;p&gt;Note: in VS next version, VS supports to generate public strong type resource class directly.&lt;/p&gt;
</description></item><item><title>re: How to make generated resource class public</title><link>http://blogs.msdn.com/lifenglu/archive/2006/03/16/553348.aspx#3151122</link><pubDate>Fri, 08 Jun 2007 03:19:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3151122</guid><dc:creator>Lifeng Lu</dc:creator><description>&lt;p&gt;The feature (PublicResXFileCodeGenerator) is broken in beta 1 product, because one setup registry item hasn't been updated after a version number update. &amp;nbsp;However, it is easy to patch the machine by updating a few registry items.&lt;/p&gt;
&lt;p&gt;It is mentioned in the readme document of beta1: &lt;a rel="nofollow" target="_new" href="http://download.microsoft.com/download/7/8/7/7876F535-3722-4986-8E55-F92DD55675AA/Express_contents.htm"&gt;http://download.microsoft.com/download/7/8/7/7876F535-3722-4986-8E55-F92DD55675AA/Express_contents.htm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;in 1.4.14 section said you need update a few registries:&lt;/p&gt;
&lt;p&gt;[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\%SKU%\9.0\CLSID\{74d398e9-7cc3-4ff2-9a4d-acd177f40b58}] &amp;quot;InprocServer32&amp;quot;=&amp;quot;C:\\WINDOWS\\system32\\mscoree.dll&amp;quot; &amp;quot;Class&amp;quot;=&amp;quot;Microsoft.VisualStudio.Design.Serialization.PublicVBMyResXFileCodeGenerator&amp;quot; &amp;quot;Assembly&amp;quot;=&amp;quot;Microsoft.VisualStudio.Design, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&amp;quot; &amp;quot;ThreadingModel&amp;quot;=&amp;quot;Both&amp;quot; @=&amp;quot;Microsoft.VisualStudio.Design.Serialization.PublicVBMyResXFileCodeGenerator&amp;quot; &lt;/p&gt;
&lt;p&gt;[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\%SKU%\9.0\CLSID\{69b6a86d-ef43-4d9e-a758-8a18b38a7384}] &amp;quot;InprocServer32&amp;quot;=&amp;quot;C:\\WINDOWS\\system32\\mscoree.dll&amp;quot; &amp;quot;Class&amp;quot;=&amp;quot;Microsoft.VisualStudio.Design.Serialization.PublicResXFileCodeGenerator&amp;quot; &amp;quot;Assembly&amp;quot;=&amp;quot;Microsoft.VisualStudio.Design, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&amp;quot; &amp;quot;ThreadingModel&amp;quot;=&amp;quot;Both&amp;quot; @=&amp;quot;Microsoft.VisualStudio.Design.Serialization.PublicResXFileCodeGenerator&amp;quot; &lt;/p&gt;
&lt;p&gt;The %SKU% here should be picked up to match what SKU (vb express, visual studio, or other express) you installed. &amp;nbsp;Check the registry with regedit, you know where to fix it. &amp;nbsp;The only thing has been changed is the version number of the full qualified assembly name.&lt;/p&gt;
</description></item><item><title>MonoRail - Collocate your Strings</title><link>http://blogs.msdn.com/lifenglu/archive/2006/03/16/553348.aspx#3482492</link><pubDate>Sat, 23 Jun 2007 17:33:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3482492</guid><dc:creator>Insert Catchy Title Here</dc:creator><description>&lt;p&gt;MonoRail - Collocate your Strings&lt;/p&gt;
</description></item><item><title>MonoRail - Collocate your Strings</title><link>http://blogs.msdn.com/lifenglu/archive/2006/03/16/553348.aspx#3853386</link><pubDate>Sat, 14 Jul 2007 01:07:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3853386</guid><dc:creator>Insert Catchy Title Here</dc:creator><description>&lt;p&gt;MonoRail - Collocate your Strings&lt;/p&gt;
</description></item><item><title>re: How to make generated resource class public</title><link>http://blogs.msdn.com/lifenglu/archive/2006/03/16/553348.aspx#4612651</link><pubDate>Tue, 28 Aug 2007 16:39:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4612651</guid><dc:creator>amit_chat</dc:creator><description>&lt;p&gt;I have tried the same thing but when I try to access the resource (from other project) by using that class it gives me following error..&lt;/p&gt;
&lt;p&gt;&amp;quot;Could not find any resources appropriate for the specified culture or the neutral culture. &amp;nbsp;Make sure \&amp;quot;SocResources.resources\&amp;quot; was correctly embedded or linked into assembly \&amp;quot;Rules Prototype\&amp;quot; at compile time, or that all the satellite assemblies required are loadable and fully signed.&amp;quot;&lt;/p&gt;
&lt;p&gt;Is there something I am missing?&lt;/p&gt;
</description></item><item><title>re: How to make generated resource class public</title><link>http://blogs.msdn.com/lifenglu/archive/2006/03/16/553348.aspx#4633248</link><pubDate>Wed, 29 Aug 2007 22:52:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4633248</guid><dc:creator>Lifeng Lu</dc:creator><description>&lt;p&gt;First, ensure that &amp;quot;Build Action&amp;quot; of the resx is set to &amp;quot;Embedded Resource&amp;quot;, so it will be embedded into the assembly. &lt;/p&gt;
&lt;p&gt;Second, well, if you are using VB, the code generated by the resGen.exe doesn't work well when root namespace is set. &amp;nbsp;The problem is that VB compiler automatically add a root namespace to the class, while resGen doesn't expect it. &amp;nbsp;If you open the generated code, see how it creates the resource manager, the resource name used there does not contain the root namespace.&lt;/p&gt;
&lt;p&gt;To workaround this, you can set root namespace of your resource assembly to be empty. &amp;nbsp;Or, you can edit the project file again to ensure that the logicName of the resource item does not contain the rootNamespace.&lt;/p&gt;
&lt;p&gt;It would look like:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;EmbeddedResource Include=&amp;quot;Resource1.resx&amp;quot; &amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;SubType&amp;gt;Designer&amp;lt;/SubType&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;LogicalName&amp;gt;Resource1.resources&amp;lt;/LogicalName&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;/EmbeddedResource&amp;gt;&lt;/p&gt;
&lt;p&gt;after you change it.&lt;/p&gt;
&lt;p&gt;Hope this could resolve your problem.&lt;/p&gt;
&lt;p&gt;BTW, generating public resource classes is working in Orcas beta 2. &amp;nbsp;&lt;/p&gt;
</description></item><item><title>re: How to make generated resource class public</title><link>http://blogs.msdn.com/lifenglu/archive/2006/03/16/553348.aspx#6548713</link><pubDate>Tue, 27 Nov 2007 14:28:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6548713</guid><dc:creator>snowjim</dc:creator><description>&lt;p&gt;Hey!&lt;/p&gt;
&lt;p&gt;I have some problems to implement this fine solution of yours.&lt;/p&gt;
&lt;p&gt;I have created a couple of resx files and I am have set them up as you have stated.&lt;/p&gt;
&lt;p&gt;The cs file are created on build but it is not included into the project?&lt;/p&gt;
&lt;p&gt;No errors are thrown on build!?&lt;/p&gt;
&lt;p&gt;This is how my project file looks like:&lt;/p&gt;
&lt;p&gt; &amp;lt;Import Project=&amp;quot;$(MSBuildBinPath)\Microsoft.CSharp.targets&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;!-- To modify your build process, add your task inside one of the targets below and uncomment it. &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; Other similar extension points exist, see Microsoft.Common.targets.--&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;Target Name=&amp;quot;BeforeBuild&amp;quot; DependsOnTargets=&amp;quot;CreateStrongTypeResource&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;Target Name=&amp;quot;CreateStrongTypeResource&amp;quot; DependsOnTargets=&amp;quot;GenStrongTypeResource&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;CreateItem Include=&amp;quot;GUI.cs&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Output TaskParameter=&amp;quot;Include&amp;quot; ItemName=&amp;quot;Compile&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;/CreateItem&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;/Target&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;Target Name=&amp;quot;GenStrongTypeResource&amp;quot; Inputs=&amp;quot;GUI.resx&amp;quot; Outputs=&amp;quot;GUI.cs&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;GetFrameworkSdkPath&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Output TaskParameter=&amp;quot;Path&amp;quot; PropertyName=&amp;quot;SdkPath&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;/GetFrameworkSdkPath&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;Exec Command=&amp;quot;&amp;amp;quot;$(SdkPath)bin\resGen.exe&amp;amp;quot; /str:c# /publicClass GUI.resx&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;/Target&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;!-- &lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;Target Name=&amp;quot;AfterBuild&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;/Target&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;--&amp;gt;&lt;/p&gt;
&lt;p&gt;The resx file I am testing is GUI.resx&lt;/p&gt;
&lt;p&gt;This project are Teamfoundation sourcesafe controled.&lt;/p&gt;
&lt;p&gt;I have a reference from another project to this resx project but there is no namespaces or resources to get!?&lt;/p&gt;
&lt;p&gt;What have i missed?&lt;/p&gt;
</description></item><item><title>re: How to make generated resource class public</title><link>http://blogs.msdn.com/lifenglu/archive/2006/03/16/553348.aspx#6562798</link><pubDate>Wed, 28 Nov 2007 02:37:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6562798</guid><dc:creator>Lifeng Lu</dc:creator><description>&lt;p&gt;With those changes, the GUI class will be generated without any namespace, so you couldn't see it in the default namespace of the class library. In that case, you want to change the command line to be:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;lt;Exec Command=&amp;quot;&amp;amp;quot;$(SdkPath)bin\resGen.exe&amp;amp;quot; /str:c#,ClassLibrary1 /publicClass GUI.resx&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; That also saves you time, so you don't have to change the logicName of the resource item.&lt;/p&gt;
&lt;p&gt; You don't need do this in a VB project, because the compiler will apply default namespace automatically. That is however, not done in C# projects.&lt;/p&gt;
</description></item><item><title>re: How to make generated resource class public</title><link>http://blogs.msdn.com/lifenglu/archive/2006/03/16/553348.aspx#8800981</link><pubDate>Fri, 01 Aug 2008 20:33:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8800981</guid><dc:creator>Lifeng Lu</dc:creator><description>&lt;p&gt;Generating public class is not directly supported in the Visual Studio 2008. &amp;nbsp;To enable this function, open the resource designer, and on the top of the designer(right side), &amp;quot;Access Modifier&amp;quot; will allow you to select whether to generate a public class.&lt;/p&gt;
&lt;p&gt;This function will resolve the most problem we talked here, so editing the project file is no longer needed.&lt;/p&gt;
</description></item></channel></rss>