.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

Can a 64 bit app host a service which references 32 bit libraries?

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :WCF

I have a 64 bit application which needs to remain 64 bit - address space, performance etc. The target platform is 64 bit Windows. This 64 bit app will be calling into some legacy 32 bit libraries via WCF. We are not going to rewrite the legacy libraries for 64 bit, so the idea is we will write services where the service code itself calls into the legacy libs, and the 64 bit app uses those services.

Architecturally, the only way I can see to do this is that the host will have to be in a separate process, which will be a 32 bit process since it will be referencing the legacy libraries.

The out of proc model is ok, but I like the idea of the 64 bit process being able to self host.  Of course I don't want to introduce any 32 bit dependencies.

Are there any patterns or tools available that might allow me to accomplish this?




View Complete Post

More Related Resource Links

Cannot register a service type without attaching the source assembly to the host process

I'm wondering if there is any way I can register a service type without attaching the source assembly to the host process. When I register the service type, the source assembly (which has the type) cannot be written.   I appreciate your attention.. 

SP2010- Creating an Index server which will host all the Service applications

Guys, Current Environment : 1 Sql server 2008 R2 and 1 SharePoint 2010 Server OS : windows server 2008 all 64 bit (goes without saynig) For better performance i want to seperate out Service application ( expecially Search Service application) to another windows server while keeping the existing one as a WFE hosting CA as well. From the little documentation i found i am creating an Index server(with out CA on it) 2 questions here : 1. Is this the best way to optimize my farm? 2. Is there any online documentation or any knd of link that woudl describe how to set up the index server. thanks in advance. Sameer  

The Sanboxed code execution request was refused because the sandboxed code host service was too busy

I am getting following error when I am running my sandbx solution ona virtual machine. "The Sanboxed code execution request was refused because the sandboxed code host service was too busy to handle the request" I verified  in central admin that my  Usercode service is already running. I also tried to run below script using powershell. $acl = Get-Acl HKLM:\System\CurrentControlSet\Control\ComputerName $person = [System.Security.Principal.NTAccount]"Users" $access = [System.Security.AccessControl.RegistryRights]::FullControl $inheritance = [System.Security.AccessControl.InheritanceFlags]"ContainerInherit, ObjectInherit" $propagation = [System.Security.AccessControl.PropagationFlags]::None $type = [System.Security.AccessControl.AccessControlType]::Allow $rule = New-Object System.Security.AccessControl.RegistryAccessRule($person, $access, $inheritance, $propagation, $type) $acl.AddAccessRule($rule) Set-Acl HKLM:\System\CurrentControlSet\Control\ComputerName $acl Any pointer would be highly appreciated!!  

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

No protocol binding matches the given address ''.

I am getting this error whenever I tried to open the svc file in the browser using the Visual Studio 2008. The puzzling part is the localhost address being interpreted as ' '. What are should I look for in order to troubleshoot this problem?Exception Details: System.InvalidOperationException: No protocol binding matches the given address ''. Protocol bindings are configured at the Site level in IIS or WAS configuration. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [InvalidOperationException: No protocol binding matches the given address ''. Protocol bindings are configured at the Site level in IIS or WAS configuration.][ServiceActivationException: No protocol binding matches the given address ''. Protocol bindings are configured at the Site level in IIS or WAS configuration.] System.ServiceModel.AsyncResult.End(IAsyncResult result) +4413209

How to use single windows service to host multiple WCF Services instances (Each instance of WCF is i

How to use single windows service to host multiple WCF Services. I have a mutiple instance of same WCF service in different folder, each instance has unique service name and port. WCFService has reference to Reg-Free COM Reference, i have Native.WCFService.manifest in each folder. Ex: WCFService1 is in "C:\WCFService01\WCFService.dll, Native.OCWCFService.manifest, OCWCFService.dll.config WCFService2 is in "C:\WCFService02\WCFService.dll, Native.OCWCFService.manifest, OCWCFService.dll.config Now i need host above services from single Windows Service. I am trying to create AppDomain for each above WCFService Instance from Windows Service and then host. Its working if i register COM dll in the server using regsvr32, but when i un register COM dll, i am getting unable to load COM component .... This looks like AppDomain is not loading COM DLL and Manifest files. Its looks strange but we need it in this way because we have production and test environment in the same server. Everything works fine if create a seperate Windows Service for each WCFService Instance, but my manager wants single Windows Service :). Any help whould be really appreciated.  ravi kumar reddy

host and consume wcf rest service in web project in single solution

I have  create a solution which have multiple class library project and a web application Like Web(UI),BL,DAL etc. I have also add a WCF REST starter kit Collection project in the same Solution.WCF Rest API is working fine if I host it on IIS but i want to consume this in my web project without using IIS. Is this possible? if yes then what will be the URI  for my WCF Rest services? Add service reference is also not working because WSDL is disable in rest.

Bi directional service calls with "n to 1" and "1 to n" servers has host

Hey there.   I've been tasked to find out how to do the following for our company:   We have our ERP (MS Navision) exposed to the net to take orders. So far so good. Now management wants me to integrate our system with 3 other ERPs and 100s to 1000s of clients all having their own networks and sql servers which are completely outside of our "control".   Here's where I have a big problem.  In the "normal" way of things, each of the ERP, installed on each of our 100[0]s of big clients would be calling my services to process orders and whatnot.   However, the first step of our system is to do a search and display inventory.  We want to have complete control has this system is a new flagship product and we can't let other companies duplicate it.  The big sticking points for our clients is that they want us to show THEIR inventory on OUR site.  This happens after a login, but before their servers ever call mine. That means that I have to query their webservices first... 100[0]s of different servers (1 per client allowed on the system).   Now if we had only 2-5 clients I'd know what to do, but how can I have a scalable setup with 100s and possibly 5000+ different clients? 

Suspend / Resume Instances within Workflow Service Host (in Windows Service)

We are hosting WF 4 worklfow instances within a Windows Service that uses the Workflow Service host container.   On the Windows Service OnStart we start the workflow service host (w/ multiple WCF endpoints such as start workflow instance, cancel workflow instance, poll workflow instance status, etc.) and these endpoints create or work on one or more long running workflow instances.     My question is, if a user attempts to stop the Windows Service while workflow instance(s) are running, what is the best way to manage this scenario.   Our inclination is to persist these workflows (using sql persistence) and then on the next start of the Windows Service, resume these workflow instances and allow them to continue to completion.    In OnStart, we have a handle to the Workflow Service host.    How can we iterate through all the active workflow instances in OnStop and then in OnStart, resume these after the workflow service host is opened and running?   Are there are any methods of managing this scenario?    Thanks

Unable to connect to local host service when a splash screen is show before start the services

Hi all:

I want to show a splash screen before start the local host services, the host can be open without error, however the client (Form1) is not able to connect to the service. Without the splash screen, every thing work fine. Any idea why ?

Here is the code.

Imports System.ServiceModel

<ServiceContract()> _
Public Interface IHelloWorldService
   <OperationContract()> _
   Function SayHello(ByVal name As String) As String
End Interface

Public Class HelloWorldService
   Implements IHelloWorldService

   Public Function SayHello(ByVal name As String) As String Implements IHelloWorldService.SayHello
      Return String.Format("Hello, {0}", name)
   End Function
End Class

Module Module1
   Private host As ServiceHost
   Private frmSplash As Form

   Sub Main()
      AddHandler AppDomain.CurrentDomain.AssemblyLoad, Addres

Using WCF WF Service in a Web Project without creating a host



I have created a WCF Workflow Service Application which contains multiple WCF Workflow Services in it. And some of these services contain multiple Send-Receive activities in a flowchart/sequence.

In the same solution, I have created a Asp.Net Web project in which I have to use these WCF WF Services. In this Web Project, I added the Service Reference of the all the WCF Workflow Services that I have, but however when I try to invoke these WF services, it gives errors.

I went thru various samples and in every sample there is ServiceHost created which makes available an endpoint, and consuming the service using this endpoint makes everything working. Now my questions are:

1. Is there no way to make WF services work properly in a Web project without creating a WF Service Host??

2. I am also having problems in persisting a workflow. As I mentioned earlier, I have some services which have multiple send-receive activities in it so I need to persist the workflow instance until the complete workflow is complete. Again, I was able to do this using the Service Host, but how to do it without using a service host?


The problem is I have to host web application (and hence also the WF Services) on my Web hosting (GoDaddy) and on Azure Cloud and in both the cases I cannot create a separate Workflow Console Application that will work

WCF hosted in a Windows Service, how to make calls to the WCF service from within the service host


I have a Windows service that I converted to a WCF service that I want to host in a Windows Service.  I need to do some specific tasks in the OnStart() and OnStop() just like I did when it was just a Windows service.  My original Windows service OnStart() is where I create the main worker thread.  So how do I make a call into my WCF service from within the hosting service? For example in the hosting service's OnStart() I do a host.Open() then I need to call a method in my WCF service but how?



ServiceHost host =

Can a WindowsCE device host a WCF service? Also WCF over USB?


We are developing a embedded device based on WindowsCE (7.0 when available) and I was wondering if it was possible to host a WCF service in the device. The device will be acquiring data that is consumed by the PC.

I was also wondering if it was possible to use WCF over a USB connection?

Thank you

Sharing Extensions Between WorkflowService Host and Service Host


Hello all,

I have a website with 2 services running: 1 with a workflow service (.xamlx) and the other just a regular WCF service.  I'm storing data in an extension in the WCF host that I want to retrieve later from the Workflow host when a particular CodeActivity executes.  However, I can't seem to find the proper way of sharing Extensions outside of using static variables (ew).  Does anyone have any guidance for this scenario?



Consume WCF Service Host from client thru WAN.


i try to host a wcf service thru console by giving the external ip in uri for client consume it as endpoint, but i had this error :

Could not connect to http://115.133.x.x:8000/GetMsg/GetMsgC. TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 115.133.x.x:8000.


static void Main(string[] args)
            using (host = new ServiceHost(typeof(GetMsgC), new Uri("http://115.133.x.x:8000/GetMsg")))
                host.AddServiceEndpoint(typeof(IGetMsg), new BasicHttpBinding(), "GetMsgC");


Creating a service host in a console app works fine in Debud but not opening exe


I have a Simple console app that starts to host my  wcf service and it works great when I'm debugging but when i run the exe it doesnt start the WCFSvcHost from my tray like i do when i dubug. Any ideas..

This is my host:

class Host
    static void Main(string[] args)
      ServiceHost host = new ServiceHost(typeof(EvalService));


      Console.WriteLine("Eval Service is up and running with the following endpoints:\n");
      foreach (ServiceEndpoint se in host.Description.Endpoints)


WCF service host error



Dear All,


I am getting an error which says "WCF service host cannot find any service metadata.This may cause the client application to run improperly...."

This happens when I test the WCF service using the built-in host which also displays the Test client in VS 2008.

My App.Config file is as given below:


<?xml version="1.0" encoding="utf-8" ?>



<compilation debug="true" />


<!-- When deploying the service library project, the content of the config file must be added to the host's

app.config file. System.Configuration does not support config files for libraries. -->



<service name="MyWCFServices.RealNorthWindService.

ProductService" behaviorConfiguration="MyWCFServices.RealNorthWindService.ProductServiceBehavior">



<add baseAddress = "http://localhost:8731/Design_Time_Addresses/MyWCFServices/RealNorthWindService/

ProductService/" />



<!-- Service Endpoints -->

<!-- Unless fully qualified, address

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