web-config

How to read Web.Config file while Unit Test Case Debugging?

a 夏天 提交于 2019-12-23 17:12:45
问题 I am trying to fetch data(URL) from my configuration file i.e : <AppSettings> <add key="configurationUrl" value="http://xx.xx.xx.xx:XXXX/configuration service/configurations"/> using the following code reqClient.BaseAddress = System.Configuration.ConfigurationManager.AppSettings["configurationUrl"].ToString(); Its all working good when I am trying to debug it, but the major problem comes when I debug a unit test case calling the same code above, instead of Showing "configurationUrl" in the

WCF - Cannot obtain Metadata, but works when the XML Endpoint is removed?

前提是你 提交于 2019-12-23 16:59:56
问题 I'm having a problem with the WCF Test Client. I cannot connect to my WebService because it keeps hitting this error: Error: Cannot obtain Metadata from http://xxx.xxxxxxxx.xxx/DPITerminal.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata

Configuration Error - Unrecognized attribute 'name' / Unable to find the requested .Net Framework Data Provider. It may not be installed

≡放荡痞女 提交于 2019-12-23 13:06:11
问题 When trying to access my database in a live web application I get the error: Server Error in '/' Application. Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: Unrecognized attribute 'name'. Source Error: An application error occurred on the server. The current custom error settings for this

ConnectionString configSource not found when deployed to Azure

喜欢而已 提交于 2019-12-23 11:41:13
问题 I am securing my MVC5 project, by moving the connection strings out of web.config into an external file, and not checking this into source control, nor adding it to the project. My web.config looks like <configuration> <connectionStrings configSource="ConnectionStrings.config" /> This works perfectly in development. I have the website hosted in Azure WebSites, and I have manually defined the connectionstrings in the configuration portal. The problem is that when I publish to Azure, I get the

How do I disable gzip compression for flv files in IIS 7 with runAllManagedModulesForAllRequests set to true?

断了今生、忘了曾经 提交于 2019-12-23 10:00:11
问题 I have an ASP.NET 3.5 Website that is running on IIS 7 and I would like to have my static content (like css files, javascript files, etc) gzip compressed as well as my dynamic content (.net pages). The problem is that I need to make sure flv files (flash video files) are not gzip compressed because that causes problems with the flash video player I'm using, Flowplayer. I've added the following line to my web.config which enables compression, but then my flv files are also being gzip

WCF config files - and the famous “string content length quota (8192)” error

北城以北 提交于 2019-12-23 09:26:43
问题 Folks, Thanks for your help with my previous WCF config file issue. Here's a new one. My project is a WinForms app client (.NET 4.0) that pulls data from (and saves it to) a WCF services hosted on IIS 7.0. When I save a small payload, all is well. When I try to save a payload over 8192 bytes the error is: The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:objEncounterType. The InnerException

How can we add list or multiple values for a single key in web.config in asp .net

与世无争的帅哥 提交于 2019-12-23 09:12:49
问题 How can we add list or multiple values for a single key in web.config? For example: I have key named "xyz" it has a list of values, that is , val1, val2, val3 etc. And this can be obtained in my code as other keys are accessible. 回答1: Add in web config as comma separated valued like <add key = "xyz" value="val1, val2, val3"/> access them as string[] xyzValues = System.Configuration.ConfigurationManager.AppSettings["xyz"].Split(","); 回答2: You can't do it directly but with a little more coding

share connectionstrings with multiple projects in same solution

狂风中的少年 提交于 2019-12-23 09:10:59
问题 I have multiple projects in the same solution. I would like them to share the same connectionStrings so that I don't have to change the this in multiple places. In my web configs I have <connectionStrings configSource="bin/connectionStrings.config" /> and then I have added a file as a link to my "connectionsStrings.config" which sits at the solution level. I have changed the properties so that the "Copy to Output Directory" is "Copy always" and the "Build Action" is "Content" But I get the

VS2010 Clean Web.configs - not updating

我怕爱的太早我们不能终老 提交于 2019-12-23 07:56:12
问题 I'm messing around with MVC 2.0 on VS2010 and am having an issue getting the clean web config feature working. Basically in my Web.debug.config I have <connectionStrings xdt:Transform="Replace"> <add name="ApplicationServices" connectionString="Server=localhost;Database=SITE_DB;User ID=dbuser;Password=P@ssw0rd;Trusted_Connection=False;" /> </connectionStrings> and in my `Web.config` I have <connectionStrings> <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS

VS2010 When debugging web.config transforms are not being applied. Building a deployment package works

六眼飞鱼酱① 提交于 2019-12-23 07:39:31
问题 When I debug a web application, the web.config transforms are not applied. I simply find that the configuration in web.config is not applying the transform for the configuration I'm currently using. Yet if I build a deployment package then I find that the web.config does have the current transforms applied. Are transforms not applied when debugging? I'm starting to wonder if this is the case, but I have coworkers insisting that it works for them. 回答1: Web.config transforms are only applied