.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 consuming 32bit WCF service which references a native Dll in a 64 bit OS(Windows Server 2008

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :.NET Framework
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

View Complete Post

More Related Resource Links

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 :

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 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 Impersonation on Windows 2008 Server x64

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,

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

Help deploying Windows Service to 64bit Server usinf Visual Studio 2008 Setup Project?

I have a Windows Service I created a while back for our Win2003/2008 32bit Servers, written in Visual Studio 2008, deployed via a VS2k8 Setup Project.  Everything works great, installs fine, and runs as it should.  There is no platform dependent code, it's all straight-up .Net Framework stuff, so we thought it should deploy to a Win2008 64bit Server just fine.  But this seems not to be the case.

When I try to install the Service as is on the 64bit machine, the service and associated DLL's are installed to the "C:\Windows\SysWOW64" folder, but when you right click the Service itself and look at the properties, it is trying to find the .exe file in the "C:\Windows\System32" folder. This difference prevents the service from running, obviously.

If I change the Setup Project settings, set the Target Platform to "x64" and change in the File System screen to use the "System (64-bit) Folder" placing the files in there and re-run the setup.exe on the server.... now the files are correctly installed to the "C:\Windows\System32" folder, but the Service itself is not 'installed', that is it *does not* show up in the Services Manager.

Just for the giggles of it I tried to manually install the service using 'installutil.exe' in the .Net Fra

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.

Messenger service is not in Windows 2008 but Sql Server 2008 is asking for it to run Database Mail


so how do you make Database Mail work in SQL Server 2008 without messenger service

Pat M


PatM Reno

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

Can we install 32bit SQL Server 2008 R2 on a Windows 2008 R2 Server ?



We are going to test SQL Server 2008 R2 and get it installed on a Windows 2008 R2 Testing Server.  However, we are not able to access the database engine via a 32 Bit SQL Server 2005 Management Studio installed on Windows XP workstation.

We just guess that SQL Server 2008 R2 database must be installed as 64 Bit and attempt to remove / reinstall a 32 Bit version.  However, it seems that we don't have an option to choose whether 32 or 64 bit of SQL Server 2008 R2 will be installed.

Is our understanding correct ?   Your advice is sought.

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.



Web Service 2.0 migrated to Windows server 2008

I developed a web service using 2.0 and it was working fine and We recently moved it to Windows server 2008.
I could see that all the System records are being created as expected but not the log file and result files.
We write these files in a shared folder in a different server(also, we prefer this to happen across domain too.). 
I made sure we use specific application pool and set it to use Integrated mode.
What could be wrong ?

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?

Cant move system databases of SQL Server 2008 (Clustered) running in Windows 2008 with Service SID e



I was trying to move system databases of SQL Server 2008 on clustered emvironment running on Windows 2008.

I remember while doing the cluster installation somewhere it gave me a recomended option of using Service SID. I think that is the culprit here. Because if you see the "Security" of the DATA folder containing all the MDF and LDF (by default location) you will find a Group named "MSSQLSERVER" is having full access to that directory.

While moving the system databases you need that account (MSSQLSERVER) given access to the parent directory containing the MDF and the LDFs, But unfortunately you cannot add that account manually. Even I tried XCOPY to make sure that while copying the ACLs gets transferred properly to the destination, even that failed.

I think it does provide a solid Security but at the expense of Maintenance, which I cant agree.

Also I forgot to tell you that this Sevice SID option is available if you are using Windows Vista / Windows 2008 or above,

Does anyone has any experience of moving the system databases with Service SID enabled in a cluster environment.

As a testing just try to copy/xcopy/robocopy any folder having MSSQLSERVER group in the ACL and see what happens .. If you are lucky like me then you will get ACCESS DENIED error.

Have anyone faced the same error? I h

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

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