configurationmanager

Visual Studio Configuration Manager x64 only option

亡梦爱人 提交于 2019-12-25 03:08:59
问题 I seem to have completely the *emphasized text*opposite*emphasized text* problem to everyone else... I'm trying to have my program (C++/CLI - Visual Studio 2010) run on any machine - but it's only working on 64 bit machines... I checked my Configuration Manager and when I try and choose a new platform, "x64" is the only one that exists? There is no other option - and I'm a bit stuck for ideas :( 回答1: In the configuration manager, for each project it lists the Platform (x86, x64, etc.). Just

Visual Studio 10, reset configuration manager to factory settings

陌路散爱 提交于 2019-12-23 12:05:54
问题 I have made several changes to both debug and release settings and now I want to return to factory settings. How could I do that? 回答1: There is no easy way to go back to the default configuration for a project file. When you create a new project it's based off a template located in your Visual Studio directory (e.g. C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplates\CSharp\Windows\1033\ClassLibrary.zip) and VS has no way of reapplying the template. However, you

AppSettings from custom files

狂风中的少年 提交于 2019-12-23 10:20:05
问题 I am struggling with the configuration and setting classes in .NET 2.0 If the following is contaned in a file called app.config <config> <appSettings> <add key="Foo" value="Hello World!"/> </appSettings> </config> I know I can access the appSetting by // this returns "Hello World!" ConfigurationManager.AppSettings["Foo"] However if the file is called app1.config (or any other name) I cannot access the appSetting. As long as I understand, with ConfigurationManager.OpenExeConfiguration I should

How can I retrieve list of custom configuration sections in the .config file using C#? [duplicate]

浪子不回头ぞ 提交于 2019-12-23 08:39:23
问题 This question already has answers here : Custom Configuration for app.config - collections of sections? (2 answers) Closed 6 years ago . When I try to retrieve the list of sections in the .config file using Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); the config.Sections collection contains a bunch of system section but none of the sections I have file defined in the configSections tag. 回答1: Here is a blog article that should get you what you

How can I retrieve list of custom configuration sections in the .config file using C#? [duplicate]

会有一股神秘感。 提交于 2019-12-23 08:39:11
问题 This question already has answers here : Custom Configuration for app.config - collections of sections? (2 answers) Closed 6 years ago . When I try to retrieve the list of sections in the .config file using Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); the config.Sections collection contains a bunch of system section but none of the sections I have file defined in the configSections tag. 回答1: Here is a blog article that should get you what you

ConfigurationManager.AppSettings - Returns Null

≡放荡痞女 提交于 2019-12-23 08:07:12
问题 Im trying to read settings from my app.config and im sure it was working before but now it returns a nullReferenceException. My code getting the settings is as follows: codeValueUtilRx = ConfigurationManager.AppSettings["CODEVALUE_UTIL_RX"].Split(';').ToList(); My app-congfig is as follows: <appSettings> <add key ="LOGFILELOCATION" value ="C:\\RuleEditor\\"/> <add key ="CODEVALUE_UTIL_RX" value="GCN;GRP;NDC;SPEC;TCC"/> </appSettings> I have a feeling its something seemingly obvious, I just

wpf - Get values from App Config file

好久不见. 提交于 2019-12-21 12:12:07
问题 How to get values from App.Config. Code: <configuration> <appSettings> <add key="ShowRoomCode" value="1000"/> <add key="FolderPath" value="D:\\Images\\Book\\"/> </appSettings> </configuration> string imageFolderPath = ConfigurationManager.AppSettings["FolderPath"]; But it returns null value. Config file is in the Same project. 回答1: If you expand the Properties section of Visual Studio and double click the settings section, you will be able to add custom settings which end up like so in the

Is there a way to reinstall an application in SCCM 2012?

不想你离开。 提交于 2019-12-20 03:18:01
问题 In SCCM 2007, there were several "Right Click Tools", and with their help it was possible to "reinstall" a package. In SCCM 2012 I still couldn't find a way, how could I reinstall an application? Let me explain: I created an installation package from a software, then distributed it as an "Application". Installation finished successfully. One week later a user calls, he is having trouble with this application. The package I created supports the reinstallation(either by removing the software

The problem with NUnit and app.config

拜拜、爱过 提交于 2019-12-18 12:06:00
问题 When i run a simple test on connection to DB check i receive an error in NUnit: [Test] public void TestConn() { string connectionString = ConfigurationManager.ConnectionStrings["FertigungRead"].ConnectionString; SqlConnection connection = new SqlConnection(connectionString); connection.Open(); Assert.AreEqual(ConnectionState.Open, connection.State); connection.Close(); } System.NullReferenceException : Object reference not set to an instance of an object. on line : connectionString =

ConfigurationManager keeps getting Machine.config connection string

删除回忆录丶 提交于 2019-12-18 04:08:23
问题 I have a c# assembly that uses the app.config to store its database connection string. When debugging the application I noticed that the connection to the database kept failing because the ConfigurationManager kept returning the machine.config connection string: data source=.\SQLEXPRESS; Integrated Security;.... I added <clear/ > before my connection string in the app.config and it fixed the issue on my dev machine. The problem returned when I deployed it to production. Can someone tell me