.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Problem with Impersonation on Windows 2008 Server x64

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :.NET Framework
Existing .net application that runs w/out issue on 2003 x32 and x64 Terminal Services is failing on 2008 x64 with 'Cannot Create ActiveX Component' error.

Application is compiled as x86.

The functionality is to access an email within a PST file. Utilizes Redemption 4.5 COM object for PST access.

Pseudo code:

Impersonate Domain Admin
'create the COM object (.net interop is installed
RDOSession = CType(CreateObject("Redemption.RDOSession"), Redemption.RDOSession) 
'logon to the mailbox of impersonated user
RDOSession.LogonExchangeMailbox("UserID@domain.com", "mail.mydomain.com")
'add the requested PST
RDOPST = RDOSession.Stores.AddPSTStore(PSTFullName)
Canx impersonation

If I do not invoke the impersonation method, but 'Run As Administrator' or a user with sufficient rights to the PST, the code works on 2008.
If the impersonation method is invoked, the CreateObject fails with 'Cannote Create ActiveX Component' (no inner message).  Even if I 'Run As Administrator' with the impersonation invoked, it still fails with the same error.

If I pass the username/password for the current user (which also has domain admin rights) to the Impersonation method- it works. Any other domain admin account other than the current user,

View Complete Post

More Related Resource Links

Sharepoint 2003 + Windows Terminal Server 2008 + Office 2007 problem?

Hi, We have a customer where some users runs Windows Terminal Server 2008 with Office 2007. They open documents from a Sharepoint 2003 site. When they open an excel sheet they get a button in the document which says "Server workbook: Click edit workbook to edit this workbook" and there is a button: "edit workbook" The users clicks "edit workbook" but get an error message saying there is no connection to the server.  They are able to edit the document, but not save it back to the sharepoint site. Most other users work on their local computer with Office 2003. Here, everything works fine and there are no button/message stating its a server workbook.   Is this caused due to some compatability issues between Sharepoint 2003 and Office 2007?   Best regards, Thomas Hansen ErgoGroup AS

Problem consuming 32bit WCF service which references a native Dll in a 64 bit OS(Windows Server 2008

I have some 32bit Dlls which i want to use it in 64bit OS as i do not have a source code of this to recompile it for 64 bit OS. I have created a x86(32 Bit) WCF service which calls these Dlls and hosted it as a Windows Service on a x64(64 Bit) machine using Windows Server 2008. I have created one more x64 client which calls a function in the WCF which in turn calls a function from the 32 bit native Dll. Whenever i try calling this WCF from the client I get an error as given below.Can anybody please guide as to where I am going wrong and what is needed to solve this issue. Thanks in advance for any help.******The Error Message********************System.BadImageFormatException: Could not load file or assembly 'TestWCFWrapper, Version=, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.File name: 'TestWCFWrapper, Version=, Culture=neutral, PublicKeyToken=null'   at TestWrapperWCFClient.Form2.button1_Click(Object sender, EventArgs e)   at System.Windows.Forms.Control.OnClick(EventArgs e)   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)   at System.Windows.Forms.Control.WndProc(Message& m)   at System.Windows.Forms

Problem configuring SSRS 2008 with sharepoint 2007 on Windows server 2008

Hi All - I am unable to integrate SSRS 2008 with sharepoint 2007. I am new to this part please correct em if am wrong. I have 2 servers one for SQL and one for MOSS MOSS server. Windows server 2008 MOSS 2007 .Net 2008 with basic sql 2005 which comes default WSP builder Everything is working fine SQL server: Windows Server 2008 SQl server 2008 and configured SSRS BIDS. When I am trying to install SSRS plugin for MOSS it is not accepting on both the machines. Please help me if am missing something here. I configured sucessfully on one server but havent done on multi server environment. please help me.   Thanks Saritha    saritha k

OPENROWSET Problem with FoxPro and SQL Server 2008 on Windows 2008 R2

I currently have stored procedures running in SQL2K on a Win2K3R2 that gather data from our over 1500 free-table Foxpro databases. The stored procedures use MSDASQL and the VFP ODBC driver. This has been working well since at least 2005. I am now in a situation where I need to port the SQL databases over to SQL2K8 on Win2K8R2. I have a 32-bit SQL instance running so that I can still use the Foxpro drivers. I have installed the VFPODBC and the VFP OLE DB drivers and configured the Providers in the SQL instance to "Allow Inprocess" and not "Disallow adhoc access", and all those wonderful things, I have it to the point where when logged on locally to the SQL2K8 I can run either one of these statements below successfully:  SELECT number FROM OPENROWSET('MSDASQL', 'Driver=Microsoft Visual FoxPro Driver;SourceDB=\\RMFS\FOXPRO\CLIENT1\CLIENTDB;SourceType=DBF', 'SELECT number FROM ARCUSTMR') or  SELECT number FROM OPENROWSET('VFPOLEDB', '\\RMFS\FOXPRO\CLIENT1\CLIENTDB'; ' '; ' ', 'SELECT number FROM ARCUSTMR') However, if I try to run the same query from my PC (and a Domain Admin) I get the following errors respectively: OLE DB provider "MSDASQL" for linked server "(null)" returned message "[Microsoft][ODBC Visual FoxPro Driver]File 'arcustmr.dbf' does not exist.". Msg 7350, Level 16, State 2, Line 1 Cannot

problem with connecting to local SQL Server 2008 default instance using windows authentication




I have a user getting some problem with connecting to local SQL Server 2008 default instance using windows authentication with a user which has sysadmin role and is owner of each existing database:

2010-09-28 15:40:35.04 Logon       Error: 18456, Severity: 14, State: 11.


2010-09-28 15:40:35.04 Logon       Login failed for user 'IIS APPPOOL\RoomViewSEWebClient'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors. [CLIENT:]



This us

SQL 2008 SP1 slipstream problem on Windows Server 2008 x64


I have created a slipstreamed setup of SQL 2008 SP1 using instruction from this post http://blogs.msdn.com/petersad/archive/2009/02/25/sql-server-2008-creating-a-merged-slisptream-drop.aspx. It works fine on Vista box, but on Windows Server 2008 x64 box I get following error:

SQL Server Setup has encountered the following error:
The setting 'PCUSOURCE' specified is not recognized.
Error code 0x84B40003.

Problem with Windows 2008 Server 64 Bit



Please excuse me if this question have asked before.

I have a Server running a Windows Server 2008 64 Bit Operating system.In that i am running a windows service which is built using the Visual Studio 2008 under Frame work 3.5 Compiled using "Any CPU" as target platform.The windows service references a third party dll called MediaInfo.dll  (http://mediainfo.sourceforge.net/en/Download/Windows) .The 64 bit version of the mediainfo.dll is installed in that machine (It didn't allow me to install the 32 bit version, is the Windows Server 2008 not a X86-64 bit OS?).

I have a problem while the windows service tries to load the MeidaInfo.dll , it throws the exception

"An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) StackTrace= 
 at eMAMCarbonIngestService.IngestService.clsMediaInfo.MediaInfo_New()"

As seen from the log when i checked the mediaInfo class inside the windows service soluion i found that the exception is generated from the following line

        public static extern IntPtr MediaInfo_New(); //Here is the exception as per my log report.

I dont have any clue why this is happening since the Windows Service is Compiled using "Any CPU" it s

Word Automation through Windows service (Windows Server 2008) - Problem

I went through the thread in this link http://social.msdn.microsoft.com/Forums/en-US/netfx64bit/thread/65a355ce-49c1-47f1-8c12-d9cf5f23c53e (which is a very similar problem to mine), but couldnt solve my problem.
I seem to face a very related problem in word automation.
I have created a windows service which creates a sample word document (WORD 2007) and then converts it to a .doc file (WORD 2003 format) or a PDF file , based on requirement.  Let me post the sample code here :

Problem Installing SQL Server 2008 on Windows Server 2008 R2

I have a fresh install of Server 2008 R2.  I am attempting to install SQL Server 2008 (x64).  Both products downloaded in the last couple of days via MAPS.

On my first attempt at a SQL installation, a dialog box pops up warning of "compatibility issues".  I searched for a solution, and it was suggested to install SQL 2008 SP1, before re-running the main SQL setup, and then to apply SP1 again after SQL Server is installed.

So, I have installed SQL 2008 SP1 with no problems.  When I then ran the main SQL setup, it tells me that I need to install .NET 3.5.  So, I do this from Server Manager -> Add Features (.NET Features 3.5.1).  That installs fine.  I then re-run SQL setup, and it tells me that I need to apply .NET 3.5 SP1.

I then downloaded .NET 3.5 SP1 and when I try to apply it, it tells me that I must use the "Role Management Tool" to install .NET 3.5 SP1.

This is where my problem lies.  Is .NET 3.5.1 (as previously installed using the Role Manager) not the same as .NET 3.5 SP1?  If so, then why does the SQL Server installer tell me that I need to install it, when it is already installed?

I am well and truly stuck at this point.  Any help would be greatly appreciated.


SQL Server CE 3.5 SP1, VS 2008 on Windows 7 >> problem with creating datasource while developing Win




I have VS 2008 SP1, SQL Server CE3.5 SP1 installed in my Windows 7. 

I can connect and work with this database while I am developing windows form apps. But while creating mobile apps, I can not connect datasource. VS2008 says Failed to Generate datasource.


Please provide me the solution.



System.DirectoryServices.Protocols problem after upgrading to Windows Server 2008 R2

Hopefully this is the correct forum...

I have a block of code (VB.NET) for creating connection object for an OpenLDAP directory that looks something like

_OL = New LdapDirectoryIdentifier(DirectoryServer, PortNumber, True, False)
_Conn = New LdapConnection(_OL)
_Conn.SessionOptions.SaslMethod = "GSSAPI"
_Conn.SessionOptions.ProtocolVersion = 3
_Conn.SessionOptions.Sealing = True
_Conn.SessionOptions.SspiFlag = _Conn.SessionOptions.SspiFlag Or &H10 'auth-conf
_Conn.Timeout = New TimeSpan(0, 20, 0) ' 20 minutes
_Conn.AuthType = AuthType.Negotiate

On a Windows Server 2008 computer, this block of code gives me an ldapconnection object
On a Windows Server 2008 R2 computer, this block of code throws an exception when attempting to set the SaslMethod property (Also tried setting to "SIMPLE", "GSS-SPNEGO" or "EXTERNAL")

Not very helpfully, the error message states simply "An unknown authentication error occurred" Error code = 86 in System.DirectoryServices.Protocols.LdapSessionOptions.SetStringValueHelper(LdapOption option, String value)

I have matched as much as possible except for OS version. Same .NET Framework version, same processor, same Windows edition

Any suggestions?

Problem installing sql server express 2008 r2 in windows 7


I  have Server 2008 R2 Express with advanced features, when I install it a problem occurs:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Configuration.ConfigurationErrorsException: An error occurred creating the configuration section handler for userSettings/Microsoft.SqlServer.Configuration.LandingPage.Properties.Settings: Could not load file or assembly 'System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified. (C:\Users\Administrator Sheen\AppData\Local\Microsoft_Corporation\LandingPage.exe_StrongName_ryspccglaxmt4nhllj5z3thycltsvyyx\\user.config line 5) ---> System.IO.FileNotFoundException: Could not load file or assembly 'System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
File name: 'System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'
   at System.Configuration.TypeUtil.GetTypeWithReflectionPermission(IInternalConfigHost host, String typeString, Boolean throwOnError)
   at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.Init(RuntimeConfigura

Install SQL Server 2008 R2 Enterprise on Windows Server 2008 R2 64 bit problem.



I am installing SQL Server 2008 R2 Enterprise Edition 64bit to Windows Server 2008 R2 standard (64bit) on VMware Virtual Machine.

The OS version is 6.1.7601 Service Pack 1 Build 7601. Processor value shows "Interl(R) Xeon(R) CPU.

On the "Installation Rules" page, it shows the status of "64-bit processor" and "64-bit operating system" are  is "Not applicable". Click the link to see details, it shows "... rule is not applicable based on your system configuration or selections.".

I have checked the forums, and see someone asked the same question but the answer was to ignore it. The installation was completed, but I can see both 32bit and 64bit folders (\Program Files (x86) and \Program Files) have files installed on "Microsoft SQL Server". So, I don't know it is exatly 64bit or mixed with 32bit and 64bit.

Is there anything wrong on my server's setting?


Xiaogang Zheng

Xiaogang Zheng

Problem to create visual studio 2008 environment in windows server 2008


I am working on FTS (File Text Search) for file extension like .doc, docx, ppt, pptx, txt, pdf.

For developing FTS I used environment:

Development IDE:  Visual Studio 2008

Language: C#


Word Automation Issue in Windows Server 2008 Hosting



The problem I am posting here is that I was facing nearly 2 weeks around. Any body comes with this stuff please help.

Word Automation in sample ASP.NET(C#) application.

I am using Microsoft.Office.Inetrop.Word Assembly for automation. Here I am reading a XXX.dot template file and fill the contents with dynamic data.

When i am executing my code in localhost:someportnumber the automation is working fine and I could get expected result and when I am hosting in my inetmgr(Windows XP is my OS) it is also working fine.

But the problem is that when I am hosting in my production server(Windows Server 2008 Standard Edition) I am not able to perform automation and results in the following error.

Data: System.Collections.ListDictionaryInternal
Message: Word has encountered a problem.
Source: Microsoft Word

The code gets failed in the following line:

ApplicationClass wordApp = new Microsoft.Office.Interop.Word.ApplicationClass();

Document wordDoc = wordApp.Documents.Add(ref oTemplate, ref oFalse, ref oMissing, ref oMissing); // Error in this line

I cannot able to proceed further. Can anybody please help me in solving this issue?

Thank you.

With Regards,


No ASPNET User in Windows Server 2008?


I have been looking everywhere online regarding this, but have not found a clear answer.


I have an ASP.Net app running on Windows Server 2008, it's basically a reporting app using Crystal Reports. I have encountered a roadblock in regards to rendering some pages. When I run the app in Visual Studio(on the same 2008 machine) everything works perfectly. Yet when I publish it and run it live the reports will not display correctly, I get a message saying Failed to render page.


I looked this error up in the Crystal Reports website and the fixes they have there refer to giving the windows "aspnet" user full access rights to certain folders on the machine. I would be happy to do this, however there is no aspnet user in Windows Server 2008.


I installed the server and set its role to be Web Server. I also checked all the options regarding ASP.Net and IIS 6 compatibility. Yet there is no ASPNET username anywhere.


Did I set the server up wrong? or do I have to do something within ASP.Net to  create this user and then give it rights? 

Not working on Windows Server 2008




I had the CSS friendly adapters working great on our old server (windows server 2003 - 32bit) and now we have moved to a 64 bit environment and now I can not get the CSS friendly adapters to work.

We are using SharePoint 2007.

Is there another work thru for 64bit environment.

I notice windows server 2008 has a directory  C:\Windows\Microsoft.NET\Framework64 would I be using the browser file in this directory???

Please help!

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend