Performance - CabGen Problem

Topics: CAB & Smart Client Software Factory, Mobile Client Software Factory
Sep 4, 2007 at 10:05 AM
Edited Sep 4, 2007 at 10:22 AM
hello every body,
i have a performance issue with my application and after investigation i found that there is a tool released with the Mobile Client Software Factory called CabGen and ObGen that deal with removing the impact of reflection on the App on Loading and run time, and there were an article that say that nothing is preventing to use this tool in the ordinal Microsoft.Practice instead of the mobile version, the question is : i already download the MCSF and build the tool but i alwas get an exception when i pass the assemblly path and name to the tool , is there any one that can help with this with a detailed and clear instruction on how to solve this , and also because this issue dosent have enough docummentation over the web so we can all benefit from this.

********************************EXCEPTION DETAIL********************************************************


C:\Program Files\Microsoft Mobile Client Software Factory\Tools\CabGen\Src\bin\D
ebug>cabgen "D:\Workspace\Project\bin\Debug\Client.Shell.exe"

c:\Documents and Settings\Administrator\Local Settings\Temp\7djqzdzr.0.cs(12,31)
: error CS0234: The type or namespace name 'Mobile' does not exist in the names
pace 'Microsoft.Practices' (are you missing an assembly reference?)
c:\Documents and Settings\Administrator\Local Settings\Temp\7djqzdzr.0.cs(15,37)
: error CS0246: The type or namespace name 'IModuleMetadataProvider' could not
be found (are you missing a using directive or an assembly reference?)
c:\Documents and Settings\Administrator\Local Settings\Temp\7djqzdzr.0.cs(21,33)
: error CS0246: The type or namespace name 'ModuleMetadata' could not be found
(are you missing a using directive or an assembly reference?)
c:\Documents and Settings\Administrator\Local Settings\Temp\7djqzdzr.0.cs(17,29)
: error CS0234: The type or namespace name 'Mobile' does not exist in the names
pace 'Microsoft.Practices' (are you missing an assembly reference?)

Unhandled Exception: System.Resources.MissingManifestResourceException: Could no
t find any resources appropriate for the specified culture or the neutral cultur
e. Make sure "Microsoft.Practices.CompositeUI.CabGen.Properties.Resources.resou
rces" was correctly embedded or linked into assembly "CabGen" at compile time, o
r that all the satellite assemblies required are loadable and fully signed.
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo cultur
e, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo cultur
e, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo cultur
e, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetString(String name, CultureInfo cultur
e)
at Microsoft.Practices.CompositeUI.CabGen.Properties.Resources.get_Done() in
C:\Program Files\Microsoft Mobile Client Software Factory\Tools\CabGen\Src\Prope
rties\Resources.Designer.cs:line 68
at Microsoft.Practices.CompositeUI.CabGen.Program.Main(String[] args) in C:\P
rogram Files\Microsoft Mobile Client Software Factory\Tools\CabGen\Src\Program.c
s:line 66

***********************************************************************************************************

this is for the EXE file of the main Shell

But if we try to do the same on a DLL file of a Module we get the followinf exception
*******************************EXCEPTION Detail***********************

No configuration section found for the code generation. Section named objectBuilder
of type Microsoft.Practices.ObjectBuilder.ObGen.ObjectBuilderSection is required.

******************************************************************************


Thanks and sorry
Sep 23, 2007 at 2:57 AM
Edited Sep 23, 2007 at 2:58 AM
CabGen has some problems embedding resource files. I dont know why and I didnt look up, but I replaced the uses of Resources.ANYTHING for hardcoded strings and it just did the trick. We dont care about globalization just about a tool that works.

For the second error I guess you have a config error, you probably need to reference the Mobile OB when using obgen, just a tip, but I'm not sure.

We have done a lot of little fixes to both tools and we have all our mobile modules compiling now, we will be trying this next week and post the fixed code somewhere. We have not done any work for the desktop version, in case you would like to contribute with the Smart Client part of it, just contact me.
miguelmadero.com
junk at intecmex dot com
Sep 27, 2007 at 8:48 AM
We encounter exactly the same problems (and exceptions) as bekit4. Beside CAB we also use OrientationAwareControl from Clarius Consulting, which seems to rely quite a lot on resource files.
Does this mean we are doomed when it comes to the two tools?

We are also very interested in the improvements you have done, mamadero.

Best Regards
Tommy
Oct 5, 2007 at 2:16 AM
Not exactly doomed, but someone would have to fix those :(
For us it simply worked with hard coded strings. Probably recreating the resx files would work but we neve tried.

About the fixes, we will be posting soon an updated version of MCSF. We have done this for internal use for a while, so we dont have a product ready for release. If you want what we have now at least for CABGen and OBGen contact me
miguelmadero.com
junk at intecmex dot com
Feb 22, 2008 at 3:04 PM
Edited Feb 22, 2008 at 3:05 PM
Any news on the Smart Client part of CABGen and OBGen?
I haven't been able to find anything elsewhere on the site.

Also could you please post a link to the updated version of MCSF.
Feb 22, 2008 at 8:33 PM
All updates we are doing for MCSF will be hosted on the MobileBlocks Project in Codeplex
www.codeplex.com/mobileblocks
We dont have a release yet, but you can get the source code, it's working for VS08.
Feb 26, 2008 at 10:27 AM
I have encountered the same problems as above with the resource files. After changing to hardcoded strings i don't get the exception anymore.
I still get the:
"c:\Documents and Settings\Administrator\Local Settings\Temp\7djqzdzr.0.cs(12,31) : error CS0234: The type or namespace name 'Mobile' does not exist in the namespace 'Microsoft.Practices' (are you missing an assembly reference?)" errors/warnings though.
The program finishes with "Done" but the only visible result is a ***.Module.cabgen.cs file with some generic code.
What is the expected output?
Feb 26, 2008 at 2:36 PM
You must have the references in the same directory of the dll you're optimizing.
The output should be a dll, named something like originalName.cabgen.dll or originalName.obgen.dll depending on the tool you are using.