Help with encrypting connection strings

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • girthyvhf@earthlink.net

    #1

    Help with encrypting connection strings

    Hello all,

    I am trying to use the example for encrypting connection strings
    called:

    How To: Build And Run the Protected Configuration Provider Example.

    This is located in VS 2005 help at:

    ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio .v80.en/dv_aspnetcon/html/7ed8b347-c790-4768-9ae3-53ddc934ac78.ht m

    I am at the point where I am using aspnet_regiis.e xe to do the
    encryption but I keep getting the error:

    Could not load file or assembly
    'TripleDESProte ctedConfigurati onProvider, Version=0.0.0.0 ,
    PublicKeyToken= e0f3f54636e895d d' or one of its dependencies. The system
    cannot find the file specified.
    Failed!

    I have followed the directions in the example and made the proper
    adjustments for my specific environment (like changing the Public Key
    Token in the web.config entry to the one created when I installed the
    dll to the GAC). But for some reason aspnet_regiis.e xe can't seem to
    locate the dll.

    Here is my web.config entry:

    <configProtecte dData>
    <providers>
    <add name="TripleDES Provider"
    type="Protected Configuration.T ripleDESProtect edConfiguration Provider,
    TripleDESProtec tedConfiguratio nProvider, Version=0.0.0.0 ,
    CultureInfo=neu tral, PublicKeyToken= e0f3f54636e895d d,
    processorArchit ecture=MSIL" keyFilePath="c: \AppConfig\Keys .txt"/>
    </providers>
    </configProtected Data>

    You may notice that in the type="" part the namespace is different than
    in the example. I have accounted for this. I also tried it with the
    example namespace first with similar results. I also have tried
    running aspnet_regiis.e xe -i -enable. Didn't help. I have entered the
    assembly location in the registry to get it to show up on the .NET tab
    of the Add References dialog. Didn't help.

    Any suggestions would be welcome.

    Thanks,
    Dave

  • girthyvhf@earthlink.net

    #2
    Re: Help with encrypting connection strings

    Final update: I have everything working correctly out of the GAC. Here
    was my issue:

    Too much copying and pasting and not enough paying attention to the
    details. Thanks to Suzanne Cook and her blog on gotdotnet.com for
    pointing out that you need to have the names of things referenced in
    the GAC exact. At it turns out, the line in my web.config file:

    <add name="TripleDES Provider"
    type="Samples.A spNet.Protected Configuration.T ripleDESProtect edConfiguration Provider,
    TripleDESProtec tedConfiguratio nProvider, Version=0.0.0.0 ,
    CultureInfo=neu tral, PublicKeyToken= 703e257c00b2e90 a,
    processorArchit ecture=MSIL" keyFilePath="c: \AppConfig\Keys .txt"/>

    actually needed to be:

    <add name="TripleDES Provider"
    type="Samples.A spNet.Protected Configuration.T ripleDESProtect edConfiguration Provider,
    TripleDESProtec tedConfiguratio nProvider, Version=0.0.0.0 ,
    Culture=neutral , PublicKeyToken= 703e257c00b2e90 a,
    processorArchit ecture=MSIL" keyFilePath="c: \AppConfig\Keys .txt"/>

    The difference being the Culture=neutral part. Apparently when I
    copied and pasted from Microsoft's example, it came with
    CultureInfo=neu tral, which was wrong in my case. Go figure. Anyway,
    Suzanne Cook pointed out that by doing gacutil /l from the dot net
    command prompt you can get a list of everything in the GAC as the GAC
    sees the names. Once I did this and compared it to my web.config entry
    all was well in my world. Now if only I could replace all the hair I
    have pulled out of my head...

    Dave

    girthyvhf@earth link.net wrote:
    Hello all,
    >
    I am trying to use the example for encrypting connection strings
    called:
    >
    How To: Build And Run the Protected Configuration Provider Example.
    >
    This is located in VS 2005 help at:
    >
    ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio .v80.en/dv_aspnetcon/html/7ed8b347-c790-4768-9ae3-53ddc934ac78.ht m
    >
    I am at the point where I am using aspnet_regiis.e xe to do the
    encryption but I keep getting the error:
    >
    Could not load file or assembly
    'TripleDESProte ctedConfigurati onProvider, Version=0.0.0.0 ,
    PublicKeyToken= e0f3f54636e895d d' or one of its dependencies. The system
    cannot find the file specified.
    Failed!
    >
    I have followed the directions in the example and made the proper
    adjustments for my specific environment (like changing the Public Key
    Token in the web.config entry to the one created when I installed the
    dll to the GAC). But for some reason aspnet_regiis.e xe can't seem to
    locate the dll.
    >
    Here is my web.config entry:
    >
    <configProtecte dData>
    <providers>
    <add name="TripleDES Provider"
    type="Protected Configuration.T ripleDESProtect edConfiguration Provider,
    TripleDESProtec tedConfiguratio nProvider, Version=0.0.0.0 ,
    CultureInfo=neu tral, PublicKeyToken= e0f3f54636e895d d,
    processorArchit ecture=MSIL" keyFilePath="c: \AppConfig\Keys .txt"/>
    </providers>
    </configProtected Data>
    >
    You may notice that in the type="" part the namespace is different than
    in the example. I have accounted for this. I also tried it with the
    example namespace first with similar results. I also have tried
    running aspnet_regiis.e xe -i -enable. Didn't help. I have entered the
    assembly location in the registry to get it to show up on the .NET tab
    of the Add References dialog. Didn't help.
    >
    Any suggestions would be welcome.
    >
    Thanks,
    Dave

    Comment

    Working...