The located assembly’s manifest definition does not match the assembly reference
September 30, 2006
I doubt that this post will really help anyone since the error message “Could not load file or assembly … or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference.” could be caused by any number of scenarios. However, I’ve gotten burned twice by the exact same scenario and have run around in circles for several hours total so I just wanted to make a note of it as a reminder to myself.
I can’t recall if both times it was dealing with the same projects and assemblies or not, but I kind of think it might have been the case. In the most recent scenario, I was having to rebuild the web controls assembly for the project we use for handling recurrence in MyHomePoint. Although it is a third party solution, the source code is provided and we have been in and out of the code several times making custom adjustments for our needs. In the recurrence project, we had replaced the standard date controls with date controls from another third party a while back with good luck. This time around, there was an update to the date controls project so we just needed to update the reference, rebuild the recurrence project, and then rebuild the MyHP web app. No big deal, right?
Except, that I kept getting the message that the manifest didn’t match the assembly reference when accessing certain pages (it builds just fine). OK, fair enough, we’ve got a number of moving parts at the moment so I probably didn’t have something in the correct place. Thus begins the process of verifying and re-verifying that everything looks correct.
Let me verify that I do indeed have the latest date control assembly… That looks OK, maybe I screwed up the reference on the recurrence project somehow… Let’s try adding the reference again… The test cycle takes five minutes once a change is made… Nope, that didn’t work. Maybe I’m not getting the new recurrence project into the web site (we have a one click build process which helps eliminate that uncertainty)… Everything seems to be OK. All the assemblies in /bin look correct… This verification and double-checking process repeats for a while, until it slowly starts to feel familiar. What was it that one time that this happened? I use TextPad and other methods to verify that the version info it is looking for isn’t embedded somewhere… No dice. Why isn’t this working?! After one round I notice that the Version of the date control assembly is not listed correctly in the recurrence reference properties. OK, I’m pretty sure I verified that. I’ll just update it (again) and rebuild… What? Why is it still not working? I updated the reference so the Version is correct. Except, it wasn’t. Hmmm. What’s going on here? Let’s try it again. Remove reference. Add reference. Navigate to the assembly I know I want (because I’ve already verified it 5 times). Click OK. Very interesting. Even though I know I went to the correct assembly, it still shows the wrong info. Why is that?
I examine the .csproj file and everything is as expected. The reference for that assembly is correct and the HintPath points to the correct location. By this time, I’m pretty sure it is something at the project/solution level so I just need to do a little more digging. I can’t imagine that the .csproj.user would have anything useful since that should just be settings specific to me. But what is this entry for ReferencePath? It has a number of paths listed to various assemblies and the last path listed is the location of our v1 of MyHP. I wonder if that setting could be causing the reference to point to the assembly in that location (even though I just navigated to the assembly I want and it is listed correctly in the .csproj file)? I could muck around with the file, but I’m just going to delete the .csproj.user file totally and let it get rebuilt. Close and re-open my project, and what do you know? The Version info is correct for the date assembly! Yay!
So, short version of all that is that if you are running into weird reference issues, you might consider double-checking what is in your project user file. Oh, and one final note: we are using the VS2005 Web Application project model, so not sure if this is something that would be specific to that, or also to the Web Site model as well.
Hope this helps! I know it will help me in the future.
Popularity: 4% [?]
Atlas for ASP.NET grows up
September 30, 2006
In case you missed it, a couple of weeks ago, Scott Guthrie posted the “Atlas” 1.0 Naming and Roadmap. In it, he mentions that Atlas will be a fully supported product with a ten year product lifetime, a 1.0 release should be coming soon, additional features are still planned, and marketing is staying busy giving it creative new names.
To follow up on Scott’s announcement, Rick Strahl has a good article about the current state of ATLAS. He talks objectively about where it currently is at and what needs to happen to get it where it needs to be. While not belaboring minute details, he does hit the highlights of what Atlas is currently doing well and what needs to be improved.
One interesting thing from Rick’s article is the following quote:
If you’re going down the AJAX path, JavaScript is going to become a more important part of your development environment. This will get easier when Orcas arrives, but in the meantime we have to struggle with the existing tools. Investing some time getting acquainted with JavaScript should probably be high on your list of skills to acquire as a Web developer. Learning about JavaScript object orientation, prototypes, function pointers, closures (an excellent reference can be found here: jibbering.com/faq/faq_notes/closures.html ) and a handful of other concepts specific to JavaScript is a prerequisite to use the ATLAS client library which uses some advanced concepts to provide abstraction and .NET like functionality.
I’ve been doing web development since 1995 and long ago became quite intimate with JavaScript and how to make it do all sorts of cool things (like AJAX back in early 2002 before it even had a name). Only recently as we have been trying to staff up for a project at my day job it has become very apparent that there is a whole generation of ASP.Net programmers that have completely relied on the framework to do the heavy lifting for them. Sometimes that can be good, but as with most things Microsoft, their controls tend to take you about 80% of the way towards your solution and then you need to look for ways to do it yourself. On my projects at my day job, we have taken great effort to separate the developer from the complexities of JavaScript. I’m not so sure why that is though. JavaScript is one of my favorite languages because of its simplicity and power. Granted, it is not always easy to work with since there weren’t any good editors or debuggers for so long, but you either baked your own, or now you can rely on some of the frameworks that are out there.
Popularity: 9% [?]
Baader-Meinhof encounter with the Q tag
September 27, 2006
I just had another Baader-Meinhof encounter today. At the time of my earlier post, I couldn’t think of any specific examples but made a mental note to try to keep track of any future occurences. What is really odd about this one is that it happened with something that I should have run across a long time ago. I’ve been doing web development/HTML wrangling since 1995 and only stumbled on the Q tag the other day. Somehow I completely missed it (probably because I really haven’t had a need for it and have gotten by just fine with the blockquote tag). Anyway, A List Apart had the Long Live the Q Tag article which first made me aware of it. Then, earlier today I was searching for something on Google and ran across another random reference to it, and then the same tonight.
I know it isn’t that big of a deal, but there are specific times when I run across something new and I make a mental note that that was new to me. Then the second incident happens and then by that time I am fully aware that there will probably be a third occurence in the very near future. Granted, that particular article on ALA could have spawned other conversations and threads that I might have run across since then, but from a distance, they don’t appear related and it just feels odd when it happens.
Popularity: 3% [?]
Community Server Search Fix
September 12, 2006
We got a question today in the MyHomePoint Bugs & Problems forum asking about the ability to search the forums. It seems that during the course of merging our application and Community Server content/blog/forum framework, that we opted to replace the standard Community Server login/register/search header with our own header with pointers to our own Log In and Demo functionality. Unfortunately, once we got our pieces in place, we neglected to relocate the Community Server search functionality down into the forums when we were done. Actually, that isn’t entirely true. Once I got to digging around in the code tonight, I realized that I did attempt to move the search functionality but ran into issues.
The way search works by default in CS, is that if you are at the root of the forums, then only a textbox and Search button were displayed. When you went into a forum, then the search changed to include a dropdown for the scope of the search. Using the dropdown, you could search either that particular forum, a top-level group, or the whole site. Overall, pretty nice functionality. When it was in the Title Bar.
Unfortunately, when I tried to move the search controls down into the Forum Master control, then everything kind of tanked. The dropdown rendered regardless of where you were at and it was always empty, and the Search button was missing it’s label. My assumption was that the code-behind for Search was tied to the Title Bar control, but at the time, we were working with a version of CS that didn’t come with the source code, so I had no way to verify that assumption or remedy the situation. And obviously with more pressing matters to deal with rolling out the application, it was soon forgotten. Until today.
Since we had upgraded to Community Server 2.1 a while back and they had released the source code for 2.0, it was pretty trivial to verify that the render and event logic for Search was tied to the Title Bar code-behind. However during the course of my experiments with whether or not search would work with only a textbox and button, I discovered that I wasn’t getting results for any of my searches, regardless of whether or not they came from my hacked version in the forums, or the original version from the header. Which brings me to the point of this post.
It appears that CS is using the String.GetHashCode() method to tokenize the posts as part of the search indexing process. Unfortunately, GetHashCode() is documented as potentially being inconsistent from one version of the CLR to the next. The justification is that from one version to the next, the internal algorithms could change for efficiency or performance (or whatever) reason. Jayson Knight does a far better job documenting the details of the issue and Rick Reszler provides the specific bit of SQL for truncating and getting everything ready to go to be re-indexed. Thanks guys for the posts. The only bit of extra information that I would pass along is that running the SQL does not immediately fix everything. You have to at least give it enough time to come back around and re-index the posts. In my case, it only took a couple of minutes before I was able to see that it was working.
While that solved our search results issue, it still didn’t solve the issue with the location of the search fields. In theory, we could get the source and make the appropriate changes to allow search to be where we wanted, but that is a lot of overhead and more than what we want to tackle at the moment. So, the quick fix is to just make a link to the search page and be done with it.
Fortunately, it took less time to solve the no search results problem than it did for me to write up this post (I used the Search on the CS forums), but I’ve been meaning to dedicate more time to posting solutions to tricky technical opportunities I run across. Hope the extra details help someone.
Popularity: 4% [?]