I’ve just got an error message that was somewhat unexpected:
Error Message: Could not load file or
assembly ‘Delete ReportingContents’ or
one of its dependencies. The located
assembly’s manifest definition does
not match the assembly reference.
(Exception from HRESULT: 0x80131040)
I’ve got an ASP.NET website that has abotu 10 projects makign it up which are compiled into DLLS and in the bin directory. ReportingContents is one of these projects. In the past I have had success in copying over a new version of the files (dll, pdb and xml) to the bin directory and recycled the app pool and it just picks up the new version on its own. This time I thought “I shouldn’t have a debug version on the site” so I built as release and just copied up the dll and xml files and asked our deployment people to remove the pdb.
When I was told it was all done I tried to access the site and got the above error message.
The thing that surprises me is that the assembly it mentions is “Delete ReportingContents” and I don’t know where the “Delete ” might have come from in there.
I’m not sure what could have gone wrong. so I’m hoping that you can help:
My options are:
1) I should have used a debug version since that is what was there already.
2) My deployment guy failed to delete the pdb that was no longer relevant.
3) The code wasn’t properly refreshed by the app pool recycle and it was expecting the old dll and getting the new one
4) Something went wrong elsewhere that really shouldn’t have done.
Any thoughts or suggestions greatly appreciated… I need to deploy this code and don’t really dare to do so again until I know what went wrong the first time…
Its worth mentioning that I only have access to the live environment through somebody else so I can’t easily check anything on there myself.
And in case its useful here is the accompanying stack trace:
Error Target: System.Reflection.Assembly _nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.Assembly, System.Threading.StackCrawlMark ByRef, Boolean, Boolean)
Stack Trace:
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)
It seems the answer was obvious in retrospect. Rather than deleting the files I wanted replaced he renamed them to “Delete ReportingContents” and then copied in the new ones. Of course this meant they got loaded and I assume complained that the filename wasn’t right or something like that. the upshot of it is that when I got him to delete them properly it all worked.