Tuesday, April 28, 2015

IIS - Unable to start debugging on the web server. The address is not valid for this context

Issue:

I was unable to start debugging of web server or attach to process due of error:

Unable to start debugging on the web server. The address is not valid for this context.

Resolution:

I figure out that I need to Enable 32-Bit Applications in Application Pool settings:


Sunday, April 26, 2015

IIS 7.5 : HTTP Error 500.21 - Internal Server Error - Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list

Solution:


This is is because ASP.Net was not completely installed with IIS. 
To fix this, simply run the following command at the command prompt
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i
If I had been on a 32 bit system, it would have looked like the following:
%windir%\Microsoft.NET\Framework\v4.0.21006\aspnet_regiis.exe -i
Once this has been done, Restart IIS and run the web application. 




Friday, April 3, 2015

WCF REST Service Hosting Error : HTTP Error 500.21 - Internal Server Error


HTTP Error 500.21 - Internal Server Error
Handler "svc-Integrated" has a bad module "ManagedPipelineHandler" in its module list in IIS 7.5



Solution:

If you see this error you haven't installed the prerequisites for ASP.NET 4.

Try this:

Step 1. Open Visual Studio Command Prompt
Step 2. Type the following: aspnet_regiis.exe -i
Step 3. Run the command
Try your service again... it should be working :-)

This command basically installs the necessary ASP pieces to get your service up and working!

Sunday, September 14, 2014

Entity Framework 5 to 6 Conversion Error - Cannot implicitly convert type 'System.Data.EntityState' to 'System.Data.Entity.EntityState'. An explicit conversion exists (are you missing a cast?)

Problem scenario:

Entity Framework 5 to 6 Conversion Error - Cannot implicitly convert type 'System.Data.EntityState' to 'System.Data.Entity.EntityState'. An explicit conversion exists (are you missing a cast?)

Solution:

When you are using EF 6 or moving from EF 5 to EF 6, you should use System.Data.Entity.EntityState instead of System.Data.EntityState. This error happens when your project has reference to EF6 but you have code for EF5.

Sample Code in EF6

public virtual void Update(T entity)
{
   dbSet.Attach(entity);
   _unitOfWork.Db.Entry(entity).State = System.Data.Entity.EntityState.Modified;
   this._unitOfWork.Db.SaveChanges();
}

Monday, September 1, 2014

Hosting or deploying existing ASP.Net Web Application on Linux


Question: Will a .NET web application be able to run in a Linux based server? 

Yes, it is possible. The below URLs explains these possibilities. 

1. Achieve this functionality using GrassHopper tool:

2. You might also want to consider the below guide that helps Windows developers port their code to Mono/Linux:



Friday, August 22, 2014

HTTP (Hypertext Transfer Protocol)

HTTP (Hypertext Transfer Protocol) is the set of rules for transferring files (text, graphic images, sound, video, and other multimedia files) on the World Wide Web.

Web browser is an HTTP client, sending requests to server machines. As soon as a Web user opens their Web browser, the user is indirectly making use of HTTP. When we browse a web site using any browser (say Internet Explorer, Google Chrome, Mozilla Firefox etc.), all our actions produces HTTP requests; which are sent to the web server. Web Server replies to each of these requests. The browser uses these server responses/replies to build each page that web user see in its browser window. Some of the responses contain page text in form of HTML code, some contain images that we see on the page, and some carry additional data that is also used to display the page correctly.

Each HTTP request consists of 3 sections: request, header and body.

HTTP Methods

Two commonly used HTTP methods are GET and POST.
·      A GET-request is used to download a resource (page, image, etc.) from the server. GET-method requests data from a specified resource.
·      POST-requests are used to pass some data to the server. They can contain form data, a file that needs to be uploaded, etc. The POST-method submits data to be processed to a specified resource.

Both GET and POST requests can contain parameters. Each parameter has a name and a value; different ones are separated by “&”.

For GET-requests parameters are passed inside the URI after the “?” sign.
GET URL example:
http://my_uri/page.aspx?parameter_name1=value1&parameter_name2=value2 

If POST method is used, parameters are passed inside the request body.

Sunday, October 6, 2013

HTTP Error 403.14 - Forbidden - the web server is configured to not list the contents of this directory

Scenario:

In WCF, I was receiving the below error while trying to run the WCF client application.

HTTP Error 403.14 - Forbidden - the web server is configured to not list the contents of this directory

Solution:


Adding the below lines within the WCF Client application's web.config file, I could finally get rid of the issue and I could run the client application successfully..



VS Code # Warning - npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead

Error : VS Code - NPM Warning - npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead Solution:  Foll...