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


Post New Web Links

Problem in reading WCF configuration settings

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

Hi,

The great thing about WCF is that you can configure you're WCF bindings in a configuration file and not through code.
We are now making connection to WCF's webservices in our SharePoint code, but now the question is where to place the WCF configuration settings. 

 

For deployment reasons we don't want to place the settings in the SharePoint web.config:

-  can't be easily changed by admin users through SharePoint Gui

-  new deployment needed to change configuration settings

-  webservices u


View Complete Post


More Related Resource Links

Reading configuration settings from service installer

  

Hello,

not sure if this is the correct forum but anyway: I have a windows service and I am using the default settings stored in configuration file, like myservice.exe.config. Everything works fine when the service runs, but when I want to install or uninstall it via the installutil, the settings stored in myservice.exe.config are not read.  I guess this is because the installutil is the application being run, and loading my service assembly via reflection does not cause its configuration file to be read. Okay, but how can I do that? How can I cause the settings stored in app configuration file to be loaded during the installation phase of the service?

Thanks!

Jan


reading excel file problem

  

Hi,


i have 200 rows in my excel file. im using OleDbConnection to read the excel file.

The problem is that it will read all the blank rows from row 200 onwards. Is there a configuration im missing ? or is there a way to import all rows that has data? Here's some of my code.


string excelConnectionString =
               "Provider=Microsoft.Jet.OLEDB.4.0;" +
                "Data Source=" + filePath + ";" +
                "Extended Properties=Excel 8.0";

OleDbConnection excelConnection =
                    new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filePath + ";Extended Properties='Excel 8.0;HDR=NO'");


OleDbCommand cmd = new OleDbCommand("Select * from [list$]",excelConnection);







Problem when using Activator.CreateObject and reading App.Config file

  
Hello, this is the scenario. I have an application that load at runtime severals dll. these dll are actually "adapters" that wraps calls to web services, database and so on. The app.config of the "main" application stores in config sections all information necessary to each adapter (i.e.Web ServiceURL..) and I have created inside each adapter a class to ready those values the loading at run time the DLL has been implemented by storing all necessary types into a dictionary of generics and when I need to instanciate it I call the Activate.CreateObject and I pass the specific type (I means the name of the Adapter class) The problem is that the adapter class itself is not able to get the config value because ConfigSection has not been initialized. If I write: IInterfaceAdap adapt = new myAdapter() -> I read the config data IInterfaceAdap adapt = (IInterfaceAdap)Activator.CreateObject (type) -> now way to read the data stored in the App.Config. I think that I undertood the problem but I'm not able to find a workaround to read data store in the app.config!! I need help please!!  

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

Configuration problem?

  
Hi All, I created one config for all of my pcakges.I tested in my system its working fine. In my system sqlserver is windows authentication. I modified the configfile which system has sqlserver authentication its working fine. Same config file I am trying to execute in QA box I got error related to authentication. How to modify current confige file related to sqlserver authentication? Thanks CMK...

Problem reading my DLL

  
Hi there, I have a problem trying to display my DLL on Visual Studio 2005. I created a windows control library and I want to access it from my asp/c# website. I use the following code to display it: <object id="myComponent" classid="http:WindowsControlLibrary1.dll#WindowsControlLibrary1.UserControl1" height="300px" width="100%" />However, when I run the website it just shows me a plain box. With nothing in it.Another thing, the VIEWASTEXT inserted in the object it gets underlined and when I roll the mouse over it says:"VIEWASTEXT attribute is not valid attribute of element 'object'"Can anyone help me go around this problem or fix it?Thank you in advance ;)

Problem setting up approve/reject settings in Absence Request and Vacation Management Template

  
Hi I have recently installed and set up the absence request and vacation management template in SharePoint Services 3.0 and all seems to be going reasonably well apart from one hitch. I have edited the setup workflow so that manager is sent an email on request, employee is sent an email on approval/rejection and payroll are sent an email on approval for their records. However, even though the Personal Vacation option in the Absence Type list is set to Yes for Approval Required, the workflow is automatically sending out the email to say their annual leave has been approved as soon as they request it. Has anyone come across this before or know where I may be going wrong? Thanks for any help you can give. Jo

Problem reading from cookie

  
I'm trying to build a smaller shop and I have run into some problems with cookies. This is my code in the shoppingcartaccess classprivate static string shoppingCartId { get { // get the current HttpContext HttpContext context = HttpContext.Current; // try to retrieve the cart ID from the user cookie string cartId = context.Request.Cookies["CartID"].Value; // HERE I GET THE ERROR // if the cart ID isn't in the cookie... // check if the cart ID exists as a cookie if (context.Request.Cookies["CartID"] != null) { // return the id return cartId; } else // if the cart ID doesn't exist in the cookie as well, generate // a new ID { // generate a new GUID cartId = Guid.NewGuid().ToString(); // create the cookie object and set its value HttpCookie cookie = new HttpCookie("CartID", cartId); // set the cookie's expiration date int howManyDays = SiteConfig.CartPersistDays; DateTime currentDate = DateTime.Now; TimeSpan timeSpan = new TimeSpan(howManyDays, 0, 0, 0); DateTime expirationDate = currentDate.Add(timeSpan); c

DB Reading problem

  
I was having problem with my database, I couldn't see any of the table in the enterprise manager. when I execute any sql in some of the tables of the database it was giving error msf that "Bad Page Id". I went through the FAQs and Forums, I tried with this queries. ALTER DATABASE DMS_PILOT SET SINGLE_USER go DBCC CHECKDB (DMS_PILOT, REPAIR_ALLOW_DATA_LOSS) GO When I execute this query I found some new error messeges mentioned as below. "Server: Msg 8966, Level 16, State 1, Line 2 Could not read and latch page (1:3168) with latch type SH. sysindexes failed. DBCC execution completed. If DBCC printed error messages, contact your system administrator." Please help me.

DB Reading problem

  
I was having problem with my database, I couldn't see any of the table in the enterprise manager. when I execute any sql in some of the tables of the database it was giving error msf that "Bad Page Id". I went through the FAQs and Forums, I tried with this queries. ALTER DATABASE DMS_PILOT SET SINGLE_USER go DBCC CHECKDB (DMS_PILOT, REPAIR_ALLOW_DATA_LOSS) GO When I execute this query I found some new error messeges mentioned as below. "Server: Msg 8966, Level 16, State 1, Line 2 Could not read and latch page (1:3168) with latch type SH. sysindexes failed. DBCC execution completed. If DBCC printed error messages, contact your system administrator." Please help me.

problem reading from app.config

  

I have added an app.config file in my winform aplicaion an added one key

<add key="IsFirstRun" value="True" />

then I am tying to read it like this:

MessageBox.Show(ConfigurationManager.AppSettings["IsFirstRun"]);

but I am getting this error:

Configuration system failed to initialize

on the MessageBox line..

why? how ca I fix please?


Jassim Rahma

XMLDocument, problem reading Node.

  

Hello,

 

I am doing the following:

 

System.Net.WebRequest myRequest = System.Net.WebRequest.Create("http://www.atlantawithkid.com/feed/"); 
System.Net.WebResponse myResponse = myRequest.GetResponse(); 
 
System.IO.Stream rssStream = myResponse.GetResponseStream(); 
System.Xml.XmlDocument rssDoc = new System.Xml.XmlDocument(); 
rssDoc.Load(rssStream); 
 
System.Xml.XmlNodeList rssItems = rssDoc.SelectNodes("rss/channel/item"); 
System.Xml.XmlNode rssDetail; 
 
string sRssDescription;  
rssDetail = rssItems.Item(0).SelectSingleNode("description"); 
if (rssDetail != null) 
    sRssDescription = rssDetail.InnerText; 

However, when I read the "description" node and view the InnerText, or the InnerXML, the string is different than in the original XML document.

The string returned has and ellipses and the data is truncated. However, in the original XML document there is data that I can see.

Is there a way to select this node without the data being altered?

The original XML <description> node is as follows:

			<description xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" cf:type="html">
				<div class="tweetmeme_button" style="float:right;margin-le

Problem with Configuration of Message Inspector

  
I'm hoping someone might know what I am doing wrong. I'm trying to setup message interceptors and am trying to apply them to all of my services via the web.config. I've been working on it for hours but keep getting the following error:

Parser Error Message: The type 'AdventureWorksService.
Interceptor.ListenerServiceBehavior, AdventureWorksService.Interceptor, Version=0.0.0.0,
        Culture=neutral, PublicKeyToken=null' registered for extension 'TestInterceptor' could not be loaded.

I have the classes under a the 'AdventureWorksService.Interceptor namespace in my web project.

Here my web config:

<?xml version="1.0"?>
<configuration>
  <system.serviceModel>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true">
      <serviceActivations>
        <add relativeAddress="~/DataService.svc" service="AdventureWorksDataService"/>
      </serviceActivations>
    </serviceHostingEnvironment>
    <!--For REST-->
    <protocolMapping>

How launched EXE use it's own configuration settings? (Reflection)

  

Hi All,

I am using reflection to run an EXE file from my application.

But the Launched EXE using the appsettings of my application.

How it'll use the configuration settings from EXE configuration file.

Thanks in advance.


System.net proxy configuration settings

  

Hi there

I need to access external links from my application and i cant configure the proxy settings on my app.config.

My situation is this:

My machine is connected to a domain but im am logged to my machine with a local user(outside the domain).

My IE8 has the proxy settings configured and they require a username/password.

How can i tell my app to use the username\password required by the proxy to authenticate?

 

Thanx


Excluding Files From Different Configuration Settings

  

Hey dudes,

Does anyone know how I can exclude certain folders and files from certain builds? Essentially I've got test code that needs to be deployed to the testing server - but obviously not the real server. This is in both files and folders.

Using the configuration manager profiles, I would like to create a profile for each scenario, and tell it what files it does not need.

Cheers


problem in Email configuration in sharepoint

  

Hello everybody...

 

i have to face problem in sharepoint 2007 for email notifiation.

i have a two virtual machine one is AD+ EXCHANGE2007 and second is for Sharepoint . both have windows 2003 server os.

This is my outgoing email configuration.

I have configured incomming email but in document library continuous message will produced ? how to solve it ?


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