Showing posts with label IIS. Show all posts
Showing posts with label IIS. Show all posts

December 23, 2014

No service for type

Error:
An unhandled exception occurred while processing the request.
Exception: TODO: No service for type 'ABC.Services.XYZService' has been registered.
Microsoft.Framework.DependencyInjection.ServiceProviderExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)

Solution:
If you have a new Service in your ASP .Net vNext, you need to add below line in ConfigureServices(IServiceCollection services) function in Startup.cs for register it ;-)

services.AddTransient<XYZService>();

PS: At this time ASP .Net vNext, Visual Studio 2015 and MVC 6.0 are beta version.
Update 1: it could be solved with this services.AddScoped<XYZService>();

August 22, 2014

The service cannot be activated

Error:
The service cannot be activated because it does not support ASP.NET compatibility. ASP.NET compatibility is enabled for this application. Turn off ASP.NET compatibility mode in the web.config or add the AspNetCompatibilityRequirements attribute to the service type with RequirementsMode setting as 'Allowed' or 'Required'.

Solution:
Add this line in top your Service class
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]

February 20, 2014

How to stop browserLink

Questions:
- What's this browserLink in my ASP .Net Project
- What's arterySignalR?
- What's negotiate?requestUrl
- What's arterySignalR/negotiate
- What's arterySignalR/connect?transport=webSockets
- How to stop http://localhost:12661/5d47e5508b77496e916102d7e148ebad/arterySignalR/negotiate?requestUrl=http
- How to stop ws://localhost:12661/5d47e5508b77496e916102d7e148ebad/arterySignalR/connect?transport=webSockets


Solution:
It is a relationship between your Visual Studio and your web browser. This will allow to VS data exchange with browser and vise-verse. for stop this just go to Browser Link Icon in toolbar and unchecked Enable Browser Link like below image.



December 10, 2012

IIS 7.0 ERROR on ASP Classic


ERROR: 
An error occurred on the server when processing the URL. Please contact the system administrator.

SOLUTION:
Run this command on your server ;-)
%windir%\system32\inetsrv\appcmd set config -section:asp -scriptErrorSentToBrowser:true


April 13, 2011

Run JSP pages on windows

Problem:
- How to run a web server for jsp pages on windows
- How to make a windows to a web host for JSP pages.

Solution:
1- JVM: You must have a JVM. You can check default folder C:\Program Files\Java\ for find a jdk1.5.0_06 or jdk1.6.0_10 or any version of SUN’s JDK
2- Tomcat: You need to have Tomcat and you can check the default folder C:\Program Files\Apache Software Foundation\ for find a Tomcat 5.5 or Tomcat 7.0. Choose exe instead of zip file from core section in Tomcat download page. (I choose 32-bit/64-bit Windows Service Installer from core section and select FULL installation option in install process). After install you can see the something in http://localhost:8080/ ;-)
3- RUN: Goto C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps and make a folder and put your JSP files here ;-)

References:
JVM: http://java.sun.com/javase/downloads/index.jsp
TOMCAT: http://tomcat.apache.org/download-70.cgi

April 08, 2011

Authorization: Cannot verify access to path

Error:
Authorization Cannot verify access to path

Error Description:
The server is configured to use pass-through authentication with a built-in account to access the specified physical path. However, IIS Manager cannot verify whether the built-in account has access. Make sure that the application pool identity has Read access to the physical path. If this server is joined to a domain, and the application pool identity is NetworkService or LocalSystem, verify that \$ has Read access to the physical path. Then test these settings again.

Solution:
1- Open IIS 7.0
2- Select Default Web Site and Right-Click on it
3- Select Add Application... or Add Virtual Directory...
4- Select Contact as..
5- Change Path credentials: from Application user (pass-through authentication) to Specific user:
6- Add a Admin User with password like COMPUETRNAME\Administrator User

February 05, 2011

HTTP Error 403.14 - Forbidden

Error:
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
Internet Information Services 7.5

Cause:
If did you have ASP .NET Application on IIS 7.0 and in your ASP .NET Form/MVC used Routing or any handler for reroute/rewriting you need to have premession for access to files directories.

Solution A:
Add these lines to Web.config

<httpHandlers>
    <add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers>
<system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <handlers>
        <remove name="BlockViewHandler"/>
        <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
    </handlers>
</system.webServer>


Solution B:
The Solution A solved my HTTP Error 403.14 - Forbidden error but give me another error: HTTP Error 404.0 - Not Found. Replaced just this codes instead of Solution A code

<system.webServer>
  <modules runAllManagedModulesForAllRequests="true"> 
    <remove name="UrlRoutingModule"/> 
    <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
  </modules> 
</system.webServer>

May 23, 2010

SQL Express & Windows 7

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.

Error:
If you have a problem with Microsoft SQL Express & IIS on Windows 7 then follow this solution ...


Solution:
1- Run the Internet Information Services (IIS) Manager tool. This tool can be accessed either from the Administrative start menu, or by typing "inetmgr" in the Windows Start-->Search textbox and selecting the inetmgr tool.
2- In the left-hand pane of the IIS Manager tool expand the machine node.
3- Click on the "Application Pools" node so that the application pools display in the main window of the management tool.
4- If you are troubleshooting an ASP.NET 2.0/3.0/3.5 application select the "DefaultAppPool" application pool. For ASP.NET v4 select the "ASP.NET v4.0" application pool.
5- Right-click on the selected application pool and choose "Advanced Settings"
6- In the "Advanced Settings" dialog box find the category called "Process Model". The first row in the category will be the "Identity" row.
7- Click on the "Identity" row and then click on the small button that shows on the right-hand side of the value cell. The button displays the text "…"
8- A dialog box called "Application Pool Identity" will popup. Within that dialog box there are two radio buttons. Make sure the first radio button titled "Built-in Account" is selected.
9- In the dropdown box below the radio button choose "Network Service" for the identity.
10- Click "Ok" to close out the "Application Pool Identity" dialog box.
11- Click "Ok" to close out the "Advanced Settings" dialog box.
12- At this point the changes to the application pool identity will have been saved to IIS 7.5's configuration store.

Reference Link: http://support.microsoft.com/kb/2002980

February 22, 2010

Use Local IIS Web Server

If you have a problem with "Use Local IIS Web Server" in "Microsoft Visual Studio 2008" and Windows 7 or Windows Vista use this road map with solve it ...
trust me ... it's works

Problem:
Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path.
Please make sure the user has a local user profile on the computer.
The connection will be closed.

Solution:
Goto: Control Panel > System and Security > Administrative Tools > Internet Information Services (IIS) Manager
Then goto: Application Pools > Set Application Pool Defaults... > set Load User Profile toTrue


My Machine:
Windows 7.0
ASP .Net 2.0 (.Net 3.5)
SQLEXPRESS