Monday, June 15, 2009

Web Services - Can not generate temporary class

Activation fails or you notice an error in your logs that looks like the following:

System.InvalidOperationException: Unable to generate a temporary class (result=1).
error CS2001: Source file 'C:\WINDOWS\TEMP\0kvvmynh.0.cs' could not be found
error CS2008: No inputs specified

(Note, the source file is randomly generated)

You may also see the error "'There was a problem with activation. Verify that the product key you entered is correct, and that it is for this version of [ProductName]" when activating.

Cause:

This exception occurs when the system cannot write necessary temporary files when executing web service calls.

Resolution:

Grant the user account that the web interface is running under List Folder Contents and Read permissions on the %windir%\Temp folder. Usually this is the "ASPNET" or "Network Service" user.

More Information:

http://support.microsoft.com/kb/908158

Friday, May 29, 2009

ASP.NET Gotchas

Some gotchas that have caused me to waste so many hours on so many projects:

1) Many CSS features, such as "margin: 0 auto;" will not work unless you have the correct !DOCTYPE:

!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"


2) When migrating from VS2003 to VS2005, the migration tool will add this piece of evil into your web.config:

xhtmlConformance mode="Legacy"

This will prevent AJAX from working. Ridiculous!

See here for Scott's explanation:
http://weblogs.asp.net/scottgu/archive/2006/12/10/gotcha-don-t-use-xhtmlconformance-mode-legacy-with-asp-net-ajax.aspx

3) HTTPModules can cause all client side validation scripts to stop working. I don't have any answer on how to fix the problem...sorry. But if you requiredfieldvalidators don't work - it's something to check.

4) runat=server :)