0

Deploying Asp.Net to a different time zone, Temporal Future Shock! Specified argument was out of the range of valid values. Parameter name: utcDate

by Jon 17. December 2010 09:57

You would have never of thought it but if you compile ASP.NET in a different timezone you could cause yourself some temporal problems.  I recently discovered that parts of ASP.NET are date specific and if you compile an ASP.NET application in one timezone (The UK), and deploy to another timezone (California) you may find that your web application won’t work correctly until the time catches up.  Its all to do with the date stamp in the assemblies, when you install your application onto a server in california the timestamps on the assembly files may be in the future and parts of the ASP.NET framework will refuse to load them.  Just by waiting 8 hours for time to catch up the problem will resolve itself!  Its defiantly worth saying this doesn’t effect all server setups I had no problems with a customer running server 2008 in a different timezone, I only came across this problem with an AJAX enabled system when a customer was running server 2003, but I haven’t had time to test different scenarios

I installed the application the AJAX was ‘working’ however nothing was styling correctly

I viewed the source of the page and started debugging by copying the WebResource.xsd url into different tab, I was surprised to see the following error:

Server Error in '/' Application.

Specified argument was out of the range of valid values.
Parameter name: utcDate

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.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: utcDate
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.

I returned to the system after 8 hours and the site was working and the error was gone! Be careful out there, this was a fully patched server 2003!

Tags: , , , , , , ,

asp.net | Deploy | development | General | IIS | Maintanance | TechSupport | vs2010

0

500.19 Internal Server Error, There is a duplicate ‘system.web.extensions /scripting /scriptResourceHandler’

by Jon 29. October 2010 22:22

Http Error 500.19 There is a duplicate ‘system.web.extensions/scripting/scriptResourceHandler’

After shipping your asp.net 2.0, 3.0 or 3.5 application to a new server you get the following error:

There is a duplicate ‘system.web.extensions/scripting/scriptResourceHandler’

Don’t worry you haven’t done anything wrong, your are just trying to ship to a new server that has been configured to use .NET 4.0 as the default, and lucky for you it is a quick and simple configuration change to fix it:

Change Application Pool to .Net Framework v2.0

  • Open Internet Information Services (IIS) Manager
  • Goto the Application Pools screen
  • Open the Application Pool offending web application(s) are using
  • Change the Application Pool to use dotnet 2.0 instead of .net 4.0
  • Hard Refresh the erroring page with a <Ctrl> F5

Tags: , , , , , , , ,

asp.net | Deploy | IIS | TechSupport

0

Could not load file or assembly <AssemblyName> or one of its dependencies. An attempt was made to load a program with an incorrect format

by Jon 16. September 2010 22:00

One of the recurring problems I get when installing our ASP.Net system onto customers servers is this cryptic error:

Could not load file or assembly <AssemblyName> or one of its dependencies.  An attempt was made to load a program with an incorrect format

 

The first time I saw it it really stumped me for a couple of hours to find what the problem was, the stack trace, nothing made any sence.  I eventually tracked the only difference down to the server being 64bit.  IIS can run an asp.net application in either 64 or 32bit mode and most people leave both 32bit and 64bit support enabled when they compile there ASP.Net to automatically give them improved performance on a 64bit machine.  Unfortunatly if you are using a 3rd party componant that is older, perhaps an old non managed library it is more likely to be compiled for 32bit exclusivly.  This 3rd party library means your entire application wont be able to run in 32bit mode, and to make matters worse IIS running under 64bit has 32bit support disabled by default and your Compiled code will attempt to run in 64bits, which in turn causes the nasty error message above.

There are one of two solutions:

1. find the offending library and remove it from your Web Application

2. Enable 32bit support in IIS.  

a. Go to Application Pools in IIS
b. Right click on the relevant application pool
c. Press advanced settings
d. Set Enable 32-Bit Applications to True
e. Restart the Application Pool

This quick fix will buy you time so you can remove the offending library at your leisure

Tags: , , ,

asp.net | development | IIS | TechSupport

0

Getting Started with Continuous Integration with TeamCity in under 5 minutes!

by Jon 31. August 2010 22:17

Continuous integration is a way of increasing your productivity by automating the repetitive tasks you perform each day and as a function will improve the quality of the code you check into your source control system. It will give you more free time to develop better code, and will help you constantly improve yourself. If you find yourself doing the same thing day after day as a developer you really start automating those steps.

The good thing is it is really easy to setup a Continuous Integration. Within 5 minutes you could have installed and configured a system that will automatically compiled your code on a server when you perform a check-in and have any problems automatically reported back to you! What are you waiting for:

Make sure you choose a free TCP Port
Make sure you choose a free TCP port

Confirm the url for the Team City Installation has the correct port
Confirm the url for the Team City Installation has the correct port

Start the Services, and start TeamCity
Start the Services, and start TeamCity

Team City Starts
Team City Start

Accept the licence
Accept the licence

Enter an administrators details
Enter an administrators details

Team City is Started, and is prompting you to create a project
Team City is Started

Enter a project name
Enter a project name

Create a Build Configuration Called Build
Create a Build Configuration Called Build

Enter your SVN Settings for the project
Enter your SVN Settings for the project

Test the SVN Connection
Test the SVN Connection

Choose VisualStudio (2005/2008 or 2010) as a Build Runner, and Enter the Solution you want to Build
Choose VisualStudio as a Build Runner, and Enter the Solution you want to Build

Confirm the solution Builds from the Projects Screen, and then edit the Build
Confirm the solution Builds from the Projects Screen, and then edit the Build

Set the build to be automatically triggered when you Commit changes to SVN
Set the build to be automatically triggered when you Commit changes to SVN

and that's it, your Continuous Integration Server is up and running. Every time you commit a code change to SVN your solution will be automatically compiled. The sky is the limit, you can move over to a MSBuild Build Runner, perform automated tests, Generate Documentation, Code Statistics, Build and Install Deployment Packages. I've only just started using CI/TeamCity in my day job but I plan to Blog about my experiences as I implement more features. So far I have moved the office Build over to msBuild, automated developer statistics and RSS feed, and automated deployment to our test server. So expect some Blog entries on this in the coming weeks...
0

Dotnet Gets it wrong sometimes: 'mycontrol_ascx' is ambiguous in the namespace '_ASP'

by Jon 7. June 2010 16:27

When compiling larger more complicated ASP.Net projects which contain lots of user controls dotnet can get it wrong.  Im running the latest version of vs2008 with all the last patches but I still get occasional niggles.  Ive been getting an error telling me a control is ambiguous when I know it is totally unique.  The solution appears to be to tell the compiler to stop being quite so clever:

Find this, or a similar line in your web.config:

<compilation debug="false" />

Modify it and add batch="false", this stops the compiler being too clever.

<compilation debug="false" batch="false" />

Tags: ,

asp.net | General | vs2010

Powered by BlogEngine.NET 2.0.0.36
Original Design by Laptop Geek, Adapted by onesoft, and finally some tiny tweaks by JonAlb