none
Embeded .net dll RRS feed

  • Question

  • Hi!

    I am developing an application to be run on a local intranet.

    I have created a .net dll using vs2008 (vb.net).

    I can embet it into a simple html page using an object tag.

    It wors perfectly. The dll loads and the user control displays perfectly.

    All functionality works ........ Until!!!!


    I click  on a button that interogates a clientside folder.
    I get a .net permissions error.

    It says:
    System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    Along with advice to use the .net framework configuration tool.

    Since this is vs2008, i believe i am using 3.5  I cannot find a configuration tool with 3.5.
    But even if i did, i wouldnt know what to do. I do have a configurator in the 2.0 folde.
    Its all jumble to me.
    I have read much information on the microsoft site. But its not sinking in.
    I just want to learn how to allow this assembly (dll) and all of its successors to be able to have full access to my own drives.

    It would be nice to be able to set permissions in such a way as to allow file access regardless of whether or not it is local machine IIS, intranet IIS or WWW WAN host.  

    Ths and future controls are windows application controls. Embedded into an HTML page. 
    It works as an asp page as well. It works as a local web site page. It works as a page on the web.

    Thank you up front!
    Jerry C  
    Friday, June 20, 2008 1:37 AM

Answers

  •  I figured it out!

    I went into the .net configuration tool located in the administative tools.
    I expanded the "Runtime Security Policy" node and then the "machine" node.
    Then the "Code Groups" and then "All Code"
    I then created a new group. Called "LocalHost". I chose the URL option and specified "HTTP://localhost/*
    I gave that item "Full_Control"
    I also did the same process for one of my web sites.

    Thats it! I now can run my web page with embeded .net windows controls in html pages hosted on my web site. The control has access to my local drive as well as my local sql server and any network drives. This opens up the door for developing some tools that asp.net user controls just cannot do.

    I hope that my efforts can help someone else out that may be exploring similar avenues.

    Thanks
    Jerry C
    • Marked as answer by JerryCic Friday, June 20, 2008 3:46 AM
    Friday, June 20, 2008 3:45 AM