Using managed resources in VSIP packages

Hi,

Can anyone point me to (or just make one up) an example of using managed resources in a VSIP package for VS05 The documentation tells me to set a Microsoft.VisualStudio.Shell.PackageRegistration attribute with UseManagedResourcesOnly set to true on my package and create a ResX file which I then fill with strings, icons etc.

Once I have all of this set up, how do I then use the resources, especially in the InstalledProductRegistration attribute When you use unmanaged resource DLLs, you can just reference it (in InstalledProductRegistration's ProductDetails, ProductName and IconResourceID properties) like #xxx, where xxx is the resource ID of the unmanaged resource. Unfortunately, when I name my resources in the ResX file like this (eg. a string called 101), the ResX compiler says that this is not a valid name. Do I have to reference it like #Namespace.ResXFileName.ResourceName Tongue Tied

Thanks in advance!!


Answer this question

Using managed resources in VSIP packages

  • James K. Howey

    That sample half-answers my question, but it doesn't explain how to use managed resources for registry entries that require / can use localised resources. To put it another way, what's the managed equivalent of the unmanaged '#xxx' syntax used in registry entries for VS

  • Skaladar

    I have a related question.  How does the use of managed resources in VSIP packages relate to vsdir files

    I have a vsdir file that references localized strings in an unmanaged satellite DLL via resource IDs.  I.E. the Localised Name, Description and SuggestedBaseName.  If I set the UsedManagedResourcesOnly flag in my package, it seems like VS is still looking for the resource IDs in a satellite DLL (which I've gotten rid of) and not the managed implementation DLL.

    Note that I followed your suggestion and named an Icon in my managed resource "100" and was able to use that ID in the vsdir file as the IconResourceId, which as documented, is loaded from the implementation DLL anyway....

    Many Thanks!

    Eric


  • Simon Detheridge

    Yeah, that's the behavior I expect.  VS does all the logic of finding the resource correctly regardless of whether it is managed or native.

    Glad it's working for you.

    Allen

  • dr.emulator

    Thanks for the clarification of your query.  The convention that we use in VS for this is to have your managed resources be named with number strings.  So "#xxx" in a native resource would still be registered that way in the registry, but the resource in your managed satellite would be "xxx".  Since resources ID's in managed resources are all alpha-numeric strings and we couldn't go change the VS platform itself for this, we are forced to have the resources ID's be numbers.

    I hope this helps to get you moving along.  If not, please let us know.

    Thanks.

  • DenversAllenB

    The MyProject sample in the VS05 VSIP SDK does this. If your package requires a .CTC resource, this is currently pretty problematic to use, as the project system doesn't yet support compiling a .CTC file outside of a C++ satellite dll.

    I believe this will change before RTM. You can insert the compiled .CTC (the .CTO) manually, but it just doesn't seem like it's worth the hassle right now.

    If your package doesn't require a .CTC resource, I'd recommend giving it a shot. But if you do require a .CTC resource, you may want to avoid it for the time being.

    Sincerely,
    Ed Dore [MSFT]

  • Using managed resources in VSIP packages