This project has moved. For the latest updates, please go here.

CSD wont generate sample configuration VS2010

Jul 18, 2011 at 1:11 PM
Edited Jul 18, 2011 at 1:14 PM

Hei, 

i dowloaded and installed the CSD for VS 2010 and created sample project. Now when i save the project the output looks promising:

------ CSD file generation started: Configuration document: C:\Users\xxxx.xxxxxx\Documents\Visual Studio 2010\Projects\testConfApp\testConfApp\testConfApp.csd ------
* Searching for configuration project handle... found!
* Cleaning up existing files... complete!

 

 But when i look at the sample .config file what should be generated then it looks like this:

 

<?xml version="1.0"?>
<!--
<auto-generated>
    This code was generated by a tool.

     Changes to this file may cause incorrect behavior and will be lost if
    the code is regenerated.
</auto-generated>
-->
<configuration>
	<configSections>
		<section name="tutorialSections" type="testConfApp.TutorialSections, testConfApp"/>
	</configSections>
	<tutorialSections xmlns="urn:testConfApp">
		<!--
		This is just a minimal sample configuration file that shows how to declare
		the configuration sections.

		Because an XML Schema Definition (XSD) is generated for each configuration
		section, it should be trivial to edit these files because you have
		IntelliSense on the XML definition.
		-->
	</tutorialSections>
</configuration>

 

Here's a screenshot of the csd designer view:

Uploaded with ImageShack.us

 

Anybody having similar problem?

Coordinator
Jul 18, 2011 at 5:28 PM

I responded to this post in the issues forum as follows:

The "Sample" label may be a little misleading. It's really creating more of a "scaffold" from which to base your actual configuration. It may be worth looking into making this clearer.

I was just thinking that it MAY be possible to have it attempt to generate some more "sample" code (for nested groups, etc), but this may be a complex task to address. I will think some more about this...

Jul 19, 2011 at 5:48 AM

I have a question then, how would i use the generated "scaffold" then. There seems to be no documentation about that.

Coordinator
Jul 19, 2011 at 3:27 PM

Creating and using configuration files is a pretty complex task. This tool was created to make designing and visualizing configuration designs easier. To use the configurations that you design, one needs to learn how the System.Configuration.ConfigurationManager class works and become familiar with configuration sections. There may be tools out on the web that will allow one to visually edit the actual config files, but that is beyond the scope if this project at this time. I will try to improve the documentation for this project to include info contained in these articles, but this may take a little time. For now, you can also download the latest source code changeset to see some new config file demos that I added to the "Samples" solution.

To help with this process, I have located some good links that help explain config sections and their usage. Upon reading these articles, you will notice that Configuration Section Designer does a lot of the work mentioned in the articles automatically (ex: building the config section classes). 

I hope this helps.

 

System.Configuration.ConfigurationManager class:

http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager(VS.80).aspx

 

Good stackoverflow question about config sections.

http://stackoverflow.com/questions/758986/custom-app-config-config-section-handler

 

3 part article on config sections.

http://www.codeproject.com/KB/aspnet/ConfigSections.aspx

http://www.codeproject.com/KB/dotnet/mysteriesofconfiguration2.aspx

http://www.codeproject.com/KB/dotnet/mysteriesofconfiguration3.aspx

 

Nice article from Phil Haack

http://haacked.com/archive/2007/03/12/custom-configuration-sections-in-3-easy-steps.aspx