The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Odd behavior in ASP.NET

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Samer Ibrahim

Posts: 55
Nickname: ibrahimss
Registered: Aug, 2003

Samer Ibrahim is a .NET programmer... I really don't want a long bio
Odd behavior in ASP.NET Posted: May 4, 2004 8:17 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Samer Ibrahim.
Original Post: Odd behavior in ASP.NET
Feed Title: Samer Ibrahim's Blog
Feed URL: http://www.asp.net/err404.htm?aspxerrorpath=/SIbrahim/Rss.aspx
Feed Description: The Samer I Warrior on battles with .NET
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Samer Ibrahim
Latest Posts From Samer Ibrahim's Blog

Advertisement

So after wasting about an hour and a half debugging why in the world I kept getting an invalid cast exception, I discovered a quirk in the way ASP.NET loads assemblies.  Apparently, the .NET framework loads everything in the \bin directory that even looks like a DLL.  For example, if you have a file called DLL_ the framework will load it anyway.  Why the hell it does this I don't know!!!  It's not even a DLL for God's sake!

Now you might be wondering why in the world I have a file called DLL_ sitting in my \bin directory but that's easy to explain.  Sometimes I want to use a different compilation of a DLL that might contain something like more debugging code, for example, in my ASP.NET application.  So instead of moving or overwriting the old version or recompiling my application or even changing which version is redirected to what other version in the config file, I simply change the old DLL to DLL_ or something of the like and drop the new DLL in the \bin directory along side of it.  Seems harmless and should work and in fact it does when .NET isn't being stupid and just loads DLLs. 

I spent all this time trying to figure out this problem, changing the code I was debugging over and over again, and when I finally said what the hell let me see what the code base is for DLL which contains the class I'm trying to cast to, I saw that it was <Path>\SomeAssembly.DLL_.  This is a bug as far as I'm concerned.  And as far as I can tell, there is simply no application for this type of behavior so I'll just call it retarded.

By the way when I say ASP.NET, I'm working with SharePoint specifically.

Read: Odd behavior in ASP.NET

Topic: MT-Blacklist Installed Previous Topic   Next Topic Topic: Microsoft WinDays 2004 is over

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use