Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80040154 - wcf

I am running 32 bit Windows 7 Operation System which has IIS 7.5 installed.
In Visual Studio 2010, I open my solution having the web site project hosting WCF service. I have created an application in the IIS which points to the website project. The web site's bin folder has many assemblies which I need to refer. But those assemblies also have built using .NET 4 on the same computer.
I can browse the WCF service using both HTTP & HTTPS.
However, when i access the service from the test windows application (using the proxy class of the WCF contract), I get the error in question. Everything was working without problem earlier.
Anyone can help to fix the issue?. How to investigate this issue?

Error 0x80040154 means "Class Not Registered", which usually means you're depending on a COM component that hasn't been installed properly on the machine.
Is any of those Assemblies you reference a COM Interop Assembly? If so, find out what it uses and then install the appropriate COM component.

Related

Why would Development Server be finding a specific assembly in the GAC and IIS not?

I wrote a WCF Data Service, when running it on the Development Server it runs without any issues; however, once I deploy it to IIS it throws this error System.IO.FileNotFoundException.
The assembly it can not find is located in the GAC. Why would Development Server be finding a specific assembly and IIS not?
Enabling 32 bit applications on the Application Pool fixed the issue.
Just my guess, but I reckon the assembly is compiled as .net 4 and IIS is running under .net 3.5. Check here.

Could not load file or assembly 'EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies

I am getting this error in a WCF web service when the program attempts to use a method that employs the entity framework. However, we know that the server has the entity framework (correct version) installed because it is hosting another WCF web service and an intranet site that use it successfully.
I've tried to set copy local to true, however this simply compiles the Entity Framework dll into the debug/release folder of the project that uses it, not the web service project that gets deployed (the project that gets deployed contains a references the project that uses the entity framework).
Has anyone run into this kind of issue before and know a work-around either with or without using copy local?
The solution to this problem was to simply place the EntityFramework.dll and .xml file generated in the bin of the project that uses the Entity Framework and place that in the bin of the service project that was being deployed.
Check to see that the Application Pool for the IIS Site in question is set to use to correct .NET Framework version. In the case of EF 4.1, the Application Pool should be running on .NET Framework version 4 or higher.
To identify the version of .NET being used by the site, first find out the Application pool in use (in IIS, click on Basic Settings for the site), then identify the appropriate pool under the Application Pools node. The .NET Framework version should be listed.
Check whether bit versions are compatible between entity framework and server. If the server is 64 bit and you are using 32 bit entity framework dll you can get this error. Then change app pool setting to enable 32 bit applications.

No component for supporting the service was found error

We have setup a .net application developed with .net framework 4.0 using MVC framework and WCF service on a Windows 2003, 32-bit server containing IIS 6 successfully.
However, when the same application is set up on a Win 2008 R2, 64-bit server, we get the following error when the application is accessing the WCF service:
No component for supporting the service was found
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Castle.MicroKernel.ComponentNotFoundException: No component for supporting the service was found
We have set the flag for Enable 32-bit apps in "Application Pool" to true on the 64-bit server.
I don't think that this is related to WCF itself. ComponentNotFound is thrown by Windsor Castle IoC container and it means that something is wrong with its configuration. So when IoC tries to resolve the type of service it doesn't find related configuration.

wcf service on mobile 5.0

I have writed a primitive wcf (vs 2010) service and created proxy files by svcutil. Later I created a mobile project on vs2008 and added proxy files on project but this error occured.
Error 1 The type or namespace name 'ServiceContractAttribute' does not exist in the namespace 'System.ServiceModel' (are you missing an assembly reference?) C:\Users\Abb\Documents\Visual Studio 2008\Projects\WCF\MobileService\MobileClient\Sample.cs
the proxy files runs well on console application (vs 2008) but there is errors on mobile.
System.ServiceModel doesnot support ServiceContractAttribute.
For mobile applications you shouldn’t use SvcUtil to generate proxies since this does not generate code compatible with the subset of WCF functionality available to the .NET Compact Framework on mobile devices.
Instead, you should use NetCFSvcUtil.exe. See this link for more information: Using NetCFSvcUtil.exe to interact with ServiceContracts

Adding a WCF Service (<> WCF Service Reference) gives "Specified Cast is Invalid"

When adding a second WCF service to an existing WCF project, or adding a first WCF service to a project gives me a dialog box "Specified Cast Is Invalid". WCF files are added to the project except interface file. Web.Config isn't updated neither.
I think the problem started after updating VS.NET 2008 to VS.NET 2008 SP1.
You can always reinstall SP1 if you are uncertain about the installation. A successfully install SP1 should not cause this problem.
When we have had problems adding WCF references there have generally been on of the following problems:
Data contracts incorrectly specified, missing a tag [Datamember], [DataContract]...
Is your Interface marked as public?
If you are referencing a DLL with types from both the client and the server, is everything serializable and public. Are you using the same version of the dll on both sides?
Is your contract very large? You may need to increase the buffer sizes to get the information to build the proxy.