Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / October 2006

Tip: Looking for answers? Try searching our database.

Embedded Resource Name Specification

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris  Moore - 18 Oct 2006 20:24 GMT
SUMMARY: I want to override the default embedded resource naming
convention and excercise complete control over the name of an embedded
resource within an assembly.

DETAIL: For non-dependent files, visual studio names a resource
according to the convention <default
namespace>.<FolderName>.<FileName>. How can some other name for a given

resource be specified? I am willing to manually modify the project file

if necessary.

Thank You,
Chris Moore
Bryan Phillips - 19 Oct 2006 03:51 GMT
Bryan Phillips
MCSD, MCDBA, MCSE
Blog:  http://bphillips76.spaces.live.com

> SUMMARY: I want to override the default embedded resource naming
> convention and excercise complete control over the name of an embedded
[quoted text clipped - 10 lines]
> Thank You,
> Chris Moore
Bryan Phillips - 19 Oct 2006 03:52 GMT
The file name does not matter.  You can manually edit the project file
with notepad if you need to.

Bryan Phillips
MCSD, MCDBA, MCSE
Blog:  http://bphillips76.spaces.live.com

> SUMMARY: I want to override the default embedded resource naming
> convention and excercise complete control over the name of an embedded
[quoted text clipped - 10 lines]
> Thank You,
> Chris Moore
Chris  Moore - 19 Oct 2006 14:46 GMT
Bryan,

Thanks for your response; however, I'm not sure we're on the same page
here. Let me try to present my problem more clearly:

Visual Studio/MSBuild uses a "dependency" scheme that can associate a
resource file with a given class. This mechanism is used, for instance,
to bind RESX files with their associated forms. Among other things,
this allows the environment to display the dependent resource files as
child nodes of the associated form classes. For example, to associate
the resource "Person.xml" resource with the file "Person.cs" one would
configure the MBBuild file thusly:

   <Compile Include="Person.cs"/>
   <EmbeddedResource Include="Person.xml">
     <DependentUpon>Person.cs</DependentUpon>
   </EmbeddedResource>

The compiler will embed the mapping resource with the name of the type
with which it is associated "Person" instead of the full name of the
file "Person.xml".

Is there a way to override this convention so that, for example, the
compiler will embed the Person.xml resource with the name "Person.xml"
instead of just "Person"?

Thanks,

Chris Moore

> The file name does not matter.  You can manually edit the project file
> with notepad if you need to.
[quoted text clipped - 17 lines]
> > Thank You,
> > Chris Moore
Bryan Phillips - 26 Oct 2006 03:24 GMT
When I set files to Embedded Resource in a project, both the filename
and file extension are used for the name.  I figure that since your
related file is a class that that is what is causing the naming
difference.  You could write a small console app to fix the embedded
name and configure the project to execute the app post-build.  I have
done that a few times when I needed to modify attributes or IL code
after the build.

Bryan Phillips
MCSD, MCDBA, MCSE
Blog:  http://bphillips76.spaces.live.com

> Bryan,
>
[quoted text clipped - 47 lines]
> > > Thank You,
> > > Chris Moore

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.