Class is inherited from abstract class which is in another project. How to use a value from app.config from original project?ConfigurationManager.AppSettings use another config fileConvert a string to an enum in C#How do I get the path of the assembly the code is in?String representation of an EnumHow do I update the GUI from another thread?MetadataException: Unable to load the specified metadata resourceCreating a comma separated list from IList<string> or IEnumerable<string>Get int value from enum in C#How do I remedy the “The breakpoint will not currently be hit. No symbols have been loaded for this document.” warning?Call one constructor from anotherWhy not inherit from List<T>?
Hilbert's hotel, why can't I repeat it infinitely many times?
What is this utensil for?
How to deal with my team leader who keeps calling me about project updates even though I am on leave for personal reasons?
Would Taiwan and China's dispute be solved if Taiwan gave up being the Republic of China?
How can an attacker use robots.txt?
Why is the missed-approach course for the "RNAV (GNSS) - A" approach to runway 28 at ENSB shaped all funny?
What is the meaning of "heutig" in this sentence?
A high quality contribution but an annoying error is present in my published article
Find missing number in the transformation
Why is there is no screening for Ovarian Cancer?
Is It Possible to Have Different Sea Levels, Eventually Causing New Landforms to Appear?
What is the need of methods like GET and POST in the HTTP protocol?
Do things made of adamantine rust?
If the EU does not offer an extension to UK's Article 50 invocation, is the Benn Bill irrelevant?
Guitar tuning (EADGBE), "perfect" fourths?
What is the meaning of word 'crack' in chapter 33 of A Game of Thrones?
Do the villains know Batman has no superpowers?
Which museums have artworks of all four Ninja Turtles' namesakes?
Why is there not a feasible solution for a MIP?
Conditionally execute a command if a specific package is loaded
Where are they calling from?
Who created the Lightning Web Component?
Why are there two fundamental laws of logic?
How can I repair this gas leak on my new range? Teflon tape isn't working
Class is inherited from abstract class which is in another project. How to use a value from app.config from original project?
ConfigurationManager.AppSettings use another config fileConvert a string to an enum in C#How do I get the path of the assembly the code is in?String representation of an EnumHow do I update the GUI from another thread?MetadataException: Unable to load the specified metadata resourceCreating a comma separated list from IList<string> or IEnumerable<string>Get int value from enum in C#How do I remedy the “The breakpoint will not currently be hit. No symbols have been loaded for this document.” warning?Call one constructor from anotherWhy not inherit from List<T>?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have abstract class:
namespace Project1
public abstract class AbstractManager
public readonly string SomeSetting =
ConfigurationManager.AppSettings["SomeSetting"];
I have a class which is inherited from this abstract class and located in another project:
namespace Project2
public class SpecificManager : AbstractManager
The problem is when I create SpecificManager it uses value from app.config of Project2 for SomeSetting, but I want it to uses value from app.config of Project1. Is there a way to do so?
c# configurationmanager
add a comment
|
I have abstract class:
namespace Project1
public abstract class AbstractManager
public readonly string SomeSetting =
ConfigurationManager.AppSettings["SomeSetting"];
I have a class which is inherited from this abstract class and located in another project:
namespace Project2
public class SpecificManager : AbstractManager
The problem is when I create SpecificManager it uses value from app.config of Project2 for SomeSetting, but I want it to uses value from app.config of Project1. Is there a way to do so?
c# configurationmanager
4
not by default ... you need to point the config file in Project1 ... ConfigurationManager will always take config from executable config (I assumed the you have Project1.dll and Project2.exe with their configs)
– Selvin
Mar 28 at 16:14
@Selvin you mean like here link? I really don't like this solution, maybe I can do it somehow differently?
– Gelo
Mar 28 at 16:19
@Gelo Can you use a Settings file? This is "bound" to the project it's placed in. And as a positive side effect, you get strong types by selecting the type you want to have for that setting (so no casting/parsing required).
– Progman
Mar 28 at 18:04
add a comment
|
I have abstract class:
namespace Project1
public abstract class AbstractManager
public readonly string SomeSetting =
ConfigurationManager.AppSettings["SomeSetting"];
I have a class which is inherited from this abstract class and located in another project:
namespace Project2
public class SpecificManager : AbstractManager
The problem is when I create SpecificManager it uses value from app.config of Project2 for SomeSetting, but I want it to uses value from app.config of Project1. Is there a way to do so?
c# configurationmanager
I have abstract class:
namespace Project1
public abstract class AbstractManager
public readonly string SomeSetting =
ConfigurationManager.AppSettings["SomeSetting"];
I have a class which is inherited from this abstract class and located in another project:
namespace Project2
public class SpecificManager : AbstractManager
The problem is when I create SpecificManager it uses value from app.config of Project2 for SomeSetting, but I want it to uses value from app.config of Project1. Is there a way to do so?
c# configurationmanager
c# configurationmanager
asked Mar 28 at 16:12
GeloGelo
301 silver badge9 bronze badges
301 silver badge9 bronze badges
4
not by default ... you need to point the config file in Project1 ... ConfigurationManager will always take config from executable config (I assumed the you have Project1.dll and Project2.exe with their configs)
– Selvin
Mar 28 at 16:14
@Selvin you mean like here link? I really don't like this solution, maybe I can do it somehow differently?
– Gelo
Mar 28 at 16:19
@Gelo Can you use a Settings file? This is "bound" to the project it's placed in. And as a positive side effect, you get strong types by selecting the type you want to have for that setting (so no casting/parsing required).
– Progman
Mar 28 at 18:04
add a comment
|
4
not by default ... you need to point the config file in Project1 ... ConfigurationManager will always take config from executable config (I assumed the you have Project1.dll and Project2.exe with their configs)
– Selvin
Mar 28 at 16:14
@Selvin you mean like here link? I really don't like this solution, maybe I can do it somehow differently?
– Gelo
Mar 28 at 16:19
@Gelo Can you use a Settings file? This is "bound" to the project it's placed in. And as a positive side effect, you get strong types by selecting the type you want to have for that setting (so no casting/parsing required).
– Progman
Mar 28 at 18:04
4
4
not by default ... you need to point the config file in Project1 ... ConfigurationManager will always take config from executable config (I assumed the you have Project1.dll and Project2.exe with their configs)
– Selvin
Mar 28 at 16:14
not by default ... you need to point the config file in Project1 ... ConfigurationManager will always take config from executable config (I assumed the you have Project1.dll and Project2.exe with their configs)
– Selvin
Mar 28 at 16:14
@Selvin you mean like here link? I really don't like this solution, maybe I can do it somehow differently?
– Gelo
Mar 28 at 16:19
@Selvin you mean like here link? I really don't like this solution, maybe I can do it somehow differently?
– Gelo
Mar 28 at 16:19
@Gelo Can you use a Settings file? This is "bound" to the project it's placed in. And as a positive side effect, you get strong types by selecting the type you want to have for that setting (so no casting/parsing required).
– Progman
Mar 28 at 18:04
@Gelo Can you use a Settings file? This is "bound" to the project it's placed in. And as a positive side effect, you get strong types by selecting the type you want to have for that setting (so no casting/parsing required).
– Progman
Mar 28 at 18:04
add a comment
|
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55402294%2fclass-is-inherited-from-abstract-class-which-is-in-another-project-how-to-use-a%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55402294%2fclass-is-inherited-from-abstract-class-which-is-in-another-project-how-to-use-a%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
4
not by default ... you need to point the config file in Project1 ... ConfigurationManager will always take config from executable config (I assumed the you have Project1.dll and Project2.exe with their configs)
– Selvin
Mar 28 at 16:14
@Selvin you mean like here link? I really don't like this solution, maybe I can do it somehow differently?
– Gelo
Mar 28 at 16:19
@Gelo Can you use a Settings file? This is "bound" to the project it's placed in. And as a positive side effect, you get strong types by selecting the type you want to have for that setting (so no casting/parsing required).
– Progman
Mar 28 at 18:04