Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > FileNotFoundException
 

FileNotFoundException

Hello-

I am getting a filenotfoundexception message after installing a C#app on XP machines. The developer computer is a Vista machine. The thing is previous test installations ran just fine on the XP computerswhen the software was started.

My suspicions include:
1. Numerous installs and uninstalls of the software on both test computers
2. I manually incremented the version number of the startup project in VS2005 and changed the GUID

Dependency Walker reveals that IESHIMS.DLL has the following unresolved external functions:
IEShims_InDllMainContext
IEShims_SetRedirectRegistryForThread
IEShims_Initialize
IEShims_Uninitialize
IEShims_GetOriginatingThreadId

Any feedback would be most appreciated.

Ruel
RueSam  Thursday, August 06, 2009 10:10 PM
It looks pretty clear to me, you didn't copy search.ico to the right folder. Where is it?

Hans Passant.
nobugz  Thursday, August 13, 2009 12:57 AM
Use Fuslogvw.exe to troubleshoot assembly binding problems. Don't use Depends, it knows beans about .NET assemblies.

Hans Passant.
nobugz  Friday, August 07, 2009 12:49 AM
I tried depends only after not getting anywhere with fuslogvw. Perhaps I don't know how to read the log web page.

Take the following for instance which I have chosen as representative since it shows up on the Error Signature dialog as P4 (I confess I don't know what "P4" means) when the application fails to load: system.drawing

*** Assembly Binder Log Entry (8/7/2009 @ 2:19:09 PM) *** FROM TEST MACHINE

The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.

Assembly manager loaded from: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable C:\Program Files\C & R Management Services, Inc\Pick-A-Mortgage\PickAMortgage.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = RUEL\Rue
LOG: DisplayName = System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/Program Files/C & R Management Services, Inc/Pick-A-Mortgage/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = PickAMortgage.exe
Calling assembly : System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Binding succeeds. Returns assembly from C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll.
LOG: Assembly is loaded in default load context.


The other observation is that the following log entry appears on the developer machine but not on the test computer although both application directories have the identical files:

*** Assembly Binder Log Entry (8/7/2009 @ 2:46:13 PM) *** FROM THE DEVELOPER MACHINE

The operation was successful.

Bind result: hr = 0x0. The operation completed successfully.

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll

Running under executable C:\Program Files\C & R Management Services, Inc\Pick-A-Mortgage\PickAMortgage.exe

--- A detailed error log follows.

=== Pre-bind state information ===

LOG: User = Ruel-T61\Ruel

LOG: DisplayName = WinFileManagement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

(Fully-specified)

LOG: Appbase = file:///C:/Program Files/C & R Management Services, Inc/Pick-A-Mortgage/

LOG: Initial PrivatePath = NULL

LOG: Dynamic Base = NULL

LOG: Cache Base = NULL

LOG: AppName = PickAMortgage.exe

Calling assembly : PickAMortgage, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null.

===

LOG: This bind starts in default load context.

LOG: No application configuration file found.

LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.

LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).

LOG: Attempting download of new URL file:///C:/Program Files/C & R Management Services, Inc/Pick-A-Mortgage/WinFileManagement.DLL.

LOG: Assembly download was successful. Attempting setup of file: C:\Program Files\C & R Management Services, Inc\Pick-A-Mortgage\WinFileManagement.dll

LOG: Entering run-from-source setup phase.

LOG: Assembly Name is: WinFileManagement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

LOG: Binding succeeds. Returns assembly from C:\Program Files\C & R Management Services, Inc\Pick-A-Mortgage\WinFileManagement.dll.

LOG: Assembly is loaded in default load context.

RueSam  Friday, August 07, 2009 7:03 PM

Hi,
Thank nobugz you are always have new information for me, here is the link of Fuslogvw

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

Thanks



We are volunteers, if the reply help you mark it as your answer. thanks!!
My Blog
M.Radwan  Saturday, August 08, 2009 12:10 PM
Your fuslogvw.exe logs don't show an error. Can you get a call stack for the exception? SysInternals' ProcMon.exe could help you diagnose problems when your program has a dependency on unmanaged code, like a COM component. That should also be visible in Depends.exe when you use its Profile option.
Hans Passant.
nobugz  Saturday, August 08, 2009 2:17 PM
Hello Hans-

Here is a PATH NOT FOUND eventusing ProcMon.exe:

Date & Time:8/12/2009 11:30:04 AM
Event Class:File System
Operation:QueryOpen
Result:PATH NOT FOUND
Path:C:\Users\Ruel\Documents\Visual Studio 2005\Projects\PickAMortgage\bin\Debug\search.ico
TID:4016
Duration:0.0000196

And this the stack:

0fltmgr.sysfltmgr.sys + 0x18880xf7553888C:\WINDOWS\System32\Drivers\fltmgr.sys
1fltmgr.sysfltmgr.sys + 0x31a70xf75551a7C:\WINDOWS\System32\Drivers\fltmgr.sys
2fltmgr.sysfltmgr.sys + 0xfc7a0xf7561c7aC:\WINDOWS\System32\Drivers\fltmgr.sys
3ntoskrnl.exentoskrnl.exe + 0x9d3fd0x805743fdC:\WINDOWS\system32\ntoskrnl.exe
4ntoskrnl.exentoskrnl.exe + 0x8cfec0x80563fecC:\WINDOWS\system32\ntoskrnl.exe
5ntoskrnl.exentoskrnl.exe + 0x914da0x805684daC:\WINDOWS\system32\ntoskrnl.exe
6ntoskrnl.exentoskrnl.exe + 0xa59130x8057c913C:\WINDOWS\system32\ntoskrnl.exe
7ntoskrnl.exentoskrnl.exe + 0x77ec0x804de7ecC:\WINDOWS\system32\ntoskrnl.exe
8<unknown>0x38703f40x38703f4
9mscorlib.ni.dllmscorlib.ni.dll + 0x2204460x792e0446C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\6d667f19d687361886990f3ca0f49816\mscorlib.ni.dll
10mscorlib.ni.dllmscorlib.ni.dll + 0x1bffa10x7927ffa1C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\6d667f19d687361886990f3ca0f49816\mscorlib.ni.dll
11mscorlib.ni.dllmscorlib.ni.dll + 0x2296f60x792e96f6C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\6d667f19d687361886990f3ca0f49816\mscorlib.ni.dll
12System.Drawing.ni.dllSystem.Drawing.ni.dll + 0xfa43f0x7aeda43fC:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Drawing\3da96ee075bab9202626ae44c18d226c\System.Drawing.ni.dll
13System.Drawing.ni.dllSystem.Drawing.ni.dll + 0xfa4070x7aeda407C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Drawing\3da96ee075bab9202626ae44c18d226c\System.Drawing.ni.dll
14SetAppCode.exeSetAppCode.exe + 0x7230x1190723C:\Program Files\C & R Management Services, Inc\Pick-A-Mortgage\SetAppCode.exe
15SetAppCode.exeSetAppCode.exe + 0xc10x11900c1C:\Program Files\C & R Management Services, Inc\Pick-A-Mortgage\SetAppCode.exe
16mscorwks.dllmscorwks.dll + 0x1b4c0x79e71b4cC:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
17mscorwks.dllmscorwks.dll + 0x121f90x79e821f9C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
18mscorwks.dllmscorwks.dll + 0x265710x79e96571C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
19mscorwks.dllmscorwks.dll + 0x265a40x79e965a4C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
20mscorwks.dllmscorwks.dll + 0x265c20x79e965c2C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
21mscorwks.dllmscorwks.dll + 0x7fac50x79eefac5C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
22mscorwks.dllmscorwks.dll + 0x7f9e50x79eef9e5C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
23mscorwks.dllmscorwks.dll + 0x7ff350x79eeff35C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
24mscorwks.dllmscorwks.dll + 0x8011f0x79ef011fC:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
25mscorwks.dllmscorwks.dll + 0x8004f0x79ef004fC:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
26mscoree.dllmscoree.dll + 0x7c240x79007c24C:\WINDOWS\system32\mscoree.dll
27kernel32.dllkernel32.dll + 0x170770x7c817077C:\WINDOWS\system32\kernel32.dll

This is the c#code related to search.ico:

private Button btIcon = new Button();

//Search icon (magnifying glass) to associate with btIcon
private Image img = Image.FromFile("search.ico");

The error signature dialog includes the following:
P4: system.drawing and an exception information code of 0xe0434f4d

Since their is no such path as C:\Users\Ruel\Documents\Visual Studio 2005\Projects\PickAMortgage\bin\Debug\search.ico
on the test computer could this be the problem?

Thanks for any help.

Ruel

RueSam  Wednesday, August 12, 2009 3:54 PM
Thanks for the link, but I have already tried fuslogvw, although it could be that Iam not utilizing it properly. I may be getting somewhere with ProcMon.exe even though the ProcMon help module does not work. Please see my August 12 reply to nobugz.
Ruel
RueSam  Thursday, August 13, 2009 12:27 AM
It looks pretty clear to me, you didn't copy search.ico to the right folder. Where is it?

Hans Passant.
nobugz  Thursday, August 13, 2009 12:57 AM
The installation placed the file in the application directory on the test machine.

I don't know why the build and subsequent deployment via a cabinet file to the test computer copied the file using the actual bin\debug path from the developer machine: C:\Users\Ruel\Documents\Visual Studio 2005\Projects\PickAMortgage\bin\Debug according to ProcMon.exe.

I have since noticed that when I try to debug with a breakpoint where the code calls search.ico, the application just starts up without pausing at the breakpoint. Looking at the configuration dialog for the solution I see that all projects are in a debug mode but the only projects that have a check mark in the Build column are the cabinet, dotfuscator and merge module. All other projects including the start project and the installation setup project are unchecked in the Build column.

Some of the projectsneed no further rebuilding I suppose since they seem to be reliable and need no further development. I placed check marks in the Buildcolumn of the solution configuration dialog forthe startup project and those that are relatively new, but the same thing happened which is that pressing F5 only ignores the breakpoint and runs the app.

Looking at the output messages when I press F5, it appears as if the only thing being compiled is the dotfuscated project.

If I changed a setting inadvertently I am not sure what.

Ruel

CORRECTION AFTER POSTING THE ABOVE:
Please ignore the breakpoint comment; the code for a project needed to be updated.
  • Edited byRueSam Friday, August 14, 2009 2:30 AM
  •  
RueSam  Thursday, August 13, 2009 2:21 PM
Hans,

It appears that one or more of my projects were not up to date and were not compiling wheneverIrebuilt the solution or the installation projects.

The build output showed several projects were ignored when compiling the solution, which I don't understand since the Build and Run option for projects is set to Always Build when projects are out of date. Does this mean that all projects thatI have edited, should bebuilt or rebuiltindividually to be sure that they are all up to date?

The program now installs and runs on the target XP machine. On a very old XP computerI have noticed however, that the installation triggers aregisty-relatederror message because the installation process duplicates the registry path. Instead of looking in the registryjust for:
HK_CURRENT_USER\Software\C & R Management where the key value name and data are to be found, it is looking in:
HK_CURRENT_USER\Software\C & R Management\HK_CURRENT_USER\Software\C & R Management on this target computer.

Thank you for your assistance.

Ruel
  • Edited byRueSam Sunday, August 16, 2009 4:15 PM
  •  
RueSam  Friday, August 14, 2009 2:13 PM
Hi - nobugz MVP:

I have a question?

Why did you remove one of my posts?

This one: http://social.microsoft.com/Forums/en-US/Offtopic/thread/8e3d3656-c6f9-416b-a643-4846b721cf95/

Have a nice day...

Best regards,
Fisnik
Coder24.com
Coder24.com  Friday, August 14, 2009 2:18 PM
Hello Fisnik,

I don't know if this is relevant, but if you recently cleared your browser history that may account for the missing post. It is there but you have to go to My Forum Links and click on your name then look for it there.

Hope this helps.

Ruel
RueSam  Tuesday, August 18, 2009 2:00 PM

You can use google to search for other answers

Custom Search

More Threads

• Windows Control in IE, Problem Accessing Database, Strong Name doesn't seem to work
• shortcuts are created in all users desktop instead of the one users desktop.
• Where should I post a question about VS setup and deployment projects?
• How to execute MFC exe application using VS2005 Setup Project
• Building and deploying
• obfuscate windows form project and referenced projects before they are packaged into setup project
• ClickOnce deployment with custom install directory?
• No-Touch/Smart Client Offline Capability
• Install failure
• clickonce 2008 shortcut icon on desktop