XNA Creators Club Online
Page 1 of 1 (5 items)
Sort Posts: Previous Next

Getting a PublicKeyToken for a content pipeline dll

Last post 3/2/2009 10:02 PM by Count. 4 replies.
  • 3/2/2009 10:28 AM

    Getting a PublicKeyToken for a content pipeline dll

    Background: I am creating a level editor and integrated the ContentBuilder class found in the WinForms #2 sample.

    Problem: I am unable to build content that requires my content pipeline dll. It seems to add my custom importers/processors I need to add a reference to the pipeline dll assembly. However, that doesn't seem to work off the bat. I notice that other references added by the ContentBuilder class include a PublicKeyToken. How do I acquire one of those?
    "I must Create a System, or be enslaved by another Man's. I will not Reason & Compare; my business is to Create." - William Blake
  • 3/2/2009 7:04 PM In reply to

    Re: Getting a PublicKeyToken for a content pipeline dll

    The public key token is used for system assemblies that are installed into the GAC (Global Assembly Cache). Such assemblies are referenced by a strong name, which includes the assembly name, version, and key.

    For your own assemblies, you should normally just specify their filename, eg. "c:\myfolder\myassembly.dll".
    XNA Framework Developer - blog - homepage
  • 3/2/2009 9:08 PM In reply to

    Re: Getting a PublicKeyToken for a content pipeline dll

    Shawn Hargreaves:
    The public key token is used for system assemblies that are installed into the GAC (Global Assembly Cache). Such assemblies are referenced by a strong name, which includes the assembly name, version, and key.

    For your own assemblies, you should normally just specify their filename, eg. "c:\myfolder\myassembly.dll".


    Hmmm, maybe I'm missing something because its still not working.

    This is what I get when passing the full path straight up to msBuildProject.AddNewItem("Reference", <path>);
    [22:03:42] Assembly strong name "G:\Coding\Glow\bin\x86\Debug\Glow.exe\GlowPipeline.dll" is badly formed. It may contain characters that need to be escaped with backslash(\). Those characters are Equals(=), Comma(,), Quote("), Apostrophe('), Backslash(\).
    [22:03:43] Cannot autodetect which importer to use for "g:\coding\glow\content\enemy\vvvvv.enemy". There are no importers which handle this file type. Specify the importer that handles this file type in your project.


    So I figure this is probably because I need to double up on the backslashes. I reformat the string with String.Replace("\\", "\\\\") but it still doesn't work.

    Assembly strong name "G:\\Coding\\Glow\\bin\\x86\\Debug\\Glow.exe\\GlowPipeline.dll" is badly formed. It may contain characters that need to be escaped with backslash(\). Those characters are Equals(=), Comma(,), Quote("), Apostrophe('), Backslash(\).
    Do I need to pass something else/more than just the path?

    Thanks for your time.
    "I must Create a System, or be enslaved by another Man's. I will not Reason & Compare; my business is to Create." - William Blake
  • 3/2/2009 9:37 PM In reply to

    Re: Getting a PublicKeyToken for a content pipeline dll

    string.Replace won't work if the \ characters have already been interpreted as escape sequences. You should either write the double \\ directly in your source string constant, or disable escape characters by using an @"like this" format string instead of just "like this".

    I'm also a little confused by the format of the string you are passing. Do you really have a folder called "glow.exe" with a DLL file inside it? Try renaming that folder to not have a .exe extension.

    Final thing to check: is G: by any chance a network drive?
    XNA Framework Developer - blog - homepage
  • 3/2/2009 10:02 PM In reply to

    Re: Getting a PublicKeyToken for a content pipeline dll

    Shawn Hargreaves:
    I'm also a little confused by the format of the string you are passing. Do you really have a folder called "glow.exe" with a DLL file inside it? Try renaming that folder to not have a .exe extension.


    Argh why didn't I see that... I formatted the dll name off System.Windows.Forms.Application.ExecutablePath but missed that.

    It works fine now, thanks again.
    "I must Create a System, or be enslaved by another Man's. I will not Reason & Compare; my business is to Create." - William Blake
Page 1 of 1 (5 items) Previous Next