.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Service throttling behaviour app.config settings

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :WCF
How can I calculate the MaxConcurrentSessions, MaxConcurrentCalls and maxConcurrentInstances properties to set in the app.config ? I believe it should have some dependency on the # of CPU and the Max and Min worker threads based on which these parameters can be set.

Can you please guide me how can I provide them the number for these properties like we could calculate for ASP.NET.

View Complete Post

More Related Resource Links

How to config a SendActivity make it consumes a WCF service?

In a ASP.net web project, I have a WCF service and Workflow service and my workflow service want to use the wcf service, so I use the SendActivity to consume the WCF service. I do this in the follow step: 1.Using Add the service reference dialog add the WCF service reference to my project 2.Add a SendActivity to the workflow and config it like this: EndpointConfigurationName:BasicHttpBinding_ISimpleService ServiceContractName:SimpleServices.ISimpleService OperationName:DoWork and set correct parameters.   All this config value I am copyed from the config file. But when I run this project it's always throw exception says "ContractFilter mismatch at the EndpointDispatcher" . But if I directly call the WCF service in code, it's all ok. For demo, I create a very simply WCF service and Workflow service for testing how to config, so I paste all the code here: namespace WFCallService.Services { // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "ISimpleService" in both code and config file together. [ServiceContract] public interface ISimpleService { [OperationContract] void DoWork(string workName); } } namespace WFCallService.Services { // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Sim

Best Practice for Windows Service "Settings" (Configuration) with .Net (C#) ???

Background:   I'm developing a Windows service using C# and .Net 3.5.  The behavior of the service should be controlled by some settings.  The settings will vary per host-computer but will not vary per user (which should be understandable since the settings control behavior of a service.)  A GUI panel of sorts must be provided to set-up and modify the settings that control the service behavior.Secondly, there is a "locally installed application" that has its own settings and those settings also vary per host-computer so all users of that computer would experience the same settings.  (Seemingly analogous maybe to a connection string but not a connection string.)Note that I do NOT perceive any need for Click-once support, web support, and so forth.  Translation:  I think I need the simplest darn type of settings support, the old "dinosaur" level of requirements not much more sophisticated than INI files used to be. I've researched using the "built-in" settings that make use of the Settings Visual Designer in VS 2008 and  System.Configuration.ApplicationSettingsBase.  It seems that: 1.  Application Settings cannot be changed at runtime.  MSFT documentation indicates the software must be shut down and settings must be modified by patching the XML with a text editor (notepad et al.)  The framework specifically prohibits application settings from being

Not able to read Config File data in Windows Service

While I'm trying to read connection string which is in App.Config file I'm getting error like "Object reference not set to an instance of an object." string strconn = System.Configuration.ConfigurationManager.AppSettings["ConnectionString"].ToString(); For the windows service where I need to keep app.config file and how to integrate that config file with the windows service exe file. Thanks in advance.

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

Hosting service in IIS 5.1   Config is set to transport layer security. SSL is installed and configured on the virtual folder and BasicHTTP bidings are being used for connection. Authentication in web.config is set to Windows Authorization in web.config is set to Deny Users="?" and Allow Users="*"   When trying to connect to the service using IE, it throws exception that "Security settings for this service require Windows Authentication but it is not enabled for the IIS application that hosts this service. "   Can some one tell me what is missing?   Do I have to set anything in Web.Config?   I need to achieve following using Basic HTTP binding   Transport Layer security (SSL), Windows Domain Authentication, Use  user's Domain identity to impersonate the user in service   Please suggest the settings if any   Thanks

How to expose app.config or binding properties for web service

I have a project that consumes a web service, which is then bundled into a windows service and a deployment project.  Both the project consuming the web service (I'll call that the vendorcontrol) and the service project have app.config files in the project structure, but when I compile and deploy, the settings for the vendorcontrol are not accessible in the resulting project.exe.config file.  How would I make this happen?

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




We are getting the following error, when we call a WCF service from IE. The service is developed in MS.NET 3.5 and hosted in IIS 6.0, Windows Server 2003 SP2


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


NOTE: The same is working GOOD in IIS 6.0, Windows XP SP2


IIS Setting


"Integrated Windows Authentication" is enabled in the "Directory Security"






<binding name

Config Hosting multiple WCF services in one NT service


Hello there,


I've a question about hosting a service in a selfhosting scenario (not IIS or WAS).


For example, I have one WCFService with a config file (web.config). In this config file a system.serviceModel section exists, but also several appSettings.


Hosting in IIS is very simple. I created a svc file and voila, you can call the service. I do not have to place the configsettings of the WCFService into IIS.


Now I turn to host the WCFService in another host, a Windows NT service (or a win/console app).


Why do I have to place all of the WCFService configuration settings in the app.config of the NT Service? Why not just a reference to the physical path of the WCFService.


In the case of three WCFServices hosted by one NT Service, I have to place three web.config contents into the app.config of the NT Service. (Am I wrong? I hope so.)


tnx for reply!




Using web.config settings in a


Hi there,

I understand that one can specify a connection string in an <asp:SqlDataSource /> tag, like so:

<asp:SqlDataSource ID="sds" runat="server" ConnectionString="<%$ ConnectionStrings:LiveConnectionString %>" SelectCommand="SELECT Col1 FROM MyTable"></asp:SqlDataSource>

Is there a similar way to specify the table used in the SELECT command?  The following doesn't work for me:

<asp:SqlDataSource ID="sds" runat="server" ConnectionString="<%$ ConnectionStrings:LiveConnectionString %>" SelectCommand="SELECT Col1 FROM <%$ AppSettings:NewContentsListSQLTable %>"></asp:SqlDataSource>

I see from a previous post (http://forums.asp.net/p/1325626/2646097.aspx) that it's possible to set parameter values from web.config settings, so I'd hope you could specify the table (or columns etc.) as well!

All advice gratefully received.

Add Service reference not updaing the client apps web.config file in .Net Framework 4.0


Hi Team

I am doing some experiments with WCF on .Net 4.0. I have created a service in 4.0 and add a new empty web application to consume my Service. When i added a service reference from the IDE, i can see the web.config file is not updated with the Servcie end points. How do i solve this issue?

My web.config in the client looks like this after adding the service reference.

is it necessary to have a config file when creating proxy of WCF service

Sign In to Vote Hi to all,

i created a service.cs file with the following code then tried to create proxy using svcutil comand.... but it gave error "not able to obtain metadata". After some web search i found i need to add a meta endpoint to the service. so i copied and pasted the code... now svcutil works and creates the proxy.cs. BUT ITS ALSO CREATED A CONFIG FILE. i want to know Do i really need this config file?? if yes then can u please describe its content to me...i will be highly thankfull to you.


using System;
using System.ServiceModel;
using System.ServiceModel.Description;

namespace Service
 interface Iservice
	 string getMyDeals();

 class Service : Iservice
 public string getMyDeals()


Convert user.config to database storage via my custom settings provider



I've created my own custom settings provider to save user settings (formerly in the user.config) to a database. To point the particular settings that are to be saved to the database I specified

for each property to point to the BlobSettingsProvider instead of allowing them to default to the LocalFileSettingsProvider.
Now I need to convert existing user.configs to save to the database on the fly - a one time conversion. Because I've now specified the properties to use the BlobSettings provider they can no longer access the local user.config.
Does anyone have any thoughts on how best to accomplish this conversion (i.e. read the local user.config and populate the BlobSettingsProvider). The app can be run as a ClickOnce installed app or as a simple .net app - finding the correct local user.config looks to be a problem.
Thoughts, ideas,...?


Reporting Service Integration, Unable to access Reporting Services Site Settings


I am attempting to get reporting services running in integrated mode with sharepoint 2010. I have everything installed and features turned on. In the site collection, when I click on  Site Settings > Reporting Services Site Settings, I am presented with:

Error: The request failed with HTTP status 401: Unauthorized.


I get virtually zero hits when searching for this. Any help is appreciated.


Encrypt App.config for SMTP settings


Hi all,

I need to encrypt SMTP settings in the app.config file.I also read MSDN article that uses RSA also to encrypt/decrypt.
This is my code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace EncryptionDecryptionCA
  public class Program
    private static void ProtectConfiguration()
      // Get the application configuration file.
      Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

      // Define the Rsa provider name.
      string provideRsa = "RsaProtectedConfigurationProvider";


First WCF Connection Slow and Proxy Settings in app.config file


I'm new to the WCF and currently facing problems with my first connection to a service we created to connect an Excel OBA to SAP. The first connection is extremely slow, approximately 20 seconds, but once it is establish everything goes really quick afterwards. I've read through some posts and seems like the proxy settings could have an impact. I'm pasting the code of my app.config file below, can you please let me know how I should modify it to include proper proxy settings to improve the first connection?

Also, the proxy thing is just a guess, is there anything else I could do to improve this? Any hint would be appreciated.

Thanks a lot!






xml version

Reconnect WCF klient useing app.config settings




I have a webservice with a reconnect button in the client. I'd like to implement the reconnect function. I have seen a lot of example how to reconnect but all of them implements it with setting the endpoint and everything in the code.

When open my client it uses the app.config settings to open the WCF channel. Actually I'm not a developer so I don't really understand how. I just instantiating my implemented webservice class and it do the job itself.

Is it possible to reopen channel / reconnect using the app.config settings without setting everything in code? Or do I have to set in the code every parameter?




I'm not a development! I'm an infrastructure engineer! Please be patient on the development forums! :)

WCF service hosted in IIS 7 returning error "Security settings for this service require 'Anonymous'

Using the CalculatorService provided as a WCF sample from MSDN, I tried to host it as an application in IIS 7. The virtual folder in IIS is configured as Basic Authentication enabled and Anonymous Authentication disabled. I don't have any certificates setup. This is all hosted in a single machine setting. Each time I access the service through a browser, I'm getting the error "Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service".

Below is my web.config --

Can someone please provide some answer, I don't want to enable Anonymous authentication in IIS. I even set the 

aspNetCompatibilityEnabled = true.

<?xml version="1.0"?>


The SSL settings for the service 'SslRequireCert' does not match those of the IIS 'Ssl'.

I am trying to host a WCF service in IIS with SSL enabled. I had

1. Installed a certificate in IIS
2. Turned on the "Require SSL" check box
3. Enabled "Anonymous" access
4. This is the configuration in the Service Host Web.Config.

                <behavior name="DataServiceBehavior">
                    <serviceMetadata httpGetEnabled="true" />
                    <serviceDebug includeExceptionDetailInFaults="false" />
                      <authentication certificateValidationMode="None" revocationMode="NoCheck" />
                    <serviceCertificate findValue="prakash.constoso.com" x509FindType="FindBySubjectName" storeLocation="LocalMachine"  storeName="My">
            <service behaviorConfiguration="DataService
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