web-config

Set suppress warnings for website

点点圈 提交于 2019-12-22 06:32:20
问题 I am working with a project from another developer that has hundreds of obsolete method warnings. In the compiled dlls, I set suppress warnings 618 (the full warning number is CS0618). Is there a way to set the same setting on a web site? The problem is that there are so many obsolete warnings that I can't find any of the important ones. 回答1: I believe you need to specify this in the web.config. See also: Compiler Element and Web Project Settings <system.codedom> <compilers> <compiler

Get dbname from multiple web.config files with powershell

时光总嘲笑我的痴心妄想 提交于 2019-12-22 06:29:16
问题 I would like to issue a powershell command to return me the connection string (specifically I am looking for the db name value) for all the web sites on a web server... So I would like to see something like site1 dbname=Northwind site2 dbname=Fitch site3 dbname=DemoDB I have tried using the IIS Powershell snap-in... I thought I was close with this: PS C:\Windows\system32> Get-WebApplication | Get-WebConfiguration -filter /connectionStrings/* but... after looking at the results... my answer

Can't get Log4Net to work in our WCF application [duplicate]

a 夏天 提交于 2019-12-22 05:51:53
问题 This question already has answers here : Log4Net in WCF not working (4 answers) Closed 6 years ago . We are trying to use Log4Net to log from our IIS 6-deployed WCF Application. We are trying to log to a file, but can't seem to get the log files to be created, let alone see the logging output in them. The pertinent pieces of out web.config are: <sectionGroup name="common"> <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" /> </sectionGroup> ... <common>

Can I increase maxRequestLength of ASP.NET request for MVC Controller Action with additional parameters?

跟風遠走 提交于 2019-12-22 05:28:15
问题 Can I increase maxRequestLength of ASP.NET request for MVC Controller Action with additional parameters? I have a UploadController with a ActionResult looking somthing like this. [HttpPost] public ActionResult VideoUpload(int memberId) { var status= _docRepo.SaveDocument(DocumentType.Video, Request.Files, memberId); return Json(new { success = true, status = status}); } The files can be very large, i have increaset maxRequestLenght in web.config and can upload the files, but im worried about

Customizing “A potentially dangerous Request.Path value was detected” error page

烂漫一生 提交于 2019-12-22 04:56:05
问题 When I call a page with a non authorized character (such as *), i get a yellow page "A potentially dangerous Request.Path value was detected". It looks like it is a 400 error page. My goal is to customize this page and show a clean error page or redirect to home page (i tried both solutions). Here is what i wrote in my web.config: <system.webServer> <httpErrors errorMode="Custom"> <remove statusCode="400" subStatusCode="-1" /> <remove statusCode="404" subStatusCode="-1" /> <error statusCode=

Meaning of path attribute on handlers in web.config

你说的曾经没有我的故事 提交于 2019-12-22 04:24:26
问题 I'm looking at IIS7.5 configuration (system.webServer/handlers). Do you know what is the diference between \*. and \* in the path argument for handlers? Could you use file.* (to match file.txt and file.xml) or abc.a?c (to match abc.abc and abc.asc) ? Can the path argument make reference to the "folder"? like \*\f4\*.txt ? Given a http request like GET \f1\f2.f3\f4\a.b.c?arg1.arg2.arg3=3&arg4.txt=1.4 what is the part the path argument tries to match? 回答1: The * and *. paths aren't really

Entity Framework DbContext in Azure Web Role

半城伤御伤魂 提交于 2019-12-22 04:21:25
问题 I am migrating an existing Web Application (using Entity Framework 5) to an Azure Web Role. The database connection string is being moved from the web.config to the ServiceConfiguration.*.cscfg files. The problem is that in the auto-generated Model.Context.cs file, my entities class is defined like this: public partial class MyEntities : DbContext { public MyEntities() : base("name=MyEntities") { } // DbSets, etc } This will always look for MyEntities in the web.config . How can I override

How to apply VS2010 web.config transformation to an element with a namespace attribute?

╄→尐↘猪︶ㄣ 提交于 2019-12-22 03:54:14
问题 I'd like to use the new VS2010 web.config transformation feature to change the connection string within the nhibernate configuration in my web.config file. The relevant snippet is something like this: <?xml version="1.0"?> <configuration> <configSections> <section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" /> </configSections> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> <session-factory> <property name="connection

Instance Failure in asp.net

纵饮孤独 提交于 2019-12-22 02:04:12
问题 I have a web application that is working perfectly in my system. However, when I copied it to another system, I couldn't login to the application. There is an error: Server Error in '/' Application. -------------------------------------------------------------------------------- Instance failure. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Can I add a textnode instead of an attribute in a .NET configurationsection?

℡╲_俬逩灬. 提交于 2019-12-22 01:29:34
问题 I currently have a .NET custom configurationsection that looks like this: <customSection name="My section" /> What I want is to write it as a textnode (I'm not sure if this is the correct term?) like this: <customSection> <name>My Section</name> </customSection> My current customSection class looks like this: public class CustomSection: ConfigurationSection { [ConfigurationProperty("name")] public String Name { get { return (String)this["name"]; } } } What should I do to make it a textnode?