![]() |
|
|
#1 |
|
Guest
Posts: n/a
|
No Windows PowerShell Snap-ins are available for version 1
I get the exception message "No Windows PowerShell Snap-ins are available for
version 1" whenever running following lines of code: RunspaceConfiguration rc = RunspaceConfiguration.Create(); PSSnapInException snapEx = null; PSSnapInInfo info = rc.AddPSSnapIn("Microsoft.Exchange.Management.Powe rShell.Admin", out snapEx); <-- this line fails I run my VS projects on a x64 Windows with PS installed Our Exchange server is on a different machine. What could be wrong with my setup ? -- Jesus Loves You |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Re: No Windows PowerShell Snap-ins are available for version 1
subtile wrote:
> I get the exception message "No Windows PowerShell Snap-ins are available for > version 1" whenever running following lines of code: > > RunspaceConfiguration rc = RunspaceConfiguration.Create(); > PSSnapInException snapEx = null; > PSSnapInInfo info = > rc.AddPSSnapIn("Microsoft.Exchange.Management.Powe rShell.Admin", out snapEx); > <-- this line fails > > I run my VS projects on a x64 Windows with PS installed > Our Exchange server is on a different machine. > > What could be wrong with my setup ? > > Perhaps this helps: http://blogs.msdn.com/mstehle/archiv...l-snap-in.aspx Are you compiling your app for 64-bit? Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Re: No Windows PowerShell Snap-ins are available for version 1
Have you installed the Exchange Management tools on the computer you
have VS on? Kelly subtile wrote: > I get the exception message "No Windows PowerShell Snap-ins are available for > version 1" whenever running following lines of code: > > RunspaceConfiguration rc = RunspaceConfiguration.Create(); > PSSnapInException snapEx = null; > PSSnapInInfo info = > rc.AddPSSnapIn("Microsoft.Exchange.Management.Powe rShell.Admin", out snapEx); > <-- this line fails > > I run my VS projects on a x64 Windows with PS installed > Our Exchange server is on a different machine. > > What could be wrong with my setup ? > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Re: No Windows PowerShell Snap-ins are available for version 1
Hey Marco... I had already read this url you posted - Several times :-)
It's an ASP.NET web application and I can only choose Mixed Platforms, Any CPU and .NET in the Configuration Manager. Kelly: Yes I have installed the Exchange Management tools on the Dev server. Our Exchange Server and DEV server are right next to eachother in the same domain. I've tried to run my code in a console app directly on the Exchange Server with success. But yet no success from the remote DEV server ![]() "Marco Shaw [MVP]" wrote: > subtile wrote: > > I get the exception message "No Windows PowerShell Snap-ins are available for > > version 1" whenever running following lines of code: > > > > RunspaceConfiguration rc = RunspaceConfiguration.Create(); > > PSSnapInException snapEx = null; > > PSSnapInInfo info = > > rc.AddPSSnapIn("Microsoft.Exchange.Management.Powe rShell.Admin", out snapEx); > > <-- this line fails > > > > I run my VS projects on a x64 Windows with PS installed > > Our Exchange server is on a different machine. > > > > What could be wrong with my setup ? > > > > > > Perhaps this helps: > http://blogs.msdn.com/mstehle/archiv...l-snap-in.aspx > > Are you compiling your app for 64-bit? > > Marco > > -- > Microsoft MVP - Windows PowerShell > http://www.microsoft.com/mvp > > PowerGadgets MVP > http://www.powergadgets.com/mvp > > Blog: > http://marcoshaw.blogspot.com > |
|
|
|
#5 |
|
Guest
Posts: n/a
|
Re: No Windows PowerShell Snap-ins are available for version 1
subtile wrote:
> Hey Marco... I had already read this url you posted - Several times :-) > > It's an ASP.NET web application and I can only choose Mixed Platforms, Any > CPU and .NET in the Configuration Manager. > > Kelly: Yes I have installed the Exchange Management tools on the Dev server. > > Our Exchange Server and DEV server are right next to eachother in the same > domain. > > I've tried to run my code in a console app directly on the Exchange Server > with success. But yet no success from the remote DEV server ![]() (I don't have enough money to get a 64-bit system to play with...) OK, then maybe you're loading the wrong version of System.Management.Automation.dll? I'm assuming 2 versions get installed on 64-bit systems... Check out also: http://forums.microsoft.com/TechNet/...1900&SiteID=17 Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com |
|
|
|
#6 |
|
Guest
Posts: n/a
|
Re: No Windows PowerShell Snap-ins are available for version 1
The only other thing I can think of is that you are trying to load a 64
bit add-in into a 32 bit version of powershell. I remember making that mistake. Kelly subtile wrote: > I get the exception message "No Windows PowerShell Snap-ins are available for > version 1" whenever running following lines of code: > > RunspaceConfiguration rc = RunspaceConfiguration.Create(); > PSSnapInException snapEx = null; > PSSnapInInfo info = > rc.AddPSSnapIn("Microsoft.Exchange.Management.Powe rShell.Admin", out snapEx); > <-- this line fails > > I run my VS projects on a x64 Windows with PS installed > Our Exchange server is on a different machine. > > What could be wrong with my setup ? > > |
|
|
|
#7 |
|
Guest
Posts: n/a
|
Re: No Windows PowerShell Snap-ins are available for version 1
The only thing I can think of is trying to load a 64 bit add-in to a 32
bit version of PS. Kelly subtile wrote: > Hey Marco... I had already read this url you posted - Several times :-) > > It's an ASP.NET web application and I can only choose Mixed Platforms, Any > CPU and .NET in the Configuration Manager. > > Kelly: Yes I have installed the Exchange Management tools on the Dev server. > > Our Exchange Server and DEV server are right next to eachother in the same > domain. > > I've tried to run my code in a console app directly on the Exchange Server > with success. But yet no success from the remote DEV server ![]() > > > > "Marco Shaw [MVP]" wrote: >> subtile wrote: >>> I get the exception message "No Windows PowerShell Snap-ins are available for >>> version 1" whenever running following lines of code: >>> >>> RunspaceConfiguration rc = RunspaceConfiguration.Create(); >>> PSSnapInException snapEx = null; >>> PSSnapInInfo info = >>> rc.AddPSSnapIn("Microsoft.Exchange.Management.Powe rShell.Admin", out snapEx); >>> >>> I run my VS projects on a x64 Windows with PS installed >>> Our Exchange server is on a different machine. >>> >>> What could be wrong with my setup ? >>> >>> >> Perhaps this helps: >> http://blogs.msdn.com/mstehle/archiv...l-snap-in.aspx >> >> Are you compiling your app for 64-bit? >> >> Marco >> >> -- >> Microsoft MVP - Windows PowerShell >> http://www.microsoft.com/mvp >> >> PowerGadgets MVP >> http://www.powergadgets.com/mvp >> >> Blog: >> http://marcoshaw.blogspot.com >> |
|
|
|
#8 |
|
Guest
Posts: n/a
|
Re: No Windows PowerShell Snap-ins are available for version 1
Hi Kelly
You're right.. but If I run the same piece of code from a console app there no problem. How can I tell if I load a snapp-in on a 32bit version i a ASP.NET app. ? "kelly goff" wrote: > The only other thing I can think of is that you are trying to load a 64 > bit add-in into a 32 bit version of powershell. I remember making that > mistake. > > Kelly > subtile wrote: > > I get the exception message "No Windows PowerShell Snap-ins are available for > > version 1" whenever running following lines of code: > > > > RunspaceConfiguration rc = RunspaceConfiguration.Create(); > > PSSnapInException snapEx = null; > > PSSnapInInfo info = > > rc.AddPSSnapIn("Microsoft.Exchange.Management.Powe rShell.Admin", out snapEx); > > <-- this line fails > > > > I run my VS projects on a x64 Windows with PS installed > > Our Exchange server is on a different machine. > > > > What could be wrong with my setup ? > > > > > |
|
|
|
#9 |
|
Guest
Posts: n/a
|
Re: No Windows PowerShell Snap-ins are available for version 1
I just deployed my asp.net project to a IIS with 32bit apppools disabled.
Everything worked fine!!! So the problem is that my x64 Visual Studio doesnt know how to run as x64 powershell ![]() "kelly goff" wrote: > The only other thing I can think of is that you are trying to load a 64 > bit add-in into a 32 bit version of powershell. I remember making that > mistake. > > Kelly > subtile wrote: > > I get the exception message "No Windows PowerShell Snap-ins are available for > > version 1" whenever running following lines of code: > > > > RunspaceConfiguration rc = RunspaceConfiguration.Create(); > > PSSnapInException snapEx = null; > > PSSnapInInfo info = > > rc.AddPSSnapIn("Microsoft.Exchange.Management.Powe rShell.Admin", out snapEx); > > <-- this line fails > > > > I run my VS projects on a x64 Windows with PS installed > > Our Exchange server is on a different machine. > > > > What could be wrong with my setup ? > > > > > |
|
|
|
#10 |
|
Guest
Posts: n/a
|
Re: No Windows PowerShell Snap-ins are available for version 1
If I am remembering correctly I had to pull the dll's out of the gac and
directly reference those dll's. Kelly subtile wrote: > I just deployed my asp.net project to a IIS with 32bit apppools disabled. > Everything worked fine!!! So the problem is that my x64 Visual Studio doesnt > know how to run as x64 powershell ![]() > > "kelly goff" wrote: > >> The only other thing I can think of is that you are trying to load a 64 >> bit add-in into a 32 bit version of powershell. I remember making that >> mistake. >> >> Kelly >> subtile wrote: >>> I get the exception message "No Windows PowerShell Snap-ins are available for >>> version 1" whenever running following lines of code: >>> >>> RunspaceConfiguration rc = RunspaceConfiguration.Create(); >>> PSSnapInException snapEx = null; >>> PSSnapInInfo info = >>> rc.AddPSSnapIn("Microsoft.Exchange.Management.Powe rShell.Admin", out snapEx); >>> <-- this line fails >>> >>> I run my VS projects on a x64 Windows with PS installed >>> Our Exchange server is on a different machine. >>> >>> What could be wrong with my setup ? >>> >>> |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|