Showing posts with label WCF. Show all posts
Showing posts with label WCF. Show all posts

Wednesday, 23 July 2014

Cross-thread operation not valid: Control 'textBox1' accessed from a thread other than the thread it was created on.

Set ConcurrencyMode to Reentrant as shown below above the class implemented the Service contract interface.
[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)]

Set the property of the Form/Page class in the client application as below.
[CallbackBehavior(UseSynchronizationContext = false)]

Set the text box property CheckForIllegalCrossThreadCalls to false like below in the method describing duplext contract.
TextBox.CheckForIllegalCrossThreadCalls = false;

Thursday, 10 July 2014

HTTP could not register URL http://+:8000/HelloWCF/. Your process does not have access rights to this namespace.

Most people are no longer going to be running with Administrator privileges by default like they were doing on earlier platforms. This impacts your ability to run HTTP web services because listening at a particular HTTP address is a restricted operation. By default, every HTTP path is reserved for use by the system administrator.

Your services will fail to start with an AddressAccessDeniedException if you aren't running the service from an elevated account. The account under which the Visual Studio and the debugger runs does not have the privilege (though the user account under which VS is runnig may be a part of Administrators group), and hence the error occurs. The plus sign in the URL just means that there's a wildcard being applied to the hostname.

Run application administration mode.

Right click on vs and run as administrator.

Wednesday, 17 July 2013

Handler "svc-Integrated" has a bad module "ManagedPipelineHandler" in its module list

If you  will get this error while running your wcf application then you didn't install the prerequistes for ASP.NET 4.

To install the prerequistes go to
Start --> All Programs --> Microsoft Visual Studio 2008 --> Visual Studio Tools --> Open Visual Studio Command Prompt.
Run Visual Studio 2008 Command Prompt as “Administrator”.

Type the following:
     aspnet_regiis.exe -i

Run your application.

Saturday, 1 June 2013

WCF Service Host cannot find any service metadata. This may cause the client application to run improperly. Please check if metadata is enabled. Do you want to exit?

In my case I got this error because the service name field did not actually match the namespace of the class actually implementing the operation contract in app.config file.

<services>
<service name="WCFHelloWorld.MySyncService" behaviorConfiguration="WCFHelloWorld.Service1Behavior">
.
.
.
</services>

Tuesday, 14 May 2013

Security settings for this service require Windows Authentication but it is not enabled for the IIS application that hosts this service

I am getting this error while I am trying to run my WCF service using HTTPS.
Then I have done the following to resolve my issue.

1 - The Contract Operation method has Operation Behaviour "
      [OperationBehavior(Impersonation=ImpersonationOption.Required)]"

2 - Change the following in the web.config file.
      <system.web>
            ....
            <authentication mode="Windows" />
            .....
     </system.web>

3 - You can also verify that Anonymous Authentication is disabled like in the image below in the IIS.
      Open IIS. Select your application from left side. From right side select "Authentication".
     
     In my case "Windows Authentication" is disabled. Click on the status to enabled.

    Run your application.


Thursday, 18 April 2013

The type 'System.Data.Objects.ObjectContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'


You receive this error because you have not used references in your project to use System.Data.Entity namespaces.

To including the Entity Framework in your application, you must have a reference to the System.Data.Entity namespace so that you have access to the core functionality of the Entity Framework. These classes enable you to query, insert, update, and delete data.

1. In Solution Explorer, right-click References and select Add Reference from the right-click menu.
2. The Reference Manager dialog box is displayed.
3. Select System.Data.Entity from the list in the dialog box and Click OK.