views:

143

answers:

5

Hi, I have created a windows forms application using vs2008. when i copy the bin folder over to another machine and try to run it the applicaiton throws a filenotfoundexception error. Ive looked at the references files used in the project and each file points to either

  • c:\Windows\Microsoft.NET\Framework\v2.0.50727...
  • c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5...
  • c:\Program Files\Common Files\Microsoft Shared\Visual Basic Power Packs\1.1...

i have verified that these directories exist on the other machines that cause the error. the two machines that i have tried it on and that throw there error are

Windows XP WITHOUT VS2008 installed and Windows 7 with VS2008 installed

I tried on two machine that DID work which are

Windows XP with VS2008 and and my development machine Windows 7 with VS2008

Could anyone provide me with some insight on this issue Thanks

A: 

if you have all the global assemblies registered then check in your code if you are reading/opening some file with absolute path which is raising exception.

Say you had a file c:\abc.txt which you were opening. This file might be available on developer machine but not in other test machines. You may want to check the File.Open function calls in your program.

Kavitesh Singh
A: 

which file not found, try to catch the exception and log the exception details which file is not found. Also you say installing VS2008, the app works, then just try installing VS2008 redistributable runtime libraries. It needed for webbrowser and other api.

Priyank Bolia
A: 

maybe use

Dim rootPath As String = Server.MapPath("~")

and a relative path(?)

Tyzak
A: 

Make sure you wrap the entirety of your Main function guts in a try catch(). Then you can show the message to find out what assembly is missing. Once you do that, go to that assembly in the references, and in it's properties set CopyLocal = true.

Ex:

        [STAThread]
    static void Main()
    {
        try
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MyForm());
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
        }
    }
Russell Steen
A: 

use process monitor from sysinternals - this will let you see what files your app is trying to open

pm100