Error installing Winforms 2.0 application with ClickOnce deployment


  • Hi.

    I have an Winforms 2.0 application that I want to deploy using ClickOnce deployment. I have tried it and the deployment seems to work. I get the webpage where I can install the application from, but when I try installing the application I get an Windows error dialog and a '.NET Runtime 2.0 Error Reporting' entry in my Windows eventlog.
    Detailed error message:
    EventType clr20r3, P1 app.exe, P2 1.0.2211.28810, P3 43d0fb04, P4 mscorlib, P5, P6 4333ab80, P7 32f8, P8 d8, P9, P10 NIL.

    I publish the project to a server within the network I'm on, and the error occurs when I try to install from the generated ClickOnce website from my laptop.

    Does anyone know what could cause this error? I wish it would say which file is missing!

    UPDATE: I found that the application seems to have been installed on my laptop, but when I try to run it, I get the error described above.


    Monday, January 23, 2006 10:33 AM

All replies

  • If you do a search on google about this problem, you get alot of messages just like yours all unanswered. It seems even microsoft don't know what causes it.

    Mine, is a windows service that wont start:

    EventType clr20r3, P1 myservice.exe, P2, P3 43d8c1c7, P4 myservice, P5, P6 43d8c1c7, P7 1a, P8 19, P9, P10 NIL.

    Its possible it only happens on Windows 2003 32bit, anything else and my service runs fine. According to another post, the file that is not found is mscorlib.dll (seems to find that file fine on some servers, but not others)

    The only solutions I've found so far is, install it on a different server, or a windows XP PC....or downgrade to Dot Net 1.1

    So come on Microsoft Gurus, whats this error all about?




    Thursday, March 23, 2006 1:40 PM
  • Hi all,

    I have been getting this same error whilst trying to install the same application on two identical virtual machines (made from a disk image using sysprep), one installs and runs fine the other doesnt. I am installing from a CD built using the VS.NET 2005 publish utility

    This installs the application fine, but the default action after install is to launch the app which is where it is crashing.

    Ok, I have some ideas that it is to do with the updates in the .NET configuration as to how it deals with unhandled exceptions as the framework was installed at the same time as my app. I am planning on doing some experiementation checking the .NET config settings and reinstalling .NET framework etc and will keep you guys posted.

    Scott: Look in your code for where it uses IO and make sure any place it tries to load a file is in a try{} catch{} block and let me know result


    Chris Allen
    Technical Director
    UK National Networks LTD

    UPDATE: 00:10 1/4/06 - I have just reinstalled the .NET 2.0 redistributable framework and my application. Still same error.

    Friday, March 31, 2006 10:51 PM
  • Hi all,

    I have found the solution to this issue, it is due to dependancies. (I've just found out one of my employee's installed a second program onto the first virtual machine) This is why it gives a filenotfound exception as it is trying to load this program.

    When you use third party dll's that are not installed on windows by default the built in publishing tool inside VS.NET will not include these in the distributable it builds for you. I do not understand why i doesnt do this but i am switching all my distribution to Install Shield from now on.

    To fix your applications what you need to do is to look at your references (in solution explorer and in insertable objects) and make sure that you copy these dll's and dependancys onto the machine you want to install to and do a regsvr32 -i <dll>

    I hope this helps you guys,

    Kind Regards,
    Chris Allen
    Technical Director
    UK National Networks LTD

    Friday, March 31, 2006 11:28 PM

    Thanks for that Chris, I'll check out dependancies on my windows service to see if thats the problem with mine.

    As for the try:catch for any, yes in the OnStart event of the service, it loads a file, but I already have a try:catch on there, It appears to be happening before the Service's OnStart Event.

    I can literally, copy the service (and extra file it loads) onto another server, install the service and start it, no problems.

    Tried 5 servers in total so far, it fails to start on 2 of them. Can't see any pattern so far.




    Saturday, April 01, 2006 12:14 PM
  • Hi Scott,

    I have used the same method today to fix another machine with a different program where I had the same project.

    I realised after I had posted that the error was getting triggered before the progam started.

    As for a pattern look at the following questions. Are the servers you are trying to run project on clean installs? Have they been added to your infrastructure at different times? Are they all completely up to date? Have you used certain servers to provide certain services in the past/currently?

    Let me know if it works otherwise there is a deeper meaning to this error message that needs to be worked out.

    Kind Regards,
    Chris Allen
    Technical Director
    UK National Networks LTD

    Saturday, April 01, 2006 9:13 PM
  • Sorted!

    I had 3 x DLLs (my own Dot Net Assemblies) and 4 x Dot Net DLLs:

    My DLLs were already there, so I copied the Dot Net DLLs manually to the EXE's folder, installed the service, and started it, no errors! 

    This makes sense, as one of the posts I found via google suggested the missing file was a Dot Net DLL, even though the file is in the usual folder.

    Dot Net 2 framework was definately installed before hand, as the server is also running a Windows Forms Dot Net 2 application fine, and as it compliments the windows service, it does alot of what the service does, Eg. Uses the same Dot Net DLLs

    So, although its not exactly the same as your doesn't use 3rd party COM DLLs....Its very similar. Basically, we can't trust ClickOnce or the regular built-in installer to copy the files needed. Reminds me of the old VB 6 Package and deployment wizard :-)




    Monday, April 03, 2006 10:38 AM
  • Same error, different case. My WIN2000 Server did not have IIS installed

    so I just did a check in my code before any WebServices or other

    Information Services call!


    /*check if IIS installed, works only for MS IIS*/

    public static bool isIISInstalled()




    ServiceController s = new ServiceController("W3SVC");

    if (s.ServiceName == "W3SVC")


    logToFile(String.Format("Internet Information Services (IIS) passed, Logical Services will be performed on this server.."));

    return true;




    logToFile(String.Format("Warning: Internet Information Services (IIS) not installed, Logical services will not be performed on this server!"));

    return false;



    catch (Exception e)


    logToFile(String.Format("Warning: Internet Information Services (IIS) not installed, Logical services will not be performed on this server! | exception: {0}", e.Message));

    return false;



    hope this helps!


    Regards, Peter


    Thursday, June 15, 2006 10:22 AM
  • In my case, I've forgot to install the dlls into gac. the same error prompt when I run my application. Then I need to create Bootstraper package to install my dlls into gac.
    Tuesday, September 12, 2006 8:07 AM
  • Hi All,

    I am also facing the same problem but in different case.

    On my clients machine WIN2003 it is giving the error but on my machine which is also WIN2003 with SP1 I do not get the error.

    Mine is WindowsService in .NET 2.0. All my dll's & interop dlls are kept in service location.

    My service loads 3 dlls based on the config in DB. Only one dll is rasing the exception. The dll which is raising the exception referes to webservices.

    I have tested the service to replicate the error on another machine WIN2003 which is not having IIS installed still on this machine I am not able to reproduce the issue.

    But my client are facing the same issue.

    Any gusses what could be the reason & what am I need to ask client to check for the components?


    Thanks in Advance



    Friday, May 18, 2007 7:32 AM
  • Hi Manish,


    Going from experience, I would say that the dll causing the problem is dependant on another dll, if these are dll's you have written check their dependancies.


    Also, things like using crystal reports but not having the crystal reports distributable installed will cause the same error.




    Friday, May 18, 2007 10:25 AM
  • After a fair bit of investigation with a similar problem, I have come to the conclusion that this error is caused by a number of things. The general issue is that the service itself fails to start either due to a dependency failure or an exception being thrown during instantiation.

    To resolve this problem, try doing the following.

    Wrap the static main code that calls ServiceBase.Run(new MyService()) in an exception handler that writes to the application event log. This will catch any exceptions that occur when instantiating your service and can then display a reasonable error message rather than the mess that the service is displaying.

    Wrap the service code itself in better exception handling, especially constructors and initilisation code. Use the provided EventLog to write event entries ie this.EventLog.WriteEntry("Starting service"); to eliminate any issues relating to event source creation.

    The issue I experienced was an attempt to create an event source with a log name that is already registered as a source on another log. I have not seen any forum discussions relating to this, so i expect that this is something that others have not often come across.

    The following code gives an example of what was going wrong for me...

    if (!EventLog.SourceExists("MyApp"))
        EventLog.CreateEventSource("MyApp", "Application");
    if (!EventLog.SourceExists("MyApp2"))
        EventLog.CreateEventSource("MyApp2", "MyApp");

    This will throw an System.ArgumentException with a message of "Log MyApp has already been registered as a source on the local computer."

    Another component of our system had previously registered "MyApp" for example under "Application" and then the service was trying to register its own name under "MyApp".

    The real answer to fix this is "consistency". If you have a significant amount of code that needs to do logging, create a base Logging class that handles all creation and checking of sources for you. A static method on this class to do WriteEntry can then be used anywhere within your code without the need to first check or create sources.

    Wednesday, July 25, 2007 1:20 AM
  • I had a similar error simply because VS2008 had some references to .NET 3.5/3.0 DLL's and they weren't installed.




    Monday, March 17, 2008 8:13 PM
  • I get this error on a windows service written in .net 3.5, I am not referencing any dll that is not in the framework so dont understand what is missing.


    Although the error in the event log say .net 2.0??


    Does anyone have any pointers of where to start?


    Tuesday, April 29, 2008 8:50 AM

    You can't install a Windows Service with ClickOnce deployment. It is for WinForm and WPF applications. Is that what you are trying to do?




    Tuesday, April 29, 2008 4:14 PM

    Hi everyone,

    I am running my application 24*7. It works fine in day time but at night it get crashed. I am running it through scheduler.

    It is giving following error in application event...


    EventType clr20r3, P1 deduplix.exe, P2 1.0.3014.28632, P3 47f35fed, P4, P5, P6 471ebf68, P7 16c6, P8 159, P9 system.componentmodel.win32, P10 NIL.


    please help me and tell what can i do?


    Server OS is Windows server 2003 standard edition.

    I am using one COM dll and one OCX.

    Monday, May 12, 2008 10:08 AM
  • Let me say this again. ClickOnce is for deploying windows desktop applications. It is not supported or recommended for installing Windows Services.


    ClickOnce is a low-level no-permission installation that only works for the user who installed it. It connects to the server when you start it up to look for new versions, which is probably why a scheduler can't start it up. If there is a new version, it requires user interaction.


    Since the ClickOnce folks don't support this, you are playing with fire. Any updates to Visual Studio could completely blitz what you are doing with it. I strongly recommend that you change your deployment methodology and use a setup & deployment package (also free with VS (not express I think)) instead.



    Tuesday, May 13, 2008 4:48 PM
  • RobinDotNet - I am not using ClickOnce Deployment and I have the same problem and I have the same error.


    I have copied all .net dll's into the folder where the exe lives...didn't help.


    I have everything in a try / catch...doesn't seem to matter, same error.


    It works perfectly on my Windows XP dev box but when I installed it on my Win2K3 server (using installutil.exe appName.exe) it dumps on me anytime the service actually tries to do anything.


    The service will start for me but once any work is attempted it dumps with:


    Event Type:      Error

    Event Source:   .NET Runtime 2.0 Error Reporting

    Event Category:  None

    Event ID:          5000

    Date:                6/25/2008

    Time:                2:47:04 PM

    User:                N/A

    Computer:        AISWEBDEV


    EventType clr20r3, P1 umon.exe, P2, P3 486275a7, P4 microsoft.visualbasic, P5, P6 471ee7ea, P7 3e8, P8 221, P9 pszqoadhx1u5zahbhohghldgiy4qixhx, P10 NIL.


    For more information, see Help and Support Center at


    0000: 63 00 6c 00 72 00 32 00   c.l.r.2.

    0008: 30 00 72 00 33 00 2c 00   0.r.3.,.

    0010: 20 00 75 00 6d 00 6f 00    .u.m.o.

    0018: 6e 00 2e 00 65 00 78 00   n...e.x.

    0020: 65 00 2c 00 20 00 31 00   e.,. .1.

    0028: 2e 00 30 00 2e 00 30 00   ..0...0.

    0030: 2e 00 30 00 2c 00 20 00   ..0.,. .

    0038: 34 00 38 00 36 00 32 00

    0040: 37 00 35 00 61 00 37 00   7.5.a.7.

    0048: 2c 00 20 00 6d 00 69 00   ,. .m.i.

    0050: 63 00 72 00 6f 00 73 00   c.r.o.s.

    0058: 6f 00 66 00 74 00 2e 00   o.f.t...

    0060: 76 00 69 00 73 00 75 00   v.i.s.u.

    0068: 61 00 6c 00 62 00 61 00   a.l.b.a.

    0070: 73 00 69 00 63 00 2c 00   s.i.c.,.

    0078: 20 00 38 00 2e 00 30 00    .8...0.

    0080: 2e 00 30 00 2e 00 30 00   ..0...0.

    0088: 2c 00 20 00 34 00 37 00   ,. .4.7.

    0090: 31 00 65 00 65 00 37 00   1.e.e.7.

    0098: 65 00 61 00 2c 00 20 00   e.a.,. .

    00a0: 33 00 65 00 38 00 2c 00   3.e.8.,.

    00a8: 20 00 32 00 32 00 31 00    .2.2.1.

    00b0: 2c 00 20 00 70 00 73 00   ,. .p.s.

    00b8: 7a 00 71 00 6f 00 61 00   z.q.o.a.

    00c0: 64 00 68 00 78 00 31 00   d.h.x.1.

    00c8: 75 00 35 00 7a 00 61 00   u.5.z.a.

    00d0: 68 00 62 00 68 00 6f 00   h.b.h.o.

    00d8: 68 00 67 00 68 00 6c 00   h.g.h.l.

    00e0: 64 00 67 00 69 00 79 00   d.g.i.y.

    00e8: 34 00 71 00 69 00 78 00   4.q.i.x.

    00f0: 68 00 78 00 20 00 4e 00   h.x. .N.

    00f8: 49 00 4c 00 0d 00 0a 00   I.L.....


    Thursday, June 26, 2008 2:43 PM
  • Why would you copy all the .net dll's into some other folder? .Net applications pick them up from the GAC.


    What version of .Net is installed and running on your server? Do you have all of the patches and SPs installed?


    Is the above the error thrown by the service, or is it from windows error logging? Are you doing any logging inside your service?




    Monday, June 30, 2008 4:27 AM
  • We got this error message for a regular application running on Windows 2003.


    The problem in our case, was that the application was accidentally configured and compiled against .NET 3.5 (default VS.NET '08), whereas the server had framework version 2.0 installed.


    With a recompilation targeting the 2.0 version of the framework - as intended - the application now runs smoothly.


    Hope this helps others!

    Thursday, July 24, 2008 4:28 AM
  • Same issue was fixed when including adodb.dll in the file system when creating the application msi. 
    Wednesday, August 05, 2009 6:05 PM
  • I need to second this thread since I'm having issues installing a ClickOnce application. I can guess it might be missing reference but is that what it is. Why can't it say which reference or anything else.

    I get this following message

    EventType clr20r3, P1 <appname>.exe, P2, P3 4992ed82, P4 <clientname>, P5, P6 4992ed82, P7 8d, P8 4e, P9 system.nullreferenceexception, P10 NIL.

    Any help would be appreciated.

    Thursday, August 20, 2009 8:20 PM
  • Go find the folder where your exe is, and try double-clicking on it to run it. If that fails as well, then it's not a ClickOnce problem. It might show you the missing reference, but is more likely to if you are catching unhandled exceptions and logging the errors in your code.

    Click here to visit my ClickOnce blog!
    Friday, August 21, 2009 1:10 AM
  • This is an old question but yet I think providing an answer is good as someone in the same situation like me will get help….

    The exception comes when the application could not find all the DLLs while .Net runtime try to load the application.
    Now the issue is to find which are the dlls are missing. The Approach I have adopted is to provide a try catch block in the Program.cs and catch the exception and display as a message. And the code looks as follows.

     static class Program
            /// <summary>
            /// The main entry point for the application.
            /// </summary>
            static void Main()
                    Application.Run(new Form1());
                catch (System.IO.FileNotFoundException ex)
                    MessageBox.Show(ex.Message + "    \n\n\n" + ex.StackTrace);

    Only time I can think it fail is when the Program.cs is having reference to some assembly which is not present. This can easily find by looking to the using statement.

    Thanks & Regrads
    Thursday, November 19, 2009 9:09 AM
  • Actually, it's not a recommended practice to put a try/catch block around your entire application. What is better is to add an event handler for the unhandled exceptions. Here's how to do that in C#. ILog is a Log4Net object; we use log4net for logging in our application, as in this case it logs the exception caught.
    //The code to add in your startup: 
    AppDomain adCurrent = AppDomain.CurrentDomain;
    adCurrent.UnhandledException += new UnhandledExceptionEventHandler(adCurrent_UnhandledException);
    System.Windows.Forms.Application.ThreadException += 
      new ThreadExceptionEventHandler(Application_ThreadException);
    /// <summary>
    /// Handle a thread exception. 
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
        //If you use Application.Exit instead of Environment.Exit, it leaves the app in the process list.
        ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
        log.Debug("Unhandled thread exception thrown.", e.Exception);
    /// <summary>
    /// Handled the unhandledexception on the current application. 
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    static void adCurrent_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
        log.Debug("Unhandled exception thrown.", (Exception)e.ExceptionObject);

    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Thursday, November 26, 2009 8:45 PM
  • Hi,

    Make sure that you have all the *.dll files in the bin directory of the project. If the files are not in the directory then it will throw the error. So copy all the dependencies (all the referenced class libraries, dlls, references, etc.,). 

    Hope it helps...

    Pankaj Bajpai. Prosares Solutions ASP.Net | Sharepoint | Consulting SharePoint | ASP.Net | Business Intelligence
    Tuesday, December 08, 2009 2:15 PM
  • You should not be manually copying dependencies. If you have the properties set correctly on the prerequisites and other included assemblies, they will automatically be included in the deployment. The fastest way to test this is probably to go to the \bin\debug folder and double-click on the exe. This still doesn't mean it will work on the user's machine, so tracking down the exe on the user's machine and double-clicking on it does tell  you for sure if you have an application problem (because of a missing dll, or whatever) or a ClickOnce installation problem.

    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Friday, December 11, 2009 8:23 AM
  • I got this error today. Very simple solution for me...

    My EventLog was full! Right click, choose Overwrite events as needed. Done!
    Tuesday, January 26, 2010 12:19 PM