web-config

Problem accessing .NET web service from Windows app

I have an AJAX web application. ASP pages are accessing various Web Services that are part of the application using standard Microsoft .NET AJAX extension APIs. Now, I have to call some of the web services from the Windows app. It works when I add web reference to a project on my local development machine. But when I try to access web...

Reading from configSection attribute of type "Type"

I've a section like this <mySection type="Namespace.MyClass, AssemblyName" /> in my code I need to create an Instance of MyClass, so what I do is something like that: string type = GetMySectionType(); // "Namespace.MyClass, AssemblyName" var typeParts = type.Split(','); var className = typeParts[0].Trim(); var assemblyName = typePar...

Authentication settings in IIS 7.5 and ASP.Net, what is difference?

Hi, I just start to learn web programming using IIS 7.5 in windows 2008 R2, and ASP.Net 4. I notice that both IIS and ASP.Net can define Authentication rules. In IIS, there is a form authentication setting where I can redirect user to specified page for authentication, like below: And then, in ASP web.config file, I find similar sett...

ASP.Net MVC: Where to store Application and Admin Panel settings? Web.config?

Having built myself a decent website using ASP.NET MVC, I'm about to build an "Admin Panel" for users in the "Admin" Role to control the website with. Specifically, the website that I've built is an internal site for an enterprise and it consists of a bunch of mini web-apps, each of which need to be configured and/or tweaked from time to...

3rd Party .Net Assembly not working in WebService project

So I'm trying to use a .Net Assembly in my web services project. This assembly requires lots of settings in App.config. But my web service doesn't have an App.config, it has a web.config. It seems that it uses sections that an app.config would have that don't even exist for web projects. Is there any way I can make this assembly work...

Asp.net web service: Problems accessing without www

I have a Asp.net web service running on www.domain.com/Service.svc that I connect to using jQuery from my asp.net website. Everything works perfect if the user access my website with www.domain.com. But if the user uses only domain.com I get error: There was no channel actively listening at 'http://domain.com/Service.svc/get?date=2010-...

web.config issue in ASP.Net

Hello everyone, I am using VSTS 2010 + ASP.Net + C# 4.0 to learn someone else's code for a WCF application. I find besides Web.Config, there are also Web.Debug.config and Web.Release.config. I searched the content of Web.Config, but cannot find any reference to Web.Debug.config and Web.Release.config. However in VSTS 2010 IDE solution e...

connection string issue in web.config of ASP.Net

Hello everyone, I am using VSTS 2010 + C# + .Net 4.0 to develop an ASP.Net application using SQL Server 2008 Enterprise as database. I am learning someone else's code. I notice code like this, I am not sure whether the usage is correct and so I come here to ask for advice. In the code, I see some code like this, I want to know whether ...

Getting error in web.config: requirePermission is not declared

In my project i am was getting error: error:requiredPermission attribute not declared to resolve this i did google http://dotnetslackers.com/Community/forums/requirepermission-attribute-is-not-declared/p/1241/12676.aspx and then i found that i will have to add "xmlns" in my webconfig's configuration tag and i did that: <configur...

Session Timeout Logout user

I want my application to log out the logged in user and take them to the Loing.aspx page as soon as the Session times out. The user should be logged out without any event being triggered. I have tried making changes in authentication mode but all in vain... ...

Changing your web.config from your ASP.NET application

I need to change the database connection string in the web.config file but havent got a clue how to go about this. Does anyone have any experience with that? UPDATE Sorry, not very clear above, I want to be able to change a connection string from the web application after it has been deployed ...

How to prevent Visual Studio from prompting to update .settings file from app.config

We're using a .settings file to store our application settings, and use default values in there so that we don't need to configure every single setting. This has generally been fine. However, during development we'll frequently change values in app.config, which means that when we open the .settings file, we always get the prompt "Value...

Use Visual Studio web.config transform for debugging

Hello, I want to use the web.config transformation that works fine for publish also for debugging. When i publish a web app, visual studio automatically transforms the web.config based on my currenc build configuration. How can i tell visual studio to do the same when i start debugging. On debug start it simply uses the default web.conf...

Unity 2.0 Web.config settings with MVC

Hello, I am trying to use Unity 2.0 for my current project with MVC and having trouble configuring paramter injection in the web.config file. Here's what I have: 1) A Home Controller: public class HomeController : Controller { IRepository repository = null; public HomeController() { // Always calls this constructo...

ASP.NET security exception with OpenWebConfiguration on shared host

After moving my web site from my local development environment to a shared host I get: Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust leve...

How to merge web.configs for ASP.NET MVC and plain ASP.NET app

Merging the web.config files of a legacy ASP.NET App and a new MVC app has pretty much defeated me. Is there a way I can build my solutions with projects sectioned off into subfolders? EG (each project to have its own web.config): ~/PlainVanilla/ /* original asp.net app - still some life in old dogs */ ~/PlainVanilla/StrawberryMV...

ASP.NET Forms Auth Allowing access to specific file in subdirectory when all others should be denied

I am having problems allowing a specific Role access to a specific page in a subdirectory. My ASP.NET application has a directory, ~/Forms/Administration that has limited access. There is a specific file, ~/Forms/Administration/Default.aspx that I want to give 1 additional user role access to, as well as the Admin role. In ~/Forms/Adm...

ASP.NET connection string deployment best practice

I've collected a (hopefully useful) summary of the ways I've researched to accomplish the subject of this post, as well as the problems I have with them. Please tell me if you've found other ways you like better, especially if they resolve the problems that the methods I mention do not. Leave connection strings in web.config and use XD...

Add or Edit in webconfig file

I want to add or update webconfig file in C#. How can i do this? ...

Add a web.config key for always redirect when get an unhandled exceptions

I once saw that was possible to do something like adding a key in the web.config file to redirect to a default error page everytime a unhandled exception is found. Is it possible? how? ...