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


Post New Web Links

How to config PollingDuplexHttpBinding in ServiceReferences.ClientConfig ?

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :WCF
 

Hi Expert,

We use polling duplex in our Silverlight app, it is easier to set the config file in WCF service side  as follows, however, how to set the config file in Silverlight client side? 

      <extensions>

        <bindingExtensions>

          <add name="pollingDuplexHttpBinding" type="System.ServiceModel.Configuration.PollingDuplexHttpBindingCollectionElement, System.ServiceModel.PollingDuplex, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

        </bindingExtensions>

      </extensions>

      <bindings>

        <pollingDuplexHttpBinding/>

      </bindings>

Is there any approach to set this? So that there is no need for us to rebuild the project every time when deploy on different server.

***********************

BTW, one article in MSDN


View Complete Post


More Related Resource Links

How to configure an App.config for Silverlight 4 PollingDuplexHttpBinding

  

Hi experts,

I have a chat with silverlight 4 (WCF) using PollingDuplexHttpBinding.

How to add a App.config file, to not have the endpointaddress in the code ?

This is my code (client side) :

 

 EndpointAddress address = new EndpointAddress(http://192.168.1.202/Test/Service1.svc);

 

            PollingDuplexHttpBinding binding = new PollingDuplexHttpBinding(PollingDuplexMode.MultipleMessagesPerPoll)

            {

                MaxBufferSize = 2147483647,

                MaxReceivedMessageSize = 2147483647

            };

 

 

            TimeSpan newInactivityTimeOut = new TimeSpan(10, 0, 0, 0);

            binding.InactivityTimeout = newInactivityTimeOut;

 

            binding.SendTimeout = new TimeSpan(0, 0, 0, 5);

 

 

            try

            {

           &n

ReceiveTimeout vs. receiveTimeout in Silverlight 4 ServiceReferences.ClientConfig

  

Hi,

  I'm consuming WCF Workflow service from Silverlight 4. Lately in ServiceReferences.ClientConfig of my Silverlight 4 application I specified 'RecieveTimeout' instead of 'recieveTimeout' attribute as in the following code.

  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="Endpoint" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647&quo

Clean Web.Config Files (VS 2010 and .NET 4.0 Series)

  
.NET 4 includes a new version of the CLR, and a new .NET 4 specific machine.config file (which is installed side-by-side with the one used by .NET 2, .NET 3 and .NET 3.5).

The new .NET 4 machine.config file now automatically registers all of the ASP.NET tag sections, handlers and modules that we've added over the years, including the functionality for:

.ASP.NET AJAX
.ASP.NET Dynamic Data
.ASP.NET Routing (which can now be used for both ASP.NET WebForms and ASP.NET MVC)
.ASP.NET Chart Control (which now ships built-into ASP.NET V4)
What this means is that when you create a new "Empty ASP.NET application" project in VS 2010, you'll find that the new default application-level web.config file is now clean and simple:

reading values from config files in NUnit tests

  

One of my NUnit tests has to read in some values from config files.  In my main application this process works perfectly well, however when I run the unit test, the code that reads in the values from the config files doesnt read anything in.  Ive tried putting app.config in my unit test project (I even tried web.config) but nothing seems to work.  Are there any special steps involved when reading from config files in an nunit test ?


NUnit and config files

  

Ive created an NUnit test project in my solution and have added 3 tests.  They all fail with the same error


Systems.Code.Test.TransactionTest.CreateDataContext_ConnectionString_ReturnsDataContextObject:
SetUp : System.TypeInitializationException : The type initializer for 'Systems.Utils.ConstantHelpers' threw an exception.
  ----> System.NullReferenceException : Object reference not set to an instance of an object.

Systems.Code.Test.TransactionTest.CreateDataContext_ConnectionString_ReturnsDataContextObject:

SetUp : System.TypeInitializationException : The type initializer for 'Systems.Utils.ConstantHelpers' threw an exception.

  ----> System.NullReferenceException : Object reference not set to an instance of an object.


heres the test method


[Test]
        public void CreateDataContext_ConnectionString_ReturnsDataCon

Modifying connection String in Web config using Install Wizard

  

Hey,

Im trying to create a Web Deployment Project, the built in setup and deployment is very good in Visual Studio, i need to able to add an additional step in the setup to change the connection string in the Web config file. Ive seen a lot of articles on how to do this and in particular this http://weblogs.asp.net/scottgu/archive/2007/06/15/tip-trick-creating-packaged-asp-net-setup-programs-with-vs-2005.aspx#7162670 I am however stuck on the final part of this tutorial, im using the code Scott provided but have two errors,  heres part of my code where the errors are



using System;
using System.Configuration;
using System.Configuration.Install;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.DirectoryServices;

 void ConfigureDatabase(string targetSite, string targetVDir, string connectionString)
        {
            // Retrieve "Friendly Site Name" from IIS for TargetSite
            DirectoryEntry entry = new DirectoryEntry("IIS://LocalHost/" + targetSit

Web deployment project - web.config section replacement does not add remove tag

  

I have a web application that is actually installed as a component of a third party site.  In some configurations, I need to remove certain connection strings and re-add them.  I'm replacing this web.config section with a xml file that includes the following:

<connectionStrings>
      <remove name="MyOverridenConnection"/>
      <add connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDb;Data Source=MyServer" name="MyOverridenConnection"
           providerName="System.Data.SqlClient"/>
    </connectionStrings>

For some reason the remove tag is left out during the substitution and I end up with the following in the installed config:

<connectionStrings>
      <add connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDb;Data Source=MyServer" name="MyOverridenConnection"
           providerName="System.Data.SqlClient"/>
    </connectionStrings>

Is there any way to issue removes in replaced sec

The ASP Column: What's in ASP.NET Config Files?

  

Even though you've been using ASP. NET for a while, how much do you really know about ASP. NET configuration files? While you've probably touched the Web. config file from time to time, there are some nuances involved in configuring ASP.

George Shepherd

MSDN Magazine September 2004


Razor View Engine and Add Namespace in Web.Config Problem

  

Hello,

I am working on a MVC project with Razor view engine and I have the following:

  @MvcHtmlString.Create(
    Bundle.Css()
      .Add("~/Styles/FlyOnDreams.FlyOnPages.Base.css.less")
      .Add("~/Styles/FlyOnDreams.FlyOnPages.Core.css.less")
      .Render("~/Styles/FlyOnDreams.FlyOnPages.Core.min.css"))


This only works if I have on the same view the following:

  @using SquishIt.Framework;

However, on my Web.Config I have the following:

    <pages>

      <!-- Namespaces -->
      <namespaces>
        <add namespace="System"/>
        <add namespace="System.Web.Mvc"/>
        <add namespace="System.Web.Mvc.Ajax"/>
        <add namespace="System.Web.Mvc.Html"/>
        <add namespace="System.Web.Routing"/>
        <add namespace="Microsoft.Web.Mvc"/>
        <add namespace="SquishIt.Framework"/>
      </namespaces>

    </pages>


So if "SquishIt.Framework" namespace is added on Web.Config why do I need to have the @using on the view?

How in web.config work in MVC

  

Hi,

I would like to secure any URL below the http://MyServer/Admins and limit it to a specific role.

In webforms it was straight forward. I just put a child web.config in the /Admin/ folder and add <authorization>  <allow roles> tags to it.

How would be the equivalent technique in MVC?

Thank you,

Max


pageParserFilterType in Web.config

  

Hi there,

I'm asking this question AFTER I've already solved my problem - I just wanted more info about it.

Each time I tried to create a ViewUserControl with a specific model template like this:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MyProject.Web.ContactFormContent>" %>

The control would not compile properly and intellisense would not show things like Html and ViewData.

However, when I add the attribute pageParserFilterType to the <pages> in web.config, everything works:

      pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc,
        Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"

<pages
      pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc,
        Version=3.0.0.0

All my server-controls became unrecognized!!! like there's compilation error or web.config missing!

  

hi!

please help - the problem is in post subject.

I have lots of warnings with following text:

"Warning 10 Element 'HyperLink' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing. C:\Users\Pavel\Documents\Visual Studio 2010\WebSites\BioWebSite\ToScientist.aspx 26 18 C:\...\BioWebSite\" 

But web.confg is there! And there's no compilation error!

Site builds just fine. And If I upload it to my hoster - it works!

 

But with all these errors I cant add controls to pages - VS2010 adds hyperlink without ID, and intelisens stoped to work.

Strange, but in my other project (web-application) I have no such difficuty.


Need help with web.config security - Can't figure out where the security group is located in the ap

  

Hi,

   We have sepeartate folder called Managers in one of our web apps. And there was a security build around that folder in a web config file as below

<?xml version="1.0"?>
<configuration>
    <appSettings/>
    <connectionStrings/>
    <system.web>
      <authorization>
        <allow roles="AllManagers"/>
        <deny users="*"/>
      </authorization>
    </system.web>
</configuration>

I couldn't figure out where this group located in the application. Usually all our groups are defined in Active directory but except this group. I am not sure if this is defined on the web server or some where in the app itself. Because in the process of figuring out I have changed it to <allow users="*"/> just to make sure if this is the group we are looking for and YES It is and I have access to it. So I need to find out where this is located and add myself as one of the users to this group.

Can any one help me with this mystery.

Thanks in advance,

L


Sharepoint Site Web Config elements Gets Deleted automatically

  

see i used to have a security filter settings in web config
security><requestFiltering><requestLimits maxAllowedContentLength="104857600"/></requestFiltering></security>
 but it gets deleted automatically after  i dont know why 
we tried to install something in our server yesterday it didn't worked and reverted it back to yesterdays stage( But i had updated the config files 3 weeks ago) 
but today i check the config files  these elements are  not there.

My system is 64 bit windows server 2008 with IIS 7 and MOSS 2007 SP2


Encrypting/Decrypting web.config sections in ASP.Net

  
The article Encrypting/Decrypting web.config sections in ASP.Net was added by ujjwaladatta on Thursday, August 26, 2010.

Encrypting/Decrypting web.config sections in ASP.Net using System.Configuration; using System.Web.Configuration; public partial class _Default : System.Web.UI.Page { protected void Encripting_Click(object sender, EventArgs e) { EncriptSection("appSettings"

config.web httpHandlers add and remove elements for ajax

  

I'm using an autocomplete contol of ajax toolkit. Yesterday a user found that it had stopped working (it wasn't generating the list as you type letters in the textbox). After hours of troubleshooting, I found that in web.config <httpHandlers>, this line -- <remove verb="*" path="*.asmx" /> was placed after the <add> line like this:

<httpHandlers>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
<remove verb="*" path="*.asmx"/>
</httpHandlers>

I fixed the problem by removing the <remove> line, but it seems I can also fix the problem by placing the <remove> line b

ajax setting in web.config httpHandlers

  

 I'm using an autocomplete contol of ajax toolkit. Yesterday a user found that it had stopped working (it wasn't generating the list as you type letters in the textbox). After hours of troubleshooting, I found that in web.config <httpHandlers>, this line -- <remove verb="*" path="*.asmx" /> was placed after the <add> line like this:

<httpHandlers>
    <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
    <remove verb="*" path="*.asmx"/>
</httpHandlers>

I fixed the problem by removing the <remove> line, but it seem

Categories: 
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