Solved

Need Help Refactoring please.

Posted on 2015-02-21
5
35 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 75

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 75

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C# Error - Add Failed 12 78
What .NET website keeps me current? 9 54
Authentication of Web Services 3 46
Problem of RegEx to match the first occurence of 10 35
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

919 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

14 Experts available now in Live!

Get 1:1 Help Now