Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Problem with Power Shell and .config Files

Reply
 
Old 05-26-2009   #1 (permalink)
BillyB


 
 

Problem with Power Shell and .config Files

We're new to PS, and trying to instantiate and invoke our .NET objects from
PS scripts. What a GREAT tool!

We've overcome the initial learning curve, gotten past the intracies of
LoadFrom() vs LoadFile() in the Reflection namespace, but have been stopped
short because our objects hit .config files.

We overcame the first problem - finding our config file in a custom
location. For those not familiar, this does the trick nicely:

[System.AppDomain]::CurrentDomain.SetData("APP_CONFIG_FILE", $currDir +
"\app.config");

Now, however, we're hung up again because we use a custom config section:

<section name="BMT" type="Bmt.Shared.Common.BmtConfigurationSection,
Bmt.Shared.Common, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=b2911254f1c07a11"/>

Even though our "Common" assembly has already been loaded in the PS1 script
AND is in the same directory as the .config file, the .NET configuration
architecture can't find it.

Can any of you PS gurus help us out? We don't wanna put this assembly in the
GAC.

'Preciate it,

-BillyB


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Power Shell? PowerShell
How to run power shell in batch files or MS-DOS PowerShell
power shell in a script PowerShell
Executing Power Shell Scripts from Windows Shell PowerShell
power shell in x64 PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46