.NET 3.5 issues on 64 bit Windows 2003 Server
Recently I decided to forgo using my laptop for developement and instead put together a brand new system that has six monitors and a dual core Intel 64 bit system. Since Vista would not install - I opted to go for Windows Server 2003 instead, as I will probably reire my older web server once 2008 comes out. A fresh install was done, with all of the updates and service packs.
I installed Visual Studio 2008 Beta - and everything was working fine, with exception when I tried launching my site / project in IIS> I got a :
Could not load file or assembly 'PresentationCore' or one of its
dependencies. An attempt was made to load a program with an incorrect
format.
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.BadImageFormatException: Could not load file or assembly
'PresentationCore' or one of its dependencies. An attempt was made to load a
program with an incorrect format.
This blog entry that most resembled my issue: http://blogs.msdn.com/heaths/archive/2007/07/13/kb928365-for-ms07-040-leaves-some-managed-applications-sluggish.aspx
While his issue and mine were different I ran the command he recommended:
%WINDIR%\Microsoft.NET\Framework\v2.0.50727\ngen.exe
executeQueuedItems
- and I kept getting a file not found exception, although it was obvious the queue had entries.
I changed the target directory to point to the 64 bit version of the framework:
%WINDIR%\Microsoft.NET\Framework64\v2.0.50727\ngen.exe
executeQueuedItems
That at least got rid of the queued items (That I didn't know about). But the problem persisted.
Finally, after a few hours of combing the net for a possible solution, I went into the bin directory of my application - and noted that a previous Beta .Net 3.0 runtime version of the PresentationCore.Dll was in the bin (how or why it was copied local - no idea - but it was there). Deleted the files and wallah - everything was back to normal.