Showing posts with label Server Error in '/Rack' Application.. Show all posts
Showing posts with label Server Error in '/Rack' Application.. Show all posts

Monday, 19 August 2013

The type 'WcfServiceForInsert.Service1', provided as the Service attribute value in the ServiceHost directive could not be found.

Server Error in '/Rack' Application.

The type 'WCFService1.Service1', provided as the Service attribute value in the ServiceHost directive could not be found.

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.

Exception Details: System.InvalidOperationException: The type 'WcfServiceForInsert.Service1', provided as the Service attribute value in the ServiceHost directive could not be found.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Solution:-
               Check The Service1.svc file, The Service="WcfService1.Service1" Is Same As The Type Or Not. In The Above Error  The type 'WCFService1.Service1' not equal to Service="WcfService1.Service1". There Is A spell Mistake

<%@ ServiceHostLanguage="C#"Debug="true"Service="WcfService1.Service1"CodeBehind="Service1.svc.cs"%>

Service 'WCFService1.Service1' has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element.

Server Error in '/Rack' Application.


Service 'WCFService1.Service1' has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element.
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. 

Exception Details: System.InvalidOperationException: Service 'WCFService1.Service1' has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Solution:-
              Check The Name Of The behaviorConfiguration Of The <Service>tag In The Web.Config Is Same As The Project Name (i.e., Project Namespace) 

<services>
                  <service name="WcfService1.Service1" behaviorConfiguration="WcfService1.Service1Behavior">
                        <!-- Service Endpoints -->
                        <endpoint address="" binding="wsHttpBinding" contract="WcfService1.IService1">
                            
                              <identity>
                                    <dns value="localhost"/>
                              </identity>
                        </endpoint>
                        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
                  </service>

            </services>

The user instance login flag is not supported on this version of SQL Server. The connection will be closed.

Server Error in '/MyWebsite' Application.

The user instance login flag is not supported on this version of SQL Server. The connection will be closed.

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.

Exception Details: System.Data.SqlClient.SqlException: The user instance login flag is not supported on this version of SQL Server. The connection will be closed.

Source Error:


Line 15:     {
Line 16: SqlConnection con = new SqlConnection(@"Data Source=.\;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True;");
Line 17: con.Open();
Line 18: SqlCommand cmd = new SqlCommand("select COUNT(*)FROM regform WHERE username='" + TextBox1.Text + "' and password='" + TextBox2.Text + "'");
Line 19: cmd.Connection = con;

Source File: c:\Documents and Settings\Vamsi\My Documents\Downloads\WebSite10\login.aspx.cs    Line: 17 



Solution:-

              Check The SqlConnection Object's String Is Given Correct Or Not. 
I Had Given SqlConnection con = new SqlConnection(@"Data Source=.\;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True;");  Where I Did Not Mentioned DataSource Name As .\SQLExpress . So The Error Occured.
It Should Be As Below:
SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True;");

Wednesday, 24 July 2013

Control 'ctl00_ScriptManager1' of type 'ScriptManager' must be placed inside a form tag with runat=server.

Server Error in '/kasani' Application.


Control 'ctl00_ScriptManager1' of type 'ScriptManager' must be placed inside a form tag with runat=server.

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.

Exception Details: System.Web.HttpException: Control 'ctl00_ScriptManager1' of type 'ScriptManager' must be placed inside a form tag with runat=server.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Problem :  Here I Had Given ScriptManager In The Body Where There Is No runat="server" In The Tag, So The Error Occured

<body>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <form runat="server">
       
        ...
    </form>
</body>

Solution :  The ScriptManager Must Be Place Inside A Form tag With runat=server

<body>
    <form runat="server">
      
       <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

        ...
    </form>
</body>

Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Server Error in '/Imagesample1-ModalPopup' Application.

Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

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.

Exception Details: System.TypeLoadException: Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[TypeLoadException: Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.]
AjaxControlToolkit.ToolkitScriptManager.OnResolveScriptReference(ScriptReferenceEventArgs e) in c:\TeamCity\buildAgent\work\86982cda3515e83b\Server\AjaxControlToolkit\ToolkitScriptManager\ToolkitScriptManager.cs:276
System.Web.UI.ScriptManager.RegisterScripts() +261
System.Web.UI.ScriptManager.OnPagePreRenderComplete(Object sender, EventArgs e) +117
System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +2063008
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2247



Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433 
======================================================

Two Reasons To Cause This Error:

1.Install Framework 3.5 SP1 (Service Pack 1)
http://www.microsoft.com/en-us/download/confirmation.aspx?id=22

2. If you are using Ajax Control Toolkit then use ToolkitScriptManager

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<cc1:ToolkitScriptManager ID="ScriptManager1" runat="server"></cc1:ToolkitScriptManager >

or else use

<asp:ScriptManager ID="ScriptManager1" runat="server" > </asp:ScriptManager>

Download Ajax Control Toolkit And Add To Visual Studio ToolBox
http://www.asp.net/ajaxlibrary/act.ashx

Thursday, 18 July 2013

customErrors mode="Off"

Server Error in '/rack' Application.


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 <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>

To Rectify This, I Had Given defaultRedirect Attribute And Also The Custom Error Page URL's
i.e.,
<customErrors mode="Off" defaultRedirect="GenericErrorPage.htm">

            <error statusCode="403" redirect="NoAccess.htm" />

            <error statusCode="404" redirect="FileNotFound.htm" />

  </customErrors>

Wednesday, 17 July 2013

Server Error in '/Rack' Application

Server Error in '/Rack' Application.

A potentially dangerous Request.Form value was detected from the client (ctl00$ContentPlaceHolder1$txtAddress="&nbsp; <a href="QuestionAst...").

Description: ASP.NET has detected data in the request that is potentially dangerous because it might include HTML markup or script. The data might represent an attempt to compromise the security of your application, such as a cross-site scripting attack. If this type of input is appropriate in your application, you can include code in a web page to explicitly allow it. For more information, see http://go.microsoft.com/fwlink/?LinkID=212874.

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (ctl00$ContentPlaceHolder1$txtAddress="&nbsp; <a href="QuestionAst...").

Source Error:


[No relevant source lines]

Source File: c:\windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\182115aea\ee3235f91\App_Web_contact-details.aspx.cdcab7d2.-pbow_x8.0.cs    Line: 0

Stack Trace:


[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (ctl00$ContentPlaceHolder1$txtAddress="&nbsp; <a href="QuestionAst...").]
System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection) +9665149
System.Web.HttpRequest.ValidateHttpValueCollection(HttpValueCollection collection, RequestValidationSource requestCollection) +184
System.Web.HttpRequest.get_Form() +55
System.Web.HttpRequest.get_HasForm() +9666735
System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +95
System.Web.UI.Page.DeterminePostBackMode() +69
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6704
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +245
System.Web.UI.Page.ProcessRequest() +72
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +58
ASP.contact_details_aspx.ProcessRequest(HttpContext context) in c:\windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ver1\18153aea\ee323f91\App_Web_contact-details.aspx.cdcab7d2.-pbow_x8.0.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +341
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69



Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929 

This Error Occurs When I Type Special Characters In Text Box (i.e., <% = > etc)