If I right-click my app from a network drive and select Run As | Current User, whether the app runs depends on whether I click the sub-checkbox (“Protect my computer and data from unauthorized program activity”).
If I do select the “Protect my computer…” checkbox and then select the OK button, I get, “Unable to find a version of the runtime to run this application.”
However, if I uncheck that checkbox, it runs fine.
So apparently the .NET runtime is considered “unauthorized program activity.”
If I run this app from the same place (a folder on a mapped drive that is neither mine nor the user’s C: drive) from another user’s machine, it won’t start up at all, and gives me an iofileloadexception error. But AFAIK, the .DLLs the app needs have been copied over to the mapped drive’s folder, as well as the text file the startup process references. Is there a tool that shows what ancillary files need to be distributed with a C# .exe created with Visual Studio (2010)? IOW, such a tool should tell me that I need the log4net.dll, a custom internal framework .DLL, and the aforementioned text file. And perhaps something else that, when deployed, would allow the app to run on the user’s machine.
UPDATED
Okay, I think I may be “on the trail” as far as being able to determine what files need to be deployed with a given .exe:
If you select Project | Properties | Publish | Application Files in Visual
Studio, it seems to show you just which files you need to deploy with your app. However,
there are still a couple of issues (noted in parenthesis below; and the bombshell at the
end):
EXE and related files:
1) <appName>.exe (duh, AKA "doh")
2) <appName>.exe.config
3) <appName>.exe.manifest (I have no such file - although I do have a file named
<appName>.vshost.exe.manifest; should I rename it by stripping out the "vshost" part of the name?)
4) <appName>.ico
DLLs:
Any non-native DLLs your project uses, such as (in this case):
<customFrameworkAssembly>.dll
log4net.dll
Devart.Data.dll
Devart.Data.Oracle.dll
HOWEVER, it does not explain why I’m able to run the app from another developer’s
machine (even when those files had not been deployed to the shared network directory).
The files that you need to deploy can be seen from the project in Visual Studio by selecting Project | Properties | Publish | Application files…
Once you move these to the same location as the .exe, all is right with the world again (well, this little part of your little world, anyway).