change web.config back to previous setting - c#

I have split my App_Code folder into VB and CS folders, to accommodate the two class files at compile time. I added the following to the web.config file to make it work.
<compilation debug="true" strict="false" explicit="true" defaultLanguage="C#">
<codeSubDirectories>
<clear/>
<add directoryName="VBCode" />
<add directoryName="CSCode" />
</codeSubDirectories>
</compilation>
I now want to remove the two folders and go back to a single vb only... IF I delete the above code from the web.config file I get the following 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: The code subdirectory '/mysite/App_Code/VBCode/' does not exist.
Source Error:
An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Source File: E:\web\web.config Line: 75
This is on a hosted site and it appears I don't have access to the machine.config or ability to view it?
How can I go back to previous configuration?
EDIT:
I understand the use of <clear/> but I'm looking to delete the folders from the site... refference: https://msdn.microsoft.com/en-us/library/ms228265(VS.85).aspx

Related

When I first start up website by clicking the link, it shows the error

enter image description here
I am fresher in ASP.Net C# (4.0). I developed one website and upload to a server. It works in my local system. But when i upload to the server, page displays one error in web.config. AND ERROR IS...
Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".
Your detail is clear enough,To see what caused this error add codes below to your webconfig inside configuration section and then try again
<system.web>
<customErrors mode="Off"/>
</system.web>

Server Error due to configuration, and can't set up machine key as shown below

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: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 9: </connectionStrings>
Line 10: <system.web>
Line 11: <machineKey decryption="AES" decryptionKey="D5BE1C3052D930D3D425E96D7A424FEDF67AC4CDDD1BB523A8F420A6C9AB8779" validation="HMACSHA256" validationKey="8AE05954FF94F7FE9972E9774B94B1E7F6
Line 12: 4717979FE0B230158BC7A8AE588994E7EC66CFAC555BA276AEC669BBE8B15DC52A04B06395018BFF3BBAE221E0149A" />
Line 13: <customErrors mode="Off"/>
Source File: C:\Inetpub\vhosts\connectnewwings.com\httpdocs\admin\web.config Line: 11
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34237
Configuration information for an ASP.NET website is defined in one or more Web.config files. The configuration settings are applied in a hierarchical manner. There's a “global” Web.config file that spells out the baseline configuration information for all websites on the web server; this file lives in the %WINDIR%\Microsoft.Net\Framework\version\CONFIG folder. You can also have a Web.config file in the root folder of your website. This Web.config file can override settings defined in the “global” Web.config file, or add new ones. Additionally, you may have Web.config files in the subfolders of your website, which define new configuration settings or override configuration settings defined in Web.config files higher up in the hierarchy.
Certain configuration elements in Web.config cannot be defined beyond the application level, meaning that they must be defined in the “global” Web.config file or in the Web.config file in the website's root folder. The element is one such example. The above error message indicates that there is a Web.config file in one of the website's subfolders than has one of these configuration elements that cannot be defined beyond the application level.
Source: http://scottonwriting.net/sowblog/archive/2010/02/17/163375.aspx

Exception of type 'System.Web.HttpUnhandledException' was thrown. while modifying web.config file

I want to change web.config file appsetings values which is located in the server. i have given full permission to that folder still unable to access and edit the web.config file
while executing the code its giving error saying - Exception of type 'System.Web.HttpUnhandledException' .unable to access file resides in server
error:
System.UnauthorizedAccessException: Access to the path
'C:\Hosting\chek\demo.checks.in\wwwroot\web.config' is denied.
aspx.cs
string emailid = txtEmailid.Text.Trim();
Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath);
config.AppSettings.Settings.Remove("kumarSunlightitMailid");
config.AppSettings.Settings.Add("kumarSunMailid",emailid);
config.Save();
lblNewEmailid.Text = ConfigurationManager.AppSettings["kumarSunMailid"] + " is ur new mail id";
web.config
<appSettings>
<add key="kumarSunMailid" value="krishna#gmail.com" />
</appSettings>
You are facing this error because you don't give read/write permissions to
user..
check couple of things
check wether web.config is readonly.. if so then uncheck that Option
Right Click on Web.config -> goto properties -> security and check you User does have read/write permissions. if not then give it read/write permissions
If you haven't tried this, try adding the Everyone User to that folder, and give him full access. Next, could try setting the configSource of appsettings so that these are stored in a separate config file:
<appSettings configSource="appSettings.config" />
And then create a new file in the same folder called appSettings.config:
<?xml version="1.0" encoding="UTF-8"?>
<appSettings>
<add key="yourKey" value="yourValue" />
</appSettings>
Try adding the Everyone user with full access to both files too.
Otherwise, I'd create a new solution an see if you can recreate this odd behavior there.
Please give permission to the current user to full access the iis project or solution.

Error about Single Signon using Azure AD

I tried to implement a single sign-on app following the tutorial here
http://geoffwebbercross.blogspot.com/2014/05/adding-azure-ad-single-sign-on-to.html
I added an active directory in azure and added a user for this tenant. Then I built a small app in VS2013. I used organizational accounts and typed in the domain name, logged in and created the project. While creating the project, there poped up a dialogue box said
Request_BadRequest: Invalid value found for property 'identifierUris' fo resource 'Application'
And I closed that. I tried to run the project on my local machine. It will have the information like this.
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Detailed Error Information:
Module
IIS Web Core
Notification
Unknown
Handler
Not yet determined
Error Code
0x80070032
Config Error
The configuration section 'system.identityModel' cannot be read because it is missing a section declaration.
Config File
Requested URL
http:
Physical Path
Logon Method
Not yet determined
Logon User
Not yet determined
Request Tracing Directory
D:\My Documents\IISExpress\TraceLogFiles\
Config Source:
34: </system.web>
35: <system.identityModel>
36: <identityConfiguration>
More Information:
This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.
If you see the text "There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined", this error is because you are running a .NET Framework 3.5-based application in .NET Framework 4. If you are running WebMatrix, to resolve this problem, go to the Settings node to set the .NET Framework version to ".NET 2". You can also remove the extra sections from the web.config file.
View more information »
Any ideas of how to solve this issue?
I'm not sure what the root cause was (why you got the error while creating the project), but the following should resolve the error you're seeing when running the app.
In the the <configSections> section of your web.config you need to have the system.identityModel section defined. The entries should look something like this:
<configSections>
<section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<section name="system.identityModel.services" type="System.IdentityModel.Services.Configuration.SystemIdentityModelServicesSection, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</configSections>

Configuration error in ASP.NET website

I recently started getting this 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: An error occurred loading a configuration file: Failed to start monitoring changes to 'H:\2013 T1\SIT302 Project\Deliverables\Website' because the network BIOS command limit has been reached. For more information on this error, please refer to Microsoft knowledge base article 810886. Hosting on a UNC share is not supported for the Windows XP Platform.
Source Error: [No relevant source lines]
Source File: refers back to the web config file Line: 0
I have no idea why this is happening.
The following is contents of my web config file.
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<appSettings>
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
</configuration>
It seems H:\2013 T1\SIT302 Project\Deliverables\Website is a network path not a local path and there is a network problem between the IIS Server and the file server containing the website files. Check the network connectivity.
Users of IIS and ASP.NET often receive this error message when running a website from a network share or NAS device. Check this LINK for more information and the solution.
I made a very detailed answer to this problem here: https://stackoverflow.com/a/20710473/705198
That answer is an accumulation of all the technet, msdn, and blog reference material I could find on the subject, and what we ended up having to do to fix the problem. Disabling Jumbo Frames (HP Server NIC problems causing another error) and SMB2+ combined with the registry edits were what ended up saving us with our high traffic IIS sites. The registry edits alone only made it so the network bios limit errors would not show up as fast under normal load.

Categories

Resources