resource generation

I have three (VB) projects which share a couple of user controls. One project 
contains the actual source files whilst the others have a Link to the source.

When I run the code, the resource manager fails to locate the resources for 
the controls when instantiated via the "Link" scenario. Investigation shows 
that the embedded resources have the root (filename/namespace) of the 
original project.

Am I doing something wrong  Has anyone come across this before.
anyone come across this before.


Answer this question

resource generation

  • Ray_CA

    I don't fully understand your problem. Did you have three VB projects, and you add source code files in one project to another one as links

    Do you mean that you created those projects as Windows Applications Besides sharing some source files, they don't depend on each other. (When we talk about dependency between projects, we mean that one of them is a control library, and another one has a reference to the control library.)

    When I add source code files of a user-control into another project, I saw *.designer.vb and *.resx of the user control have been added as linked item at the same time. (You can turn on "Show All files" in the solution explorer window to see those items.) After that, I compiled and ran the project, but didn't see any problem.

    However, it is fairly easy to hit problems, if you share source files between two projects. If the source code depends on anything in one project, for example, a global resource item, it will fail, unless you copy those items correctly. (I am not sure whether it is the problem you saw.)

    That is why most people would create a control-library project to share user-controls between projects.

    Could you explain more about your issue, and verify whether I understand it correctly And we will see what is wrong with it.

    Thanks

    Lifeng

    MS VB Team



  • sosleepy

    It sounds a bug in VS 2003. I could reproduce the issue you saw. After I tried a little bit, I guess you might be able to work around this issue, by put the original file inside the application project, and add the link in the control library project.

    Thanks

    Lifeng Lu

    MS VB Team



  • kc0rsc

    Not quite,

    2 Things,

    1. It appears this is a VS2003 issue - it works fine in VS2005 ( but we can't upgrade until Vs"005 is stable)

    2. In this case, the three projects are actually class libraries and not distinct applications a fourth project uses the available classes for display etc.

    I have three wizards

    Company.Wizards.A
    Company.Wizards.B
    Company.Wizards.C

    When the list of embeded resources is displayed (via reflection) in the Wizard B the resources show as belonging to the original library's (different) namespace.

    Company.Wizards.A.control1.resources
    Company.Wizards.A.control2.resources
    Company.WIzards.B.form1.resources

    control1 and control2 are "Shared"

    The specific error I get is "Could not find any resources apprpriate for the specified culture ... etc' Make sure x.Resources is correctly embedded or linked into assembly Company.Wizards.X


  • resource generation