locked
Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, RRS feed

  • Question

  • Hi,

      I have wrote a windows application which accesses Sqlexpress database and also text files. The app works fine on my machine but its giving the following error when i run it on other machine.

     

    "Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."

     

    System.InvalidOperationException was unhandled
      Message="An error occurred creating the form. See Exception.InnerException for details.  The error is: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."
      Source="NCCITool"
      StackTrace:
           at NCCITool.My.MyProject.MyForms.Create__Instance__[T](T Instance)
           at NCCITool.My.MyProject.MyForms.get_frmMain()
           at NCCITool.My.MyApplication.OnCreateMainForm()
           at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
           at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
           at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
           at NCCITool.My.MyApplication.Main(String[] Args)

    Need Help!!!

    Wednesday, January 10, 2007 11:59 AM

Answers

All replies

  • See http://blogs.msdn.com/shawnfa/archive/2003/06/20/57023.aspx for an explanation of why this happens, along with some possible resolutions.  Since this is a .NET 2.0 application, another option would be to deploy as a ClickOnce application.  If you're interested in learning about ClickOnce, http://msdn2.microsoft.com/en-us/vbasic/ms789088.aspx might be a good place to start.  For more in-depth information, see http://msdn2.microsoft.com/en-us/library/t71a733d.aspx.
    Wednesday, January 10, 2007 1:32 PM
  • I created a key and signed my assembly but still getting the same error

    adhi

    Wednesday, January 10, 2007 2:40 PM
  • Have you modified the CAS policy on the client machine to grant additional permissions to code running from the intranet and signed with that key?
    Wednesday, January 10, 2007 2:46 PM
  • This is a windows application and i am not running from a network share. I get this message when i copy the exe to another machine and run it.
    Wednesday, January 10, 2007 3:01 PM
  • Has that machine's CAS policy been modified from the default so that local code isn't being granted full trust?  If not, how exactly did you "copy" the application to the target machine?
    Thursday, January 11, 2007 1:35 PM
  • Read It to solved problem

    http://msdn.microsoft.com/en-us/library/ms998341.aspx

    Friday, May 23, 2008 4:07 PM
  • simply run the following command on the machine where the application is supposed to be run:

    "%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\caspol.exe" -machine -addgroup 1 -url \\shared_location\* FullTrust -name AppName

    where

    -shared_location: location of the application which is supposed to be run;

    -AppName: application name

    Friday, March 22, 2013 9:04 AM