Running ASP.NET Development Server Without Virtual Path, From Root#

I had been looking for a way to get the asp.net development server to run w/o a virtual directory settings.  It's really very stupid and short sighted to not enable this.  Just about every project I have ever worked on has some paths coded into the HTML that are based on / being the root, not the application root.  Stupid.

 

Anyway, ScottGu posted these steps on his site, and it works.  Not bad!

Step 1: Select the “Tools->External Tools” menu option in VS or Visual Web Developer.  This will allow you to configure and add new menu items to your Tools menu.

 

Step 2: Click the “Add” button to add a new external tool menu item.  Name it “WebServer on Port 8080” (or anything else you want).

 

Step 3: For the “Command” textbox setting enter this value: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\WebDev.WebServer.EXE (note: this points to the web-server that VS usually automatically runs).

 

Step 4: For the “Arguments” textbox setting enter this value: /port:8080 /path:$(ProjectDir)

 

Step 5: Select the “Use Output Window” checkbox (this will prevent the command-shell window from popping up.

 

 Once you hit apply and ok you will now have a new menu item in your “Tools” menu called “WebServer on Port 8080”.  You can now select any web project in your solution and then choose this menu option to launch a web-server that has a root site on port 8080 (or whatever other port you want) for the project.

 

You can then connect to this site in a browser by simply saying http://localhost:8080/.  All root based references will work fine.

 

Step 6: The last step is to configure your web project to automatically reference this web-server when you run or debug a site instead of launching the built-in web-server itself.  To-do this, select your web-project in the solution explorer, right click and select “property pages”.  Select the “start options” setting on the left, and under server change the radio button value from the default (which is use built-in webserver) to instead be “Use custom server”.  Then set the Base URL value to be: http://localhost:8080/

Categories:  |  | 
Wednesday, April 12, 2006 12:42:57 PM (Central Standard Time, UTC-06:00) #    Comments [2]  | 

 

Databinding in .Net 2.0 (DNR TV)#

Brian Noyes is the guest on DNR TV to cover databinding in .Net 2.0.

The video can bee seen here.

Categories:  |  | 
Monday, April 10, 2006 5:26:51 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Project References vs. Assembly References#
In our current applications we are using Assembly References so that you can load up a project without needing to load up every project it references, and all the ones that they reference and on and on.

However MS suggests that you use Project References whenever possible, so I think when we cut over to TFS we will be switching to project references.
Categories:
Thursday, March 23, 2006 4:41:08 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

SqlDependency#
I am at a Developer event at Microsoft right now, and the presenter just talked about some a way to setup a dependency on some data from sql server.

He didn't go over it much, but it is something I should look into a bit more.

I would guess it needs to poll the DB or something, will be interesting to see how it works.
Categories:
Thursday, March 23, 2006 2:06:12 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Returning Business Objects from .NET Web Services#
There are times when it would be nice to pass a business object over a webservice and consume it on the other side.

This is made somewhat complex by microsoft auto generated proxy system that builds a stripped down version of you object for the client to consume.

You can manually go in and modify the proxy class files, which is what I had done, but now there are some other options available to you to achieve this. This article talks about how you can get customize the proxy creation, so that you can auto generate your proxies whenever you want, and you won't lose your custom code.

Here is another possible solution. But the latter link looks like it is doing a lot of mapping with the use of a wrapper class. A lot more work that I would want to do probably.
Categories:
Thursday, March 16, 2006 12:43:31 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Unit testing of Data Access Layer code#
One of the parts where Unit testing seems to fall apart, or become a giant pain at least, is in applications or parts of applications that rely heavily on data access from a large relational database like sql server.

You run some operations against the database and end up with a result set. Is that result set right? Ok it looks good, now what? Well some people would say that you should restore the DB to the point before you started this last test. This can be very painful if you are trying to run hundreds, or even simply dozens of tests.

In this article on MSDN the author goes over some options for avoiding the use of database restore. There is some talk about using mock objects in conjunction with NMock, which of course Fowler would like to remind you aren't stubs, but the majority of the article focuses on the use of DTC to rollback changes made in each test teardown.

I had some problems getting DTC to run across machines, but it worked great locally, so there was some success in my tests.
Categories:
Thursday, March 16, 2006 12:37:19 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Synchronizing the ASP.NET Cache across AppDomains and Web Farms#
This article covers an interesting topic that has shown itself in my current project: using the Cache across appdomains and web farms.

In the end his solution is basically to create a mechanism to write out cache information to files that each app domain watches for changes (or so I gleamed from glancing over it) but in our case we are storing little bits and pieces and not large things. In other words, the added overhead of reading/writing to the filesystem would probably eliminate the benefit of using the cache for our application.
Categories:
Tuesday, December 06, 2005 8:36:20 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

ASP.NET throwing OutOfMemoryException around 800+ MB, regardless of available memory#
I just read this article which seems to describe the situation I am seeing today with our application.

The solution is to boot the computer with the /3GB option to allow ASP.NET to use more memory, but I think we only have 2GB in the machine. Will need to investigate.
Categories:
Monday, December 05, 2005 4:09:23 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

NUnitASP#
I have been messing around with NUnitASP a little, it is not exactly perfect.

I haven't been able to find out if there is anything in TFS testing that can do what it does.
Categories:
Monday, December 05, 2005 2:30:53 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Expinion.net#
Expinion.net has some interesting controls.

Mainly the one I am interested in is the multi calendar control. I have no idea if these work with asp.net or not, I will need to check it out.
Categories:
Monday, December 05, 2005 1:46:28 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

GoogleRankings.com#
Google Rankings, is a pretty cool website.

You can enter a phrase and your site and it will tell you where you come up on the index. I know these are not 100% accurate in the sense that a search one day could be very different from a search the other day depending on which set of servers you hit, but it can give you some idea of where you stand.
Categories:
Monday, December 05, 2005 1:43:03 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Psyco Printer#
One of my clients was having a problem where every now and then a print job would fail, and it would eventually cause the server to die.

I found some info here: spoolsv.exe.

Stopping and restarting the print spoler service did the trick, I didn't need to clean out the files from the print attempt.
Categories:
Monday, October 03, 2005 10:57:42 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Binary Representation of Decimal Values#
More decimal issues, but unrelated to the SQL stuff. The problem being that numbers like 1/10 can be easily displayed in base 10 as 0.1. But, in base 10 we have problems with numbers like 1/3, .3333333333. Well, in binary, they have problems with some of our decimal numbers that you wouldn't expect. e.g. 0.4 - 0.1 = 0.30000000000000000000004 while 1.4-1.1 = 0.29999999999999999999998.

The problem here is with rounding. I wrote a quick JS function to round these numbers to a significant number of digits.
Categories:
Thursday, September 29, 2005 6:50:28 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

SQL Server's Stupid "Decimal" DataType#

Ok so, on a recent project, for some reason, I set up a few fields, and the corrosponding SP parameters as "decimal" datatypes. What a mistake.

After lots of rounding errors, which were partly ignored because the revised "specs" called for these figures to be integers (later changed to decimals), I found out that a Decimal datatype has no decimal places, unless you specifically declare it.

The reason for this is that a "decimal" is really just another name for a "numeric". So I guess I can understand that part... but how dumb is it that a decimal, by default, has no decimal places.

I went back and changed everything to float.

Use decimal(x,x) instead of float.  See here for the reason why.

Categories:  |  |  | 
Tuesday, September 27, 2005 8:42:13 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

The destruction of my ugly bar#
When my wife and I first moved into our house, the first thing we wanted to do was get rid of this ugly, and seemingly useless bar in our basement.

To be honest I have no idea what anyone would have done with this thing, but at some point someone spent a lot of time to install this thing.

The day finally came when I decided it was time to take action (mostly because I have to sell my house very quickly and this thing is ugly).

I wish I had some "before" pictures, but I didn't think about that when I started.


Some of the junk that was removed, awaiting disposal.



The newly freed space. We are going to make this where we put our TV and stuff.



This was the most interesting part for me. I had to cut some pipes running to the sink in the bar and sweat on a cap. I had never done this before so it wasn't that easy, and it was made even harder by the fact that I had about 18" of space to work with in this area behind the bar. But, it's finally done.
Categories:
Friday, September 23, 2005 7:20:18 AM (Central Standard Time, UTC-06:00) #    Comments [1]  | 

 

More on AssemblyVersion and AssemblyFileVersion#
I just came across this post by Carlos J. Quintero, a .net MVP.

He explains basically what I have been encountering in dealing with versioning of assemblies.

He even points out the bug I found with auto incrementing the AssemblyFileVersion number.
Carlos J. Quintero [.NET MVP] Jun 23, 3:34 am

Newsgroups: microsoft.public.dotnet.framework
From: "Carlos J. Quintero [.NET MVP]" <carl...@NOSPAMsogecable.com> - Find messages by this author
Date: Thu, 23 Jun 2005 10:34:05 +0200
Local: Thurs, Jun 23 2005 3:34 am
Subject: Re: AssemblyVersion numbers and recompiling code
Reply to Author | Forward | Print | Individual Message | Show original | Report Abuse

Hi Joe,


There are 2 versions that you need to take care of:


1) The version of the file: this is the version of "classic" Win32
applications or DLLs, that is, the one shown using the Properties dialog of
Windows Explorer.


It is set with the AssemblyFileVersion attribute in AssemblyInfo.vb file:


<Assembly: AssemblyFileVersion("1.0.2.4")­>


Notice that this attribute is not written by default when the file is
created so you need to add it by hand.


This is the version that should be autoincremented but, alas, using "1.0.*"
does not autoincrement it in each build. I would say this is a bug.


2) The version of the assembly: this is the version of .NET assemblies,
which is different than the file version. That is, this is the version shown
in the Property dialog of the GAC in the first tab (the second tab shows the
file version). For example, in Net Framework 1.1, System.Windows.Forms has a
file version 1.1.4322.573 and an assembly version 1.0.5000.0


It is set with the AssemblyVersion attribute in AssemblyInfo.vb file:


<Assembly: AssemblyVersion("1.0.0.0")>



Notice that this attribute is written by default when the file is created so
you don´t need to add it by hand.


This is the version that can be autoincremented using "1.0.*" but generally
you don´t want to do this because you want to keep the same assembly version
in each build until you break the backwards compatibility. I would say that
this autoincrement feature is another bug.


So:


- Change always the AssemblyFileVersion on each build.


- Change the AssemblyVersion only if you are breaking the backwards
compatibility. Do not change it for bug fixes or other minor INTERNAL
changes which won´t break clients.


- Clients can be configured through a config file to run against an exact
dll a.b.c.d or with any a.b.* build number (provided that major and minor
digits don´t change). See the .NET Framework docs about this.


--
Best regards,


Carlos J. Quintero
Categories:
Monday, September 19, 2005 10:14:55 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

The LINQ Project#
The LINQ Project is a codename for a set of extensions to the .NET Framework that encompass language-integrated query, set, and transform operations. It extends C# and Visual Basic with native language syntax for queries and provides class libraries to take advantage of these capabilities.
Categories:
Monday, September 19, 2005 8:45:31 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

AJAX in ASP.NET 2.0, code name "Atlas"#
I have already been rolling my own AJAX based controls (and they are sweet, I have to say I am very proud of how OO I was able to make them on the client side). Microsoft has a set of extensions that are supposed to let you do this stuff with asp.net called Atlas. They have a website set up to talk about some of the specifics.
Categories:
Monday, September 19, 2005 8:30:28 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

FSBO#
I am still working through all the FSBO crap.

It seems that http://www.buyowner.com/ doesn't put your site in any MLS, so it doesn't show up on ChicagoTribune.com or Realtor.com.
http://www.listmefree.com looks like they DO put you in the MLS, but you have to pay a buyers commission.
This site, which I think is just an alias of nuwaymls.com seems to suggest that they get your house in the MLS and Realtor.com but you don't work with realtors to do the selling... but you use a realtor to list it?
Categories:
Sunday, September 18, 2005 10:58:32 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Device Mounts For Cars#
My brother showed me http://www.proclipusa.com/ today. It's pretty cool. They have a bunch of different clips that fit all kinds of cars and devices.
Categories:
Sunday, September 18, 2005 10:21:58 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Code Access Security#
In a project I am working on, one of the requirements was that the application be allowed to browse its own pages (e.g. programatically open up a web request and browse the html pages that are served up by the site).

Anyway, this permission is not allowed on the hosting environment they decided to use. This page talks about the permissions available in ASP.NET 2.0, and the different levels of security you can set on applications.
Categories:
Sunday, September 18, 2005 7:41:17 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Resetting a Cisco Password 2#
Here is the documentation from Cisco, but again I don't see anything about if it resets everything
Categories:
Friday, September 16, 2005 9:29:58 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Resetting a Cisco Password#
This article is supposed to show you how to reset the password from the terminal on a cisco router. Not sure if it will work or if it will erase the config. I will need to find out.
Categories:
Friday, September 16, 2005 9:29:26 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

DLL Hell a possible solution (repost)#
After making some newsgroup postings and researching a bit. I found out some info that might be a contributing factor to our problems with assemblies getting referenced correctly. In our assemblyinfo file we are auto incrementing the AssemblyVersion . From my reading, this attribute is actually meant to BREAK combatibility. What we need to be using is the AssemblyFileVersion. This can be incremented w/o breaking compatibility and still help us figure out what DLL we are dealing with (which version). This blog has an entry about it.

Note: I had to repost because I accidently used some tags in my article that don't show up.
Categories:
Thursday, September 15, 2005 9:29:08 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

DLL Hell, a possible solution#
After making some newsgroup postings and researching a bit. I found out some info that might be a contributing factor to our problems with assemblies getting referenced correctly.

In our assemblyinfo file we are auto incrementing the . From my reading, this attribute is actually meant to BREAK combatibility. What we need to be using is the This can be incremented w/o breaking compatibility and still help us figure out what DLL we are dealing with (which version).

This blog has an entry about it.
Categories:
Thursday, September 15, 2005 8:34:56 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

How Assembiles Are Located#
This article on MSDN details how assemblies are located by the Runtime.