none
Microsoft .NET ClickOnce Launch Utility error

    Question

  • I've just started getting a ClickOnce Launch Utility error out of the blue. The error is:

    ///////////////

    An unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib.dll

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

    ///////////////

    and the stack trace is:

    //////////////

         mscorlib.dll!System.Security.CodeAccessPermission.Demand() + 0x3b bytes   
         mscorlib.dll!System.Reflection.Assembly.VerifyCodeBaseDiscovery(string codeBase) + 0x77 bytes   
         mscorlib.dll!System.Reflection.Assembly.GetName(bool copiedName) + 0x47 bytes   
         mscorlib.dll!System.Reflection.Assembly.GetName() + 0xa bytes   
    >    CusQuoteAnalysis.exe!SWNW.CusQuoteAnalysis.CusQuoteAnalysis.Main() Line 37 + 0x10 bytes    C#
         [Native to Managed Transition]   
         [Managed to Native Transition]   
         mscorlib.dll!System.AppDomain.nExecuteAssembly(System.Reflection.Assembly assembly, string[] args) + 0x19 bytes   
         mscorlib.dll!System.Runtime.Hosting.ManifestRunner.Run(bool checkAptModel) + 0x6e bytes   
         mscorlib.dll!System.Runtime.Hosting.ManifestRunner.NewThreadRunner() + 0xc bytes   
         mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) + 0x66 bytes   
         mscorlib.dll!System.Threading.ExecutionContext.runTryCode(object userData) + 0x51 bytes   
         [Native to Managed Transition]   
         [Managed to Native Transition]   
         mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x67 bytes   
         mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x45 bytes   
         mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x44 bytes

    /////////////////////

    The location of the exception is the very first line of the entry point Main() function of the application where it is calling Assembly.GetEntryAssembly().GetName().Name.

    The error indicates that the application is not trusted. However, Enable Click Once Security is checked and Full trust is selected.

    Other Info:

    The application is configured to be available online only.
    The application of course runs fine with no errors from the local machine.
    The application was built and deployed with Visual Studio 2008 SP1 and targets .NET 2.0.
    We have several other ClickOnce applications deployed to the same machines with the exact same configuration that continue to work fine.
    All machines are running Windows XP Pro with SP3.

    Any ideas on what to check/try next in order to debug this?

    Thanks!

    Thursday, July 23, 2009 9:00 PM

Answers

  • The first thing I tried was to build and deploy a new version of the application. Doing this had no effect on the problem. The users continued to get the security exception when the application was installed and run. Commenting out the first line of code just caused the security exception to occur when the second line of code was executed. The application continued to act as if it was untrusted even though it was marked as having full trust.

    I finally went ahead and created a completely new project, copied the .cs files and resources to it, rebuilt the ClickOnce deployment and that, believe it or not, resolved the problem . This leads me to believe it was a project meta-data related.
    Tuesday, August 04, 2009 11:46 PM

All replies

  • Are you deploying the app as a full-trust app? If not, then something is different about the security by zone on that one computer. It's the stuff in IE where you can set the security for different zones.

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Friday, July 24, 2009 6:35 AM
  • The application is marked as full trust and the SecurtyError exception occurs on multiple machines in the domain. Just this one application has stopped working. We have several other ClickOnce deployed applications with identical deployment security settings that continue to install and run correctly on the same machines.

    Its possible the project settings for this application were corrupted up in some way. Is there a way to "reset" the ClickOnce deployment for a specific  project, perhaps by manually deleting some meta data stored in the project?

    Any help is appreciated.

    Thanks again.
    Tuesday, July 28, 2009 8:36 PM
  • I assume you've tried deploying a new version of it? On the machines where it doesn't work, have you tried uninstalling and reinstalling the application?  If you comment out that one line of code, does it work?

    RobinDotNet
    Click here to visit my ClickOnce blog!
    • Marked as answer by gregr_reeves Tuesday, August 04, 2009 11:35 PM
    • Unmarked as answer by gregr_reeves Tuesday, August 04, 2009 11:35 PM
    Wednesday, July 29, 2009 9:18 AM
  • The first thing I tried was to build and deploy a new version of the application. Doing this had no effect on the problem. The users continued to get the security exception when the application was installed and run. Commenting out the first line of code just caused the security exception to occur when the second line of code was executed. The application continued to act as if it was untrusted even though it was marked as having full trust.

    I finally went ahead and created a completely new project, copied the .cs files and resources to it, rebuilt the ClickOnce deployment and that, believe it or not, resolved the problem . This leads me to believe it was a project meta-data related.
    Tuesday, August 04, 2009 11:46 PM
  • That's bizarre. Maybe it did have some problem with the hashes used to sign the manifest or something. Congratulations on fixing it!

    RobinDotNet
    Click here to visit my ClickOnce blog!
    Wednesday, August 05, 2009 5:01 AM