0
votes

I am running a Service host in my program as a background thread. When I run it in my Visual studio it works perfectly opening a file processing it and returning the results. When I install it on a machine as a compiled exe it fails on reading the input file with the following error.

[RCR.VDS.exe] - [Info] - [2/11/2011 8:06:56 AM] - VSM DB Server loaded. [RCR.VDS.exe] - [Error] - [2/11/2011 8:07:05 AM] - There Was an error importing your file [RCR.VDS.exe] - [Error] - [2/11/2011 8:07:05 AM] - System.ArgumentNullException: Path cannot be null. Parameter name: path at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at RCR.Simulation.Serializer.DeSerializeVehDef(String filename)

I have tried setting the permissions of the file to Everyone= full access and running the program as an administrator and nothing has fixed the problem. Does anyone have any idea as to what the problem could be? All machines involved are Win 7 64bit. thanks for the help.

1

1 Answers

0
votes

Looks like in this case the path to the file is null. Init is called by the constructor of the FileStream class (among other things). The "path" parameter should have a valid string containing the location of the file. Use the debugger, logging, or WCF tracing to help you figure out why the path is ending up null.