Unrecognized escape sequence and Server Error in '/' Application in asp.net - asp.net

This is the error that i have been trying to resolve.Can anyone be of help?
I just copied the thing written in quotes from the web.config file in asp.net but this error is not allowing for a proper connection.
The error is in this part \myDatabase.
I have tried replacing \myDatabase with \\myDatabase OR /myDatabase OR //myDatabase. Nothing worksbut nothing helped.web.config file is:-
<configuration>
<connectionStrings>
<add name="ConnectionString"
connectionString="Data Source= (LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\myDatabase.mdf;
Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.5.1"/>
<httpRuntime targetFramework="4.5.1"/>
</system.web>
</configuration>

Related

How to Update the .config file using Azure DevOps "Update config" Task

I want to Update the Web.config file using Azure DevOps Release Pipeline.
I am using [Update Config][1] Task from MarketPlace.
[1]: https://marketplace.visualstudio.com/items?itemName=digitalmedia34.updateconfig
Here Is the Web.config File
<!-- Some Contents -->
<configuration>
<appSettings>
<add key="Setting1" value="local setting"/>
<add key="CommonSetting" value="local common setting"/>
</appSettings>
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=LocalSQLServer;Initial Catalog=MyReleaseDB;User ID=xxxx;Password=xxxx" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.7.2"/>
<httpRuntime targetFramework1="4.7.2"/>
</system.web>
</configuration>
I am able to change the value of some configuration by adding variables like [Variables]
[2]: https://i.stack.imgur.com/uq85Y.png
My Question is how can I change the values of Nested Property. For Example if I want to change the targetFramework in
<system.web>
<compilation debug="true" targetFramework="4.7.2"/>
<httpRuntime targetFramework1="4.7.2"/>
</system.web>
Please let me know how can I update these values
Thanks in advance
How to Update the .config file using Azure DevOps "Update config" Task
You could use the task Replace Tokens to update the key's values,
the format of variable in .config file is #{TestVersion}#:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="Setting1" value="local setting"/>
<add key="CommonSetting" value="local common setting"/>
</appSettings>
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=LocalSQLServer;Initial Catalog=MyReleaseDB;User ID=xxxx;Password=xxxx" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="#{TestVersion}#"/>
<httpRuntime targetFramework1="#{TestVersion}#"/>
</system.web>
</configuration>
Use Replace Tokens task to update the key's values:
And define the key's values on the Variables.

•Request filtering is configured for the Web server and the file extension for this request is explicitly denied

HTTP Error 404.7 - Not Found
The request filtering module is configured to deny the file extension.
I am using Visual studio 2013 web express. When I running Defalt.aspx its running fine but when i run materpage.master it throw me this error. I tried a lots of solution and its still not working( i tried to change the web.conf). Anyone know what can I do for this issues>?
code for web.conf
<configuration>
<connectionStrings>
<add name="ConnectionString" connectionString="Provider=MSDAORA;Data Source=XE;Password=1234;User ID=System"
providerName="System.Data.OleDb" />
<add name="databaseString" connectionString="Provider=OraOLEDB.Oracle.1;Data Source=XE;Persist Security Info=True;Password=1234;User ID=system"
providerName="System.Data.OleDb" />
<add name="SOConnectionString" connectionString="Provider=OraOLEDB.Oracle.1;Data Source=XE;Persist Security Info=True;Password=1234;User ID=so"
providerName="System.Data.OleDb" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.5.1" />
<httpRuntime targetFramework="4.5.1" />
</system.web>
You don't directly access master pages. You access a content page (.aspx) that references a master page.

Can't access login page web config

This my web.config file:
<configuration>
<compilation debug="true" targetFramework="4.5"/>
<httpRuntime targetFramework="4.5"/>
<connectionString>
<add
name="ColMAX"
connectionString="data Source=SHANTHA;Initial Catalog=Billing_Test;Integrated Security=True"
providerName="System.Data.SqlClient"/>
</connectionString>
<system.web>
<compilation debug="true"/>
<authentication mode="Forms">
<forms
defaultUrl="~Default/.aspx"
loginUrl="~/Login.aspx"
slidingExpiration="true"
timeout="2880"></forms>
</authentication>
</system.web>
</configuration>
I can't access the login page. This is the error I get:
Detailed Error Information:
Module : IIS Web Core
Notification : Unknown
Handler :Not yet determined
Error Code :0x80070032
Config Error : The configuration section 'compilation' cannot be
read because it is missing a section declaration Config File
\?\c:\users\sudath\documents\visual studio
2013\Projects\Colombo\Colombo\web.config
I just start my project. Can anyone solve this ?
Update your Web.config as below.
<configuration>
<connectionString>
<add name="ColMAX" connectionString="data Source=SHANTHA;Initial Catalog=Billing_Test;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionString>
<system.web>
<compilation debug="true" targetFramework="4.5"/>
<httpRuntime targetFramework="4.5"/>
<authentication mode="Forms">
<forms defaultUrl="~Default/.aspx" loginUrl="~/Login.aspx" slidingExpiration="true" timeout="2880"></forms>
</authentication>
</system.web>
</configuration>
Registering Application Pool for .Net frameWork 4.5
Navigate to
C:\Windows\Microsoft.NET\Framework\v4.0.30319
Open the command window here (Ctrl + Shift + RightClick ) -> Open command Window here.
Type the below commad in the command window.
aspnet_regiis.exe -i
Hope this will fix your peoblem.

ASP.NET Website Administration tool not opening

When trying to use the Login Control from VB.NET and click on 'Administer Website' the T Website Administration tool is not opening.
Im using VS 2012 Professional and SQL-Server Express 2012
Any idea why this is happening?
Web.Config
<?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>
<connectionStrings>
<add name="ConnStringDb1" connectionString="Data Source=localhost;Initial Catalog=master_db;Integrated Security=True;" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.5"/>
<httpRuntime targetFramework="4.5"/>
</system.web>
<appSettings>
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None"/>
</appSettings>
</configuration>
Trying to enter the link manually into the browser:
http://localhost:64309/asp.netwebadminfiles/error.aspx
got me this error on the web page:
An error was encountered. Please return to the previous page and try again.
The problem was the Default browser used for the project.
It seems it doesn't work in Firefox, but when tried in IE, it works fine.

The server returns Compilation Error

I'm using the freebie plan on somee.com. About one month ago i first upload my asp.net website and it ran without any errors. Now i've made many change to the website with VS2010 and decide to upload a new version. But the server keep showing "Compilation Error" with message:
Compiler Error Message: CS1061: 'pwblog.BusinessObject.ArticleBo' does not contain a definition for 'FormatDate' and no extension method 'FormatDate' accepting a first argument of type 'pwblog.BusinessObject.ArticleBo' could be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 61: pagedDataSource.DataSource = articleBo.FormatDate(Articles);
Here is my FormatDate function:
internal Article[] FormatDate(Article[] source)
{
if (source != null && source.Length > 0)
{
foreach (Article art in source)
{
art.DatePost = DateTime.Parse(art.DatePost).ToShortDateString();
}
}
return source;
}
Actually there's no problem with the function. When I debug with VS2010 it runs well. The only difference I realize between the old one and this newly uploaded one is that I changed my MSSQL from 2008 SP2 to 2008 R2 SP2, due to the fact that I've changed my OS from windows 7 to windows 8.
Also, here's my web.config file:
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="AssignmentsFinalConnectionString" connectionString="workstation id=pwblog01.mssql.somee.com;packet size=4096;user id=pwblog;pwd=Duc123456;data source=pwblog01.mssql.somee.com;persist security info=False;initial catalog=pwblog01"
providerName="System.Data.SqlClient" />
<add name="AssignmentsFinalConnectionString1" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\AssignmentsFinal.mdf;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<authentication mode="Forms">
<forms name="MYWEBAPP.ASPXAUTH" loginUrl="Web\Login.aspx" protection="All" path="/" defaultUrl="Web\"/>
</authentication>
<authorization>
<allow users="*"/>
</authorization>
<compilation debug="true"/>
<globalization uiCulture="vi" culture="vi-VN"/>
<customErrors mode="Off" >
</customErrors>
</system.web>
<system.webServer>
<defaultDocument>
<files>
<add value="index.aspx" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
(pastebin)
Well, I don't believe that the MSSQL cause the problem, but I don't have any other clue. About the error, there's a very long detail messasge attached, so I don't put it here. So, any advice is appreciated. :)
It seems that you're using the function in a wrong way.
you're invoking it as if it was an Articlebo class method; or with an Articlebo instance argument instead of an Article array (I guess Articlebo inherits from Article)
you should post the wrong line anyway

Resources