简体   繁体   English

无法在Visual Studio解决方案的调试文件夹中运行应用程序?

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

I can not run the application in Debug folder without admin rights.Whenever I run it without admin rights, the JIT-debugger window appears. 如果没有管理员权限,则无法在Debug文件夹中运行该应用程序。每当没有管理员权限时,都将运行JIT-debugger窗口。 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. 该消息指示“对象引用未设置为该对象的实例。”实际上,我希望在Visual Studio中编程的人应该熟悉此类异常。

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. 能否提供快速解决方案是毫无疑问的。

The exception tells me that you don't have that key / value in your .config, and that's why you're getting an exception. 异常告诉我,您的.config中没有该键/值,这就是为什么您遇到异常的原因。 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. 另外,JIT似乎仅对管理员启用,并且如果您在没有这些权限的情况下运行应用程序,它将不会弹出,但是您的异常仍然存在。

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. 让它对那些遇到过此类问题的人有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2017 找不到解决方案中存在的文件夹 - Visual Studio 2017 can't find folder that exists in the solution 如何在 Visual Studio 调试中以管理员身份运行应用程序? - How to run application as administrator in debug with Visual Studio? Visual Studio 2017,无法调试或运行该应用程序 - Visual Studio 2017, cannot debug or run the application 选择要在 Visual Studio 2010 中调试或运行的解决方案下的项目 - Selecting which project under a solution to debug or run in Visual Studio 2010 Web解决方案中的Visual Studio C#调试控制台应用程序 - Visual Studio C# debug console application that is part of web solution Visual Studio在打开Web应用程序解决方案时创建bin文件夹? - Visual Studio creates bin folder on opening web application solution? 通过提供Visual Studio Solution的release文件夹来部署wpf应用程序 - Deploying a wpf application by giving the release folder of Visual Studio Solution 如何在 vscode 中调试 visual studio 中的原始解决方案 - How can I debug a solution original in visual studio in vscode Visual Studio:从其他文件夹以调试模式运行 - Visual Studio: run in debug mode from different folder 无法在Visual Studio中调试WPF项目 - Can't Debug WPF project in Visual Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM