Runspaces.PSSnapInException: Cannot load Windows PowerShell snap-in ...PowerShell.E2010?
Hi,
I have a C# program which works for Exchange 2010. It does:
1) Create RunspaceConfiguration;
2) Add SnapIn E2010;
3) Create run space, pipeline....
It works fine on Exchange 2010 + Windows 2008 without any problems.
Now, I put it on Exchange 2013 + Windows 2012, for some reasons, it fails at adding snap in (step 2), the exception is:
System.Management.Automation.Runspaces.PSSnapInException: Cannot load Windows PowerShell snap-in Microsoft.Exchange.Management.PowerShell.E2010 because of the following error: Could not load file or assembly 'file:///C:\Program Files\Microsoft\Exchange Server\V15\bin\Microsoft.Exchange.PowerShell.Configuration.dll'
or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadMshSnapinAssembly(PSSnapInInfo mshsnapinInfo)
at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadCustomPSSnapIn(PSSnapInInfo mshsnapinInfo)
at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadPSSnapIn(PSSnapInInfo mshsnapinInfo)
at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadPSSnapIn(PSSnapInInfo mshsnapinInfo, PSSnapInException& warning)
at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.DoAddPSSnapIn(String name, PSSnapInException& warning)
at ................
Anyone knows a solution? Could it be because of Windows 2012?
Thanks
April 11th, 2013 11:25am
Hi,
The reason is Windows Server 2008 has Powershell 2.0 and 2012 has 3.0.
You can visit this help to update the files required for ver 3.0:
http://viziblr.com/news/2012/5/16/the-easy-way-to-run-powershell-20-using-net-framework-40.htmlRegards from ExchangeOnline |
Windows Administrator's Area
Free Windows Admin Tool Kit Click here and download it now
April 11th, 2013 12:29pm
Hi,
The reason is Windows Server 2008 has Powershell 2.0 and 2012 has 3.0.
You can visit this help to update the files required for ver 3.0:
http://viziblr.com/news/2012/5/16/the-easy-way-to-run-powershell-20-using-net-framework-40.htmlRegards from ExchangeOnline |
Windows Administrator's Area
April 11th, 2013 7:24pm
Hi temp12000,
Any updates?Frank Wang
TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
April 12th, 2013 2:25am
thanks for the help.
the reason for the error is: the C# program is targeted for .Net 2.0, while EMS2013 is built by .Net 4.0, which is consistent with the error message. after I compile the c# by .Net 4.0, it works fine.
However, one question is:
Does this mean we will have to use .Net 4 if we want to use EMS2013? Any work around to use .Net 2?
thanks
April 12th, 2013 11:11am
Does this mean we will have to use .Net 4 if we want to use EMS2013? Any work around to use .Net 2?
Hi temp12000,
As the Exchange Server Supportability Matrix lists, the version of the Microsoft .NET Framework that can be used together with Exchange 2013 is .NET Framework 4.5.
http://technet.microsoft.com/en-us/library/ff728623(v=exchg.141).aspxFrank Wang
TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
April 16th, 2013 1:30am
Does this mean we will have to use .Net 4 if we want to use EMS2013? Any work around to use .Net 2?
Hi temp12000,
As the Exchange Server Supportability Matrix lists, the version of the Microsoft .NET Framework that can be used together with Exchange 2013 is .NET Framework 4.5.
http://technet.microsoft.com/en-us/library/ff728623(v=exchg.141).aspxFrank Wang
TechNet Community Support
April 16th, 2013 8:24am