Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » .NET   (RSS)

"The configuration section for Logging cannot be found in the configuration source." or how to read an external configuration file for the Logging Application Block

When using the Logging Application Block, using an IConfigurationSource to read your logging configuration from an external reference might throw a ConfigurationErrorsException("The configuration section for Logging cannot be found in the configuration
Posted by lvovan | 0 Comments
Filed under: , ,

"The configuration section for Logging cannot be found in the configuration source." ou comment lire un fichier de configuration externe pour le Logging Application Block

Dans le cadre du Logging Application Block , l'utilisation d'IConfigurationSource pour lire une configuration externe peut provoquer une ConfigurationErrorsException("The configuration section for Logging cannot be found in the configuration source."),
Posted by lvovan | 0 Comments

Reading a configuration file from an abitrary path

Here a a few, but often useful, lines of code that open a .NET configuration file from any given path. Just use the OpenMappedExeConfiguration method : var configFileMap = new ExeConfigurationFileMap (); configFileMap.ExeConfigFilename = @"C:\TEMP\MyApp.config"
Posted by lvovan | 0 Comments
Filed under: , ,

Lire un fichier de configuration .NET depuis un chemin arbitraire

Quelques lignes de code simples, mais souvent utiles, permettant d’ouvrir un fichier de configuration .NET depuis n’importe quel chemin accessible. Il suffit d’utiliser la méthode OpenMappedExeConfiguration : var configFileMap = new ExeConfigurationFileMap
Posted by lvovan | 0 Comments
Filed under: , ,

Interacting between Powershell and a host .NET application

An unusual topic in today’s post : interacting between Powershell and a host .NET application. The examples available on MSDN show how to host Powershell runspaces using classes from the System.Management.Automation namespace ; but it is also possible
Posted by lvovan | 1 Comments
Attachment(s): Program.cs

Interaction entre Powershell et une application hôte .NET

Sujet inhabituel sur ce blog: l’interaction entre Powershell et une application hôte .NET. Les exemples disponibles sur MSDN montrent comment héberger des runspaces Powershell via les classes du namespace System.Management.Automation ; mais outre le simple
Posted by lvovan | 1 Comments
Attachment(s): Program.cs

Utilisation de flags binaires [Flags]

Ce post décrit comment utiliser et définir des flags binaires. Ceux-ci permettent de combiner facilement et lisiblement des propriétés. Un des exemples d’utilisation les plus populaires étant avec les attributs de fichiers : File .SetAttributes( @"C:\Temp\MonFichier"
Posted by lvovan | 1 Comments
Attachment(s): FlagsExample.cs
 
Page view tracker