读取 app.config 取得空值,请问是为什么
app.config 里面的内容是<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key ="value1" value="v1">value1</add>
</appSettings>
</configuration>
主窗体就一个BUTTON
Imports System.Configuration
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim v2 As String
v2 = ConfigurationManager.AppSettings("value1")
MsgBox(v2)
End Sub
End Class
请问,为什么读不出来,网上像我这样出现这种问题的比较少,都搜不出来 vb.net --------------------编程问答-------------------- 而且在即时窗口下 ConfigurationManager.AppSettings.Count
出来的值是 0
是不是没有加载 app.config ?
补充:.NET技术 , VB.NET