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;








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?










share|improve this question



















  • 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


















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?










share|improve this question



















  • 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














0












0








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?










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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













  • 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













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
);



);














draft saved

draft discarded
















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
















draft saved

draft discarded















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현