配置文件 [英] the config file

查看:98
本文介绍了配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C#中有一个Windows窗体应用程序。

我创建了myApp.exe.config文件,如果我只运行exe就可以正常工作。


当我尝试从Visual Studio调试它时它没有看到它并抛出

异常。

.config文件与源代码位于同一文件夹中。


谢谢!

I have a Windows Forms app in C#.
I created the myApp.exe.config file and it works fine if I just run the exe.

When I try to debug it from Visual Studio it does not see it and throws an
exception.
The .config file resides in the same folder as the source code.

Thanks!

推荐答案

对,你必须在调试之前手动复制配置文件,这样才能它

加载。调试时,程序从bin / debug文件夹运行。

Daniel P. <哒****** @ hotmail.comU>在消息中写道

新闻:uJ ************** @ TK2MSFTNGP09.phx.gbl ...
Right, you have to copy the config file manually before debugging so that it
loads. When you debug, the program runs from the bin/debug folder.
"Daniel P." <da******@hotmail.comU> wrote in message
news:uJ**************@TK2MSFTNGP09.phx.gbl...
我有一个Windows窗体应用程序在C#中。
我创建了myApp.exe.config文件,如果我只运行
exe它就可以正常工作。
当我尝试从Visual Studio调试它时它看不到它并抛出
异常。
.config文件与源代码位于同一文件夹中。

谢谢!
I have a Windows Forms app in C#.
I created the myApp.exe.config file and it works fine if I just run the exe.
When I try to debug it from Visual Studio it does not see it and throws an
exception.
The .config file resides in the same folder as the source code.

Thanks!



这非常不方便。感谢您的信息。


" Peter Rilling" < PE *** @ nospam.rilling.net>在消息中写道

新闻:************** @ TK2MSFTNGP11.phx.gbl ...
That is very inconvenient. Thanks for info.


"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:Of**************@TK2MSFTNGP11.phx.gbl...
对,你必须在调试之前手动复制配置文件,以便加载
。调试时,程序从bin / debug文件夹运行。

Daniel P. <哒****** @ hotmail.comU>在消息中写道
新闻:uJ ************** @ TK2MSFTNGP09.phx.gbl ...
Right, you have to copy the config file manually before debugging so that it loads. When you debug, the program runs from the bin/debug folder.
"Daniel P." <da******@hotmail.comU> wrote in message
news:uJ**************@TK2MSFTNGP09.phx.gbl...
我在C#中有一个Windows窗体应用程序。
我创建了myApp.exe.config文件,如果我只运行
I have a Windows Forms app in C#.
I created the myApp.exe.config file and it works fine if I just run the


exe就可以正常工作。


exe.


当我尝试调试它时从Visual Studio它看不到它并抛出
异常。
.config文件与源代码位于同一个文件夹中。

谢谢!

When I try to debug it from Visual Studio it does not see it and throws an exception.
The .config file resides in the same folder as the source code.

Thanks!




2004年6月2日星期三14:47:52 -0500,Daniel P. < da ****** @ hotmail.comU>

写道:
On Wed, 2 Jun 2004 14:47:52 -0500, "Daniel P." <da******@hotmail.comU>
wrote:
我在C#中有一个Windows窗体应用程序。
我创建了myApp.exe.config文件,如果我只运行exe就可以正常工作。

当我尝试从Visual Studio调试它时,它没有看到它并抛出一个
异常。
.config文件与源代码位于同一文件夹中。

谢谢!
I have a Windows Forms app in C#.
I created the myApp.exe.config file and it works fine if I just run the exe.

When I try to debug it from Visual Studio it does not see it and throws an
exception.
The .config file resides in the same folder as the source code.

Thanks!




在解决方案资源管理器中,右键 - 单击项目,选择Add New Item。

然后滚动到底部并选择Application Configuration File。

将配置文件复制到其中。


Austin



In Solution Explorer, right-click on the project, select Add New Item.
Then scroll to the bottom and select Application Configuration File.
Copy your config file into it.

Austin


这篇关于配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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