CLSA, .config and Powershell

CLSA, .config and Powershell

Old forum URL: forums.lhotka.net/forums/t/3319.aspx


rwilkerson posted on Friday, August 03, 2007

We've created several CSLA business objects for our application and I'm now wanting to leverage that work and provide Powershell cmdlets to provide automation and scripting.  The problem is I can't figure out how to the configuration required by our objects to work because of the need of a .config file.

Has anyone gotten this combination to work?

A related question is trying to get CSLA BO's to work with a MMC 3.0 snapin.  In both cases I don't have control over the .exe.config

Thanks in advance.

Rick...

rwilkerson replied on Monday, August 06, 2007

Let me ask the question in a slightly different way.  Anybody know if it's possible to redirect the .config file that the ConfigurationManager class is reading from?  (With the condition that we can't change the app.exe.config).

Rick...

amselem replied on Wednesday, August 08, 2007

I don't have experience with PowerShell, but I'm also interested on this topic. I did a little of search and found this:

http://keithhill.spaces.live.com/blog/cns!5A8D2641E0963A97!391.entry

Let me know if that helped
regards

Jacobo

rwilkerson replied on Saturday, August 18, 2007

I'm getting closer with regard to a MMC snap-in that uses CSLA business objects.  What I've found is the MMC snap-in will look for a 'mmc.exe.config' file in the same folder as the snap-in DLL.

That's allowed be to put my connection strings and other settings to allow the business objects to function.

of course solving one problem often leads to another.  Now it appears that I'm losing my user context. 

I have a simple Datagrid control that's being bound to an EditableRootList.  Even though I've hard-coded my login I'm still getting exceptions because 'CanReadProperty' calls are failing.  Looking closer I find that the ApplicationContext.user is empty.

Copyright (c) Marimer LLC