Can't run application in debug folder of Visual Studio Solution?

浪尽此生 提交于 2019-12-25 04:42:32

问题


I can not run the application in Debug folder without admin rights.Whenever I run it without admin rights, the JIT-debugger window appears. What's the problem? Help me please I need a quick solution.

Update:

Here is the debugger

after pressing yes

.

Here I can see that can't read path from settings, but when I run it as admin it doesn't give me any exception. Maybe it can't read because there some stuck with file permissions.

The message indicates "Object reference not set to an instance of the object.. " In fact, I expect that person programmed in Visual Studio should be familiar of such kind exceptions.


回答1:


Click Yes. It is trying to be helpful and show you what unhandled exception is bombing your program. Whether that will provide a quick solution is unguessable.




回答2:


The exception tells me that you don't have that key / value in your .config, and that's why you're getting an exception. Also, the JIT seems to be enabled only to the administrator, and if you run your application without those rights, it will not pop up, but your exception will still be there.




回答3:


After a long search found a bug, it turned out that the code specified on picture does not work, but after its replacement by:

     private static readonly Configuration Other = ConfigurationManager.OpenExeConfiguration ("MediaPlayer.exe");
     private static readonly string _plPath = Other.AppSettings.Settings ["PlaylistLocation"]. Value;
     private static readonly string _videoDir = Other.AppSettings.Settings ["VideoDestination"]. Value;

all work fine. Let it be a help for those who has faced such a problem.



来源:https://stackoverflow.com/questions/4508327/cant-run-application-in-debug-folder-of-visual-studio-solution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!