C# - Set WCF ClientCredentials In App.config?
Sep 16, 2010
Is it possible to set clientcredentials for an WCF in App.config?
I would like to avoid doing this:
Using svc As New MyServiceClient
svc.ClientCredentials.UserName.UserName = "login"
svc.ClientCredentials.UserName.Password = "pw"
...
End Using
Rather the login and password should be part of the configuration.
View 4 Replies
ADVERTISEMENT
Nov 11, 2011
I have a web service I'm trying to interface with however no matter what I try it is refusing to send the clients credentials along with the request.The security block in my app.config looks like
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
[code].....
View 1 Replies
Mar 26, 2009
I have a class library (Named ADI), that needs some configuration settings from the project using it (like connectionstring, filesystem locations etc).
I want to define these settings in my Windows Forms/Web Projects App.Config or Web.Config, like other settings.
Here is part of my app.config for my windows forms application:
<applicationSettings>
<PhotoImportRobot.My.MySettings>
<setting name="ADIImageRoot" serializeAs="String">
[Code]....
View 3 Replies
Jan 18, 2010
is there any tool to validate configuration file?
View 1 Replies
Jul 6, 2011
Our main application has both a asp.net and winforms component. There is a class that is used by both sides and needs info from either the web.config or app.config files. The class itself does not know if it's on the client side or on the web server (at this point). We are getting errors when it's attempting read app.config when it's on the web side. Is there a way for the class to tell if it needs to read web.config or app.config?
View 1 Replies
Aug 14, 2009
I have an .net addin that loads w/outlook. Being a .NET assembly, I naturally have a .config file that you would expect. From my previous research, I named my app.config file to be Outlook.exe.config because outook is the executing assembly, and naturally, that's where you would expect that. This for the most part is fine.
In some installations, and I am not sure as to the conditions why, My addin will hunt for the config file under the dll name in another directory. So, more clearly stated, Office is in its directory, and my addin dll is in its own. So: MyAddin.dll.config vs. Outlook.exe.config. So, fine, I just made 2 copies of the config file and covered both cases. Now, I find that the addin is hunting for Outlook.exe.config in MY program directory (not the outlook dir)
FYI I log which config file is being used using: [Code] So, can someone tell me WHERE it is determined where the config file is read from, and if I can "Force" it to be used from a certain location?
View 1 Replies
May 12, 2011
I have a self-hosted WCF (as a Windows service), it has a web.config file.
Inside one of the functions, I have this code (which doesn't seem to work)[code]...
View 1 Replies
Aug 5, 2009
I am getting the following error when i try to run my vb.net application on some other machine along with the related dlls and other files**********************************************************See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: The 'add' start tag on
[code].....
View 4 Replies
Jul 15, 2009
I want to write a WCF Service as a console app. How do I make the contents for the App.Config? Do I hand code it, or is there something that will generate it?I know that svcutil.exe will generate stuff for a client from the service and its config, but how do I build the config contents for the service?I have .net 3.5 At home I have VB 2005 Express At work I have VS 2005 Suite?
View 1 Replies
Dec 7, 2011
I am new to VS 2010 and in my application I want to add an app.config to contain to variables.I have been adding the app.config through the solution explorer, add item, general tab, configuration file.However i have noticed each project creates a default app.config in the project folder but which doesnt show up in the solution explorer.
View 1 Replies
May 22, 2009
What i want to do is use a config file to save the value that a user sets in a Folder browser dialog so that i can use the directory they select to write to files in that directory
View 4 Replies
Feb 29, 2012
Dim accConn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & ConfigurationManager.AppSettings("Access") & "")
<?xml version="1.0" encoding="utf-8" ?>
[code].....
View 1 Replies
Aug 30, 2009
where i can use a config.ini on my project.
View 7 Replies
Aug 18, 2011
I'm attempting to update some values in the web.config file from code during an install process.So far I've found this for updating the connection string,[code]However I need to update another section and I'm not sure how. I have the settings for an email and I'm not sure how to update them. Relevant web.config section below, [code]
View 2 Replies
Jun 27, 2012
I have inherited a rather large project consisting of an application written in VB6 and several DLL's and ActiveX controls written in VB6, VB.NET 1.1 and VB.NET 2. I want to change one of the settings for one of the DLL's written in VB.NET 2 that is in its application.dll.config file, but it seems to be having no effect.My main VB6 application (I will call it Alpha) has a configuration file (Alpha.exe.cnfig) which contains settings used by my VB.NET 1.1 DLL (which I will call Bravo). After calling Bravo, Alpha calls Charlie (my VB.NET 2 DLL). However, even though I have changed the application settings in Charlie.dll.config in the subdirectory where the DLL lives, it has no effect. I have tried putting Charlie's settings in Alpha's config file but this causes Bravo to fail with an automation error (which I think is because the format of the config files changed from .NET 1.1 and .NET 2).[code]If I try putting the applicationSettings section under directly beneath the appSettings section (i.e. as another child element of the configuration element) in Alpha.exe.config then Bravo.dll fails.
View 1 Replies
Apr 20, 2011
Can anybody tell me how can i add app.config file to the project?
i try add new item in the project but i can not see any app.config template.
View 5 Replies
Apr 10, 2011
I'm trying to add a new section to my app.config file under the applicationSettings section and then read it from my WinFroms VB.NET application.[code]...
View 1 Replies
Mar 16, 2011
I have a solution with several projects and several developers, each with their ownenvironment (of course). To manage connection strings between each environment, I have created several app.config files for each environment: app.config.dev, app.config.qa, etcThe pre-build event simply copies the app.config.$(ConfigurationName) to app.config. This pre-build event is done for each project in the solution, and the connection string is included in each (including the test project).
View 2 Replies
Apr 26, 2011
Visual Studio 2008 / Windows 7 / .net framework 3.5 / Windows forms application
My applicaiton has the following App.Config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
[Code]....
View 1 Replies
Jan 31, 2011
how to setup my deployment project so that users can customize thier own settings in app.config? Which special folder in the File System browser should I add, Personal Data, Application Data, or Programs Menu? How do I add the app.config to the folder? What about the project output, should it also be in the same folder? If so, should the project output be taken out of the Application Folder, in other words, exist in one place? I tested my deployment and was shocked that the icon only opened on the test user's pc after installation. I have custom settings in the app.config file that have default values, but must be configurable for user specific settings.
View 3 Replies
Nov 6, 2009
I have difficulties figuring out a useful app.config structures for my program.What I am doing is writing a windows service, which watches several directories on a server for files being uploaded.My problem is making my program configurable for n folders when in each of those n folders, i need to watch for a different collection of filetypes
e.g. folder1: .dwg;
folder2: .dwg;.doc;.xls;
then when a new file is uploaded, for example a .dwg file to folder1,then i need to run program1 to convert the dwg to a dwf, and program2 to convert the dwg to a .swf.but that only if filetype is .dwg and folder = folder1. if a .dwg is uploaded for example to folder2, then it needs to be converted to a pdf.The closes i have come to make this configurable in a app.config file is this:
<Folder2 name="C:inetpubwwwrootCAFMFotos" filetypes=".dwg;.pdf;">
<action>
<add key="ExecutableAndPath" value="C:UsersMeDesktopverydocdwg2vec.exe"/>[code].........
I have difficulties bringing this to a usable from in app.config
View 1 Replies
Nov 10, 2010
I'm trying to use System.Diagnostics to do some very basic logging. I figure I'd use what's in the box rather than taking on an extra dependency like Log4Net or EntLib.
I'm all set up, tracing is working wonderfully. Code snippet:
Trace.TraceInformation("Hello World")
App.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
[Code].....
That doesn't make sense to me: I just have to declare an instance of the BooleanSwicth to be able to manage (disable) tracing via the .config file? Should I like ... use ... the object somewhere?
View 4 Replies
Nov 25, 2009
Can values from web.config be read completely at runtime or does the application make a copy of the current web.config upon initialization.
Essentially, I'm wandering if I make a change to web.config if it will take effect on the users next postback or if they would need to initialize an entirely new page load. In particular, I'm interested in sections of the web.config like sesssionState and when a change to timeout would take effect.
View 2 Replies
Dec 31, 2011
I've never thought about it before; but I recently learned how I could modify the app.config file to add/remove trace listeners (for example, to redirect all of the Trace.WriteLine output to a text file).But I don't quite understand how it works? I know the corresponding C# code to do the same as the config (in this example) - does that code get generated/executed before my application's entry point?
View 3 Replies
Jan 17, 2009
i can't connect database and bind it in DataGridView when i use app.config for connectionstring. I use VB.NET and MS Access.
[Code]...
View 2 Replies
Apr 16, 2012
I developed an windows application using visual basic.NET. I configured my database connection string in app.config file. The problem is that I can retrieve data but cannot insert data into the database. the config file
[Code]...
View 9 Replies
Oct 2, 2009
Usually my application sends email with a generic system address. But in some cases I want to instead send as the logged in user.
[code]...
View 2 Replies
Nov 11, 2011
In code ConfigurationManager.AppSettings("IsFill") showing null
but when i open exe.config file manually that key is present in file
den i modify exe.config file using below code
Dim configFile As Configuration
configFile = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath)
configFile.AppSettings.Settings("AppVersion").Value = "1.0.1"
configFile.Save()
[Code]...
View 2 Replies
Jun 28, 2009
As far as I understand all default settings of app.config settings is hard coded in the application and will generated on the fly in the first run.
If this is true then there is no good reason to deploy these files with an installer or in a zip package, am I right?
View 1 Replies
Apr 21, 2010
I've created a console VB.Net application and encrypted the app.config file with RSAProtectedConfigurationProvider.I've used an article http:www.codeproje...eAppConfig.aspx as an example for the Encryption. It works fine in an IDE on my XP desktop.Then I deployed my application to a Windows 2003 server. The package included the app's executable along with the encrypted app.exe.config file. However, the application failed on the server with the following exception:Unhandled Exception: System.Configuration.ConfigurationerrorsException: Failed to decrypt using provider 'RsaProtectedConfigurationProvider'. Error message from the provider: The RSA key container could not be opened.I decided to encrypt app.config on the server so I copied app.config and encrypted it. The app.exe.config looked encrypted and I ran the application. However, it failed: although it didn't raise an Rsa exception as before,
[Code]...
View 1 Replies