I am currently developing a web application using ASP.NET MVC and incorporating Castle MikroKernel as my dependency injection container. While I have prior experience with MikroKernel, I encountered an issue this time – the property injection wasn't functioning as expected. It's worth noting that I create a custom XML schema to meet my specific requirements, and I do not utilize Windsor's XmlInterpreter class.
I was confident that my component registration was correct, but I discovered that every time I built my application, I had to close the existing Cassini web server. Upon attempting to open my web, I received an error stating that one of my assemblies was still in use by another process. This led me to suspect an issue with my dynamic loading. Upon reviewing my previous work, I noticed that I had used Assembly.LoadFrom instead of Assembly.LoadFile to load my plugins. Despite their apparent similarity, could there be a difference between the two?
Upon conducting a search, I came across the following advice:
"Never use Assembly.LoadFile() directly. If you know the location of the assembly, use LoadFrom(). Alternatively, use Load() and let .NET determine the assembly's location. Using Load() is preferable but may necessitate a .config file to assist .NET in locating the assembly."