如何确定缺少哪个辅助文件[s]? [英] How can I determine which ancillary file[s] is/are missing?

查看:40
本文介绍了如何确定缺少哪个辅助文件[s]?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我从网络驱动器右键单击我的应用程序并选择运行方式 |当前用户,应用是否运行取决于我是否点击了子复选框(保护我的计算机和数据免受未经授权的程序活动").

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.

因此显然 .NET 运行时被视为未经授权的程序活动".

So apparently the .NET runtime is considered "unauthorized program activity."

如果我从另一个用户的机器的同一个地方(映射驱动器上的一个文件夹,既不是我的也不是用户的 C: 驱动器)运行这个应用程序,它根本不会启动,并给我一个 iofileloadexception 错误.但 AFAIK,应用程序所需的 .DLL 已复制到映射驱动器的文件夹,以及启动过程引用的文本文件.是否有工具显示需要使用 Visual Studio (2010) 创建的 C# .exe 分发哪些辅助文件?IOW,这样的工具应该告诉我我需要 log4net.dll、自定义内部框架 .DLL 和上述文本文件.也许还有其他一些东西,在部署后,可以让应用程序在用户的机器上运行.

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.

好的,我想我可能会在路上",因为能够确定需要使用给定的 .exe 部署哪些文件:

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:

如果您选择项目 |属性 |发布 |可视化应用程序文件Studio,它似乎只是向您展示了需要与应用程序一起部署的文件.然而,还有一些问题(在下面的括号中注明;以及结束):

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).

推荐答案

在 Visual Studio 的项目中选择 Project | 可以看到需要部署的文件.属性 |发布 |应用程序文件……

The files that you need to deploy can be seen from the project in Visual Studio by selecting Project | Properties | Publish | Application files…

一旦您将它们移动到与 .exe 相同的位置,一切又都会恢复正常(好吧,无论如何,这就是您的小世界的一小部分).

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).

这篇关于如何确定缺少哪个辅助文件[s]?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆