Solved

Need Help Refactoring please.

Posted on 2015-02-21
5
33 Views
Last Modified: 2015-03-05
I need help with my authentication dll.  I am trying to read settings from the authenication.config inside the class library.  I am trying to write a strategy pattern to access different authenticatons methods, whether I want to use AD, Database, and etc.  Can someone please help me.

its located on my google drive.
https://drive.google.com/file/d/0B6LKujct8rieRXpjc1ZMbm13TTA/view?usp=sharing
0
Comment
Question by:cbrune
  • 2
  • 2
5 Comments
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 40623747
Do you have a specific question?
0
 

Author Comment

by:cbrune
ID: 40623762
I can't grab the app settings from authentication.config in the authentication config settings.. How do I?
0
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 40623775
You put app settings in your main configuration file--i.e. the one that goes with the main executable. The configuration system doesn't read anything but that, even if you include additional configs. You can manually read the config, but it's usually easier/quicker to just include the settings in the main config.
0
 

Author Comment

by:cbrune
ID: 40623777
But how do I have a secondary config and read files from there??
0
 
LVL 12

Accepted Solution

by:
FarWest earned 500 total points
ID: 40623844
as said, configuration will be the one of your main executable
but still you can read other assemblies config files
 this sample uses OpenMappedExeConfiguration is to open other configuration files
var configFileMap = new ExeConfigurationFileMap();
configFileMap.ExeConfigFilename = "AssemblyName.dll.config";
var section = ConfigurationManager.OpenMappedExeConfiguration(configFileMap, ConfigurationUserLevel.None).GetSection(sectionName);

Open in new window

0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Unit testing, moq, best practices 7 29
Image(7) 1 37
bulid json format 3 21
Events in static methods 3 31
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now