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
Related
Quick question
I am doing a Plural Sight tutorial on WCF and they are using the WCF Service Library (as opposed to application.)
When I go to Add new project there is no WCF Service Library. Not under any of the .NET versions.
I am using Visual Studio 2013 for Web Express.
Any one know how I can get it?
Thanks
You can find it under Templates WCF.
( Go to New Project->Installed-->Templates-->WCF)
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.
It gives errors when I refer Microsoft.SharePoint.Administration; Microsoft.Office.Server dlls in a WCF service application. It does not identified the added assemblies. How to resolve this issue?
In which .NET Framework Version is your WCF service written? SharePoint 2010 is implemented using .NET FX 3.5, so you can only reference SharePoint Assemblies if your targeting the same FX Version.
Your WCF service also has to run on a SharePoint box, it's not possible to reference a SharePoint related assembly on a non SharePoint machine.
How does your reference looks like? You've to reference the Assemblies from the ISAPI folder within SharePoint Root (which should be Program Files\Common files\Microsoft Shared\Web Server Extensions\14\ISAPI\ by default)
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.
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.