Wednesday, July 23, 2008

webdev.webserver.exe has stopped working

Yesterday I had opened up my Visual Studio 2008 solution which contains a couple of web sites, a WCF project, and some other project types. I am currently using the Cassini web server, since we have a couple of developers who do some work for us off an on and they share a single server using terminal services to do their work.

When I tried to browse a page in my site, I was prompted with a wonderful crash dialog indicating: webdev.webserver.exe has stopped working. This continued no matter how often I tried or rebooted.

I am not sure why the failure occured, but I noticed a coupled things:

  • A new web site in a new solution worked fine

  • My existing web sites in a new solution did not work

  • The event log had the following message: Fault bucket 158894065, type 5
    Event Name: CLR20r3
    Response: None
    Cab Id: 0

    Problem signature:
    P1: webdev.webserver.exe
    P2: 9.0.0.0
    P3: 4731664b
    P4: System
    P5: 2.0.0.0
    P6: 47577deb
    P7: 2c04
    P8: 40
    P9: System.Net.Sockets.Socket
    P10:



I am not sure of the relevance of P9 but I thought hmm could the port it was using be blocked. Running netstat -a did not show the ports in use but I decided to try and change the ports anyways.

Visual Studio stores all the project settings for a web site in the solution file. To change the default port for a web site you need to find the following line and edit it:

Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Project Name", "Project Name", "{3BD859EC-9AF2-4866-B43C-EE8AEFF0DF49}"
ProjectSection(WebsiteProperties) = preProject
...Addition project properties....
VWDPort = "58332"
EndProjectSection


After modifying it to use a different port Cassini had no issue launching. Hope someone else finds this helpful. And if you have any idea of additional things I should have looked at please leave a comment!


Edit
Editting a solution file is very easy. Find the solution file, and open it up in your favorite text editor. Then find the port setting setting, and edit it.

Monday, July 21, 2008

Fixing users in SQL2005 after restoring a DB

After you restore a database in SQL Server 2005 to a different server, you will need to fix the login associated with the users in the database this can be done by using the following stored procedure:

exec sp_change_users_login 'AUTO_FIX','UserName'


If you don't do this you will get an error while trying to login as the user. This needs to be done for each user in the database.

Friday, June 27, 2008

Wednesday, June 11, 2008

WSDL For WCF ASP.Net service uses local machine name Part II

Something I discovered while doing this is that a WCF service can only be hosted in a site which has a single binding. Based on some forum posts it sounded like this was by design. What this means is that if you are using for example multiple host headers to get to your site, you will not be able to host your WCF service in the web.

There was a blog posting which I have since lost which showed one potential solution which was to use filtering; however in my case I opted to split the service out from the rest of my web which was my original intent anyways.

- Josh

Monday, June 9, 2008

WSDL For WCF ASP.Net service uses local machine name

I've finally found myself with an opportunity to develop and deploy my first WCF service. I know I am several years behind the game but that's what happens when you work for a company which becomes stagnant in their adoption of technology (It is so nice to once again be back with a small and nimble startup).

There are some good articles on deploying a WCF service to IIS on MSDN. Which I recommend reading. I ran into an issue in the the wsdl for my service was using the localmachine name for all the bindings. The autogenerated page you get when you navigate to the .svc page said use: svcutil.exe http://[machinename]/MyService.svc to generate a proxy.

I discovered that in order to get the real URL in here (And within the WSDL for the imports), I needed to set a host header with my domain name. See KB 324287 for more information on how to do this. Once I had configured the host header I was all set.

If you need to do this for a service which is hosted on SSL, you can try the directions from the following blog which gave me the idea to try this for non-ssl ports.