CodeSmith Community
Your Code. Your Way. Faster!

Deployment Issue with EnterpriseLibrary assembly

Latest post 05-14-2008 3:51 PM by dsiddell. 12 replies.
  • 05-13-2008 12:16 PM

    • dsiddell
    • Top 500 Contributor
    • Joined on 04-30-2008
    • Posts 9
    • Points 280

    Deployment Issue with EnterpriseLibrary assembly

    Hi,

     I am a newbie to netTiers and am deploying a website for the first time using it.

     Everything works fine in my local environment but when I publish to my hosting site I am getting the following error:

    "Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests."

    I did find an old asp.net forum entry about it but hoping someone here has a better solution.
    http://forums.asp.net/t/1019032.aspx

    The hosting site is unwilling to change any permissions so I may have to overcome the issue on my side.

    Any help is greatly appreciated as I would like to be able to deploy the site.

    Thanks!
    Don

     

    • Post Points: 60
  • 05-13-2008 12:33 PM In reply to

    • SuperJeffe
    • Top 25 Contributor
    • Joined on 05-05-2006
    • Tulsa, Ok
    • Posts 339
    • Points 8,565

    Re: Deployment Issue with EnterpriseLibrary assembly

    This has to do with the Enterprise Library not being strongly named.

    There are tons of post about this in the MSDN forums and the EntLib codeplex comments.  Google how to use Enterprise Library in Medium Trust environments and you will find lots of posts.  The next version of EntLib (4.0 I think) will come pre-signed.  That will be a good thing.

    You can also search around here and you might find some links.  I know I have responded to a similar post before.

    jeff

     

    ----------------------------------------------------------------------
     Member of the .NetTiers team | Visit http://www.nettiers.com
    ----------------------------------------------------------------------

    • Post Points: 5
  • 05-13-2008 12:56 PM In reply to

    • SuperJeffe
    • Top 25 Contributor
    • Joined on 05-05-2006
    • Tulsa, Ok
    • Posts 339
    • Points 8,565

    Re: Deployment Issue with EnterpriseLibrary assembly

    Here is a discussion about it on there forums.

    http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=10710

    I believe there is a post in there on the steps required to sign the Ent Lib code.  It is truly a pain, but unfortunately, they didn't do a good job in handling this in the 3.0 and 3.1 releases.

    jeff

    ----------------------------------------------------------------------
     Member of the .NetTiers team | Visit http://www.nettiers.com
    ----------------------------------------------------------------------

    • Post Points: 60
  • 05-13-2008 1:36 PM In reply to

    • dsiddell
    • Top 500 Contributor
    • Joined on 04-30-2008
    • Posts 9
    • Points 280

    Re: Deployment Issue with EnterpriseLibrary assembly

    Is there a way to make the netTiers assemblies not use medium trust?

    • Post Points: 5
  • 05-13-2008 2:29 PM In reply to

    • dsiddell
    • Top 500 Contributor
    • Joined on 04-30-2008
    • Posts 9
    • Points 280

    Re: Deployment Issue with EnterpriseLibrary assembly

    Is this the only way to resolve this issue? 

    So anyone deploying a nettiers project to a hosting site will have this issue?  Seems like a big deal.

    Thanks

    • Post Points: 35
  • 05-13-2008 3:12 PM In reply to

    • SuperJeffe
    • Top 25 Contributor
    • Joined on 05-05-2006
    • Tulsa, Ok
    • Posts 339
    • Points 8,565

    Re: Deployment Issue with EnterpriseLibrary assembly

    Yes, anyone using the Enterprise Library will have issues when using sites like GoDaddy and such.  Nettiers uses the Enterprise Library extensively in it's code. 

    Follow the instructions on that thread I sent.  I think the person said it takes around 20 to 30 minutes to complete.  You should only have to do this 20 to 30 minute step once.  Once you run this and compile the code, you will just override the DLL's in Nettiers References folder.  If you update Nettiers from SVN or a nightly build, you would just have to re-copy those DLL's again.

    If you want to use the Ent Lib version 2, I believe nettiers supports this and there is a patch for the 2.0 version of the EntLib.  You don't have to go through the steps of compiling like you do with 3.0 and 3.1.  You can look on that codeplex site for the Patches for the 2.0 version.

    It's a pain, but the next version of the Enterprise Library should solve this problem.  There is already a community preview of it out so hopefully it won't be too long. 

    jeff

    ----------------------------------------------------------------------
     Member of the .NetTiers team | Visit http://www.nettiers.com
    ----------------------------------------------------------------------

    • Post Points: 35
  • 05-13-2008 8:39 PM In reply to

    • dsiddell
    • Top 500 Contributor
    • Joined on 04-30-2008
    • Posts 9
    • Points 280

    Re: Deployment Issue with EnterpriseLibrary assembly

    Actually I think my project is pointing to version 2.0.

     Here is web.config entry:
    <configSections>

    <section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"/>

    </configSections>

    Here is entlib.config:
    <configSections>

    <
    section name="securityConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Security.Configuration.SecuritySettings, Microsoft.Practices.EnterpriseLibrary.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" />

    <
    section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" />

    <
    section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" />

    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" />

    <section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings, Microsoft.Practices.EnterpriseLibrary.Caching, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" />

    </configSections>

    So do I just need to apply the 2.0 patches?

    Thanks for the assistance!

    • Post Points: 35
  • 05-13-2008 9:11 PM In reply to

    • SuperJeffe
    • Top 25 Contributor
    • Joined on 05-05-2006
    • Tulsa, Ok
    • Posts 339
    • Points 8,565

    Re: Deployment Issue with EnterpriseLibrary assembly

    It does appear that way.  You will need to follow the instuctions to the patch.  You will probably have to install the version of the 2.0 ent library that the patch is for and then run the patch.  Then copy the DLL's into the references folder under the nettiers templates.  Either that, or just deploy those out to the web and then don't override.  One of the options when generating with Nettiers is the EntLib version.  Just make sure it is set to v2.

    It's worth giving it a shot.

    jeff

    ----------------------------------------------------------------------
     Member of the .NetTiers team | Visit http://www.nettiers.com
    ----------------------------------------------------------------------

    • Post Points: 35
  • 05-13-2008 9:41 PM In reply to

    • dsiddell
    • Top 500 Contributor
    • Joined on 04-30-2008
    • Posts 9
    • Points 280

    Re: Deployment Issue with EnterpriseLibrary assembly

    This is probably a stupid question, but can I distribute the dlls for entlib v4 which supports partial trust instead and point nettiers to use that?


    Also you said:
    "One of the options when generating with Nettiers is the EntLib version.  Just make sure it is set to v2."
    Not sure I understood that.  Do I have to regen the project?  I didn't see any entlib props in the template.

    Thanks

    • Post Points: 35
  • 05-13-2008 10:25 PM In reply to

    • SuperJeffe
    • Top 25 Contributor
    • Joined on 05-05-2006
    • Tulsa, Ok
    • Posts 339
    • Points 8,565

    Re: Deployment Issue with EnterpriseLibrary assembly

    I would not recommend using 4 yet.  Nettiers team won't integrate that until it is released.  You would have to manually go and change the references everytime you generate.  And in fact, the CTP may not actually be strongly typed, although they have stated the release will.  I may not know what i am talking about either, you would have to check in there discussion forums.  I do know that the final will be strongly typed, so they say.

    The option I am talking about is here:

    When in Codesmith, and you have opened the Nettiers.cst file.  There is an option under 02. Framework Generation - Optional group in the property grid.  It is called EntLibVersion.  Just make sure that has v2 selected.

     jeff

    ----------------------------------------------------------------------
     Member of the .NetTiers team | Visit http://www.nettiers.com
    ----------------------------------------------------------------------

    • Post Points: 35
  • 05-14-2008 10:43 AM In reply to

    • dsiddell
    • Top 500 Contributor
    • Joined on 04-30-2008
    • Posts 9
    • Points 280

    Re: Deployment Issue with EnterpriseLibrary assembly

    Understood.  And yes v2 was selected, so I will run the patch for that and use those dlls on the host site.

    Thanks alot for your help.

    • Post Points: 35
  • 05-14-2008 2:04 PM In reply to

    • SuperJeffe
    • Top 25 Contributor
    • Joined on 05-05-2006
    • Tulsa, Ok
    • Posts 339
    • Points 8,565

    Re: Deployment Issue with EnterpriseLibrary assembly

    Be sure to post back if you get it working.

    jeff

    ----------------------------------------------------------------------
     Member of the .NetTiers team | Visit http://www.nettiers.com
    ----------------------------------------------------------------------

    • Post Points: 35
  • 05-14-2008 3:51 PM In reply to

    • dsiddell
    • Top 500 Contributor
    • Joined on 04-30-2008
    • Posts 9
    • Points 280

    Re: Deployment Issue with EnterpriseLibrary assembly

    Yes I got it working by distributing the patched entlib v2 files.  Many thanks for your help!!

     

    For the benefit of others, in addition to your link above, here is another very straight forward link detailing the steps for this problem:

    http://community.codesmithtools.com/forums/t/4233.aspx

     

    Thanks Jeff

    • Post Points: 5
Page 1 of 1 (13 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems