Msbuild Resource Generation customization.

Hi
well i m working on mobile application , our application will support device of varying resoultion and oreintation.(320*240, 240*320,640*480,480*640 to name a few). for this reason , i m using Orientation Aware Control, from MS Patterns and Practice , Mobile Client Software Factory group.
OAC(orienation aware control ) makes use of Localization feature, OAC keeps different resx files for different oreintation and resolution. e.g
here is a control and its associated file
MyControl.cs
MyControl.Designer.cs(Depends on MyControl.cs)
MyControl.resx (Depends on MyControl.cs)
MyControl.resource (Depends on MyControl.cs
MyControl.320-240.resx (Depends on MyControl.resource)
MyControl.320-240.resx (Depends on MyControl.reoource)
and ...
in csproj

<Compile Include="MyUserControl.cs">
<SubType>UserControl</SubType>
</Compile>
<None Include="MyUserControl.resources">
<DependentUpon>MyUserControl.cs</DependentUpon>
</None>
<Compile Include="MyUserControl.Designer.cs">
<DependentUpon>MyUserControl.cs</DependentUpon>
</Compile>

<EmbeddedResource Include="MyUserControl.480-640.resx">
<SubType>Designer</SubType>
<DependentUpon>MyUserControl.resources</DependentUpon>

</EmbeddedResource>

so far so good

this works fine when ur source code hierarcy is same as physical folder structure but if u move e.g the above control into a folder ,say, it becomes Folder1/MyUserControl , without changing the namespace, then the generated resource for resx from OAC will have Folder1 in their manifest name, and therefore they are not able to be retrieved at run time . I have a source code hierarchy in which there are different folder , e.ge
src/company/product/usercontrol/mycontrol
whereas the namespace is company.product.usercontrol.mycontrol

After quite exhaustive search i found the naming rules for the VS on channel 9. They suggested 2 options for acheiving the desired behaviour first is overrrideing the CreateManifestNames Task and 2nd is to provide LogicalName Metadata for resolution related resource files e.g MyUserControl.
i used the later approach, :)
<LogicalName>OutlookControlTest.MyUserControl.480-640.resource</LogicalName>
:):)
now the names are generating properly but still the resrouces are not embeded properly
i looked thru Reflector ,the controls without logical name specified have resrouces visible in the dissembler window, but for the cntorls with logical names specififed the resource have entries but a hex display is shown in the disssemble window, and the application didnt work.

all i want is to override the naming behavoir of resources, nothing more , but it looks like somehting somwhere is doing more then waht i need :),
any thougts on how to achieve the desired behaviour
here is a snippet from OAC docs refering to why the folder hierarchy should be consistent with namespace hierarchy .

"This is required as the behavior of the MSBuild task that embedds the resources is different dependending on whether the .resx file depends directly on a class (i.e. a control) or not. In the former case, the resource will be embedded prepending the owner control namespace. In the latter, however, it will prepend the owning project default namespace and the physical path from the project root to the item. This happens even if the .resx file is indirectly dependent on a control (such as in our case, where the [Control].resources dummy file serves as a grouping item). The reason for having the .resources file is because otherwise the built-in task that embedds the resource will incorrectly report that duplicated resources exist. This happens because while generating the resource names, it will basically strip the part of the custom culture info that it does not understand (i.e. 320-240_en-US will be turned into en-US), therefore, there will be duplicate resource names if multiple resolution resources exist for the same culture. "

do i have to write a task myselft ?
or there can be something that i can configure

regards
faraz

[4300 byte] By [SyedFarazMahmood] at [2007-12-24]
# 1
opps!!
i did a spelling mistake , in logicalname tag , it should .resources not .resource
and it is running pretty fine now :D

regards

SyedFarazMahmood at 2007-8-31 > top of Msdn Tech,Visual Studio,Visual Studio MSBuild...
# 2
ok
NomanJuzarLakdawala at 2007-8-31 > top of Msdn Tech,Visual Studio,Visual Studio MSBuild...

Visual Studio

Site Classified