Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6318531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:38:54+00:00 2026-05-24T15:38:54+00:00

I’ve developed a windows service developed in Visual Studio 2010 which performs Exchange 2007

  • 0

I’ve developed a windows service developed in Visual Studio 2010 which performs Exchange 2007 administrative tasks and I’m moving it from a 32-bit development server to a 64-bit production server. The service accepts arguments and then invokes PowerShell to execute commands in the Exchange 2007 snap in.

It works correctly in the development environment both in the debugger and in the windows service itself after it’s been installed; unfortunately, when I copied the project to the new Windows 2008 R2 64-bit server and built it I can only get the service to work in the VS2010 debugger. When installed as a windows service on the 64-bit server the service consistently fails with a message from the PowerShell component of the code which reads:

“No snap-ins have been registered for Windows PowerShell version 2”

The C# code fails on a specific line when the PowerShell instance is invoked:

RunspaceConfiguration rc;
PSSnapInInfo info = rc.AddPSSSnapIn(“Microsoft.Exchange.Management.PowerShell.Admin”, out warning);

As I mentioned, the code will work so long as I run it in the VS2010 debugger.

To try and fix this I’ve tried Googling the error and come up with many other people having this problem but no-one having a definitive answer to it. Following some of the leads left in some of these postings I’ve tried these things:

  • I have removed and re-installed the Exchange 2007 management tools
  • I have done a “Get-PSSnapin” from the Exchange Management Shell PowerShell prompt (and got back a listing for the Exchange admin tools that looks like this – the version says that it’s for PSVersion 1.0 rather than 2.0 but, since things work in my VS2010 debugger, I thought that the psversion was not what was causing the problem):
    o Name: Microsoft.Exchange.Management.PowerShell.Admin
    o PSVersion: 1.0
    o Description: Admin Tasks for the Exchange Server
  • I’ve tried registering the snap-in using INSTALLUTIL under the C:\Windows\Microsoft.NET\Framework64\v2.0.50727 as
    o Installutil c:\program files\microsoft\exchange server\bin\microsoft.exchange.management.dll

But I’m still stuck running the code in the debugger until I can get it working as a service.

From the tenor of the messages I’ve read about this this is a problem that a lot of people have had but no-one’s been able to completely fix as yet. Can anyone offer any help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T15:38:55+00:00Added an answer on May 24, 2026 at 3:38 pm

    I had a very similar problem when managing Exchange 2007 using a service developed in C#

    Make sure not only that your code is compiled to target the x86 platform but also make sure that you have a specific reference to the C:\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0\System.Management.Automation.dll file in the class which invokes the PowerShell runspace.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a windows service. This service runs another process I've developed through
I need to delete a temporary file from my C++ windows application (developed in
I have a Windows Service application (developed in C++) running under Local System account.
i want to develope a windows service which sends a push notification to iphone
I've developed on Windows and .NET for my whole career so forgive my ignorance
We have various php projects developed on windows (xampp) that need to be deployed
I have a site developed in ASP.NET and hosted on a windows server using
I have tested all my systems developed in Delphi (in Windows XP) on Wine
I installed the Async CTP Refresh on my Windows 7 machine with VS2010 Pro(which
I develop a Windows Service that will run under SYSTEM user. So I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.