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 2.0.0.0, P6 4333ab80, P7 32f8, P8 d8, P9 system.io.filenotfoundexception, 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.
Thanks!

***FIX*** Error installing Winforms 2.0 application with ClickOnce deployment
lingling
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 1.0.0.4, P3 43d8c1c7, P4 myservice, P5 1.0.0.4, P6 43d8c1c7, P7 1a, P8 19, P9 system.io.filenotfoundexception, 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
TIA,
Scott
Kyrios
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 problem....it 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 :-)
Thanks!
Scott
MissBook
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 File.io, 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.
Thanks,
Scott
itzkid
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
SergeiU
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
Abdul Hafeez
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.
Rgds,
Chris
Segua
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
Rgds,
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.
Madhusudanan
Lorenzom_MS
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
Manish
Dale Washlake
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.
July Ardor
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(){
try{
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;}
else{
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