我的程序只能在certian项目VB.NET中的debug文件夹中运行 [英] My program only works in the debug folder in a certian project VB.NET

查看:88
本文介绍了我的程序只能在certian项目VB.NET中的debug文件夹中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好我的问题很难解释,但我的程序是一个文件系统观察程序,我做了一个项目在调试器vb.net运行它,它工作正常,但当我移动内置的exe和所有必要的.dll文件程序运行,我知道错误,但它只是不起作用。文件系统观察者什么都不做。所以我用所有相同的文件创建了另一个项目并且在新项目中没有工作现在只会在调试文件夹中的那个项目文件夹中运行,并且在我的任何代码中都没有提及该目录可以帮助任何人。



我尝试了什么:



我在线搜索但不确定是否有人这样做过错误。

hi everyone the problem im having is hard to explain but my program is a filesystem watcher program and i made a project run it in debugger vb.net and it worked fine but when i move the built exe and all necessary .dll files the program runs, i get know errors but it just doesnt work. the filesystem watcher does nothing. so i created another project with all the same files and didnt work in the new project now will only run in that one project folder in debug folder and there is no mention in any of my code the directory can anyone help.

What I have tried:

ive searched online but not sure if anyones ever had this error.

推荐答案

如果没有完整的应用程序代码,我们无法做任何事情 - 而且你的完整应用程序对我们来说太大了在合理的时间段内。



所以你必须自己收集信息。

因为你不能使用调试器,你将不得不回到旧的方法,并开始向你的应用程序添加日志记录代码,以便发布崩溃,你可以找到它有多远,并缩小问题发生的地方。

当你有一个方法左右时,你可以仔细查看它并加强日志记录以找出它失败的确切位置,以及当时代码中的变量。

如果没有这个,没有人可以开始帮你解决这个问题!



对不起,但是由你来收集你能得到的信息在这里,我们不能为你做任何事。
Without your full application code, there isn't anything we can do - and your full app is going to be far too big for us to wade through in a reasonable time period.

So you are going to have to gather information for yourself.
Since you can't use the debugger, you will have to fall back onto the old methods, and start by adding logging code to you app so that post crash you can find out how far it got, and narrow down where the problem is occurring.
When you have it down to a method or so, you can look closely at that and intensify the logging to find out exactly where it fails, and what the variables in the code are holding at the time.
Without that, nobody can even start to help you fix this!

Sorry, but it's up to you to gather what information you can here, we can't do any of that for you.


FileSystemWatcher没有任何问题,所以这取决于你的代码。



我最大的怀疑是你没有使用完全合格的(以驱动器号或UNC开头)路径。最大的新错误是假设当前目录是什么,只是使用相对路径。不要!



总是建立你正在使用的文件和文件夹的完全限定路径。
There's nothing wrong with the FileSystemWatcher, so it's down to your code.

My biggest suspicion is that you're not using a fully qualified (starts with a drive letter or UNC) path. The biggest newb mistake is assuming what the "current directory" is and just using relative paths from that. Don't!

ALWAYS build fully qualified paths to the files and folders you're using.


这篇关于我的程序只能在certian项目VB.NET中的debug文件夹中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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