Could not load file or assembly 'StructureMap.2.6.1' or one of its dependencies .. ??

634 views
Skip to first unread message

Justin A

unread,
Feb 12, 2010, 6:37:55 AM2/12/10
to structuremap-users
Hi folks,

this is very embarassing - I can't get a stock ASP.NET MVC2 (RC1, not
RC2 .. the version that comes default with VS2010 RC) to work with SM
2.6.1

I get the following error when i 'run' my web site application :-

Server Error in '/' Application.
Could not load file or assembly 'StructureMap.2.6.1' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
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.

... etc...

Now, I've checked out nDepend with my version of SM 2.6.1. It's only
dependant on System, S.Web, S.Xml, S.Configuration and i think one
more .. which i had all of those referenced already. SM was also
referenced _AND_ it had Copy Local = true . I've also confirmed that
the dll is copied over to the bin directory of the site after a
compile.

The other projects also reference the same dll (that exists elsewhere
on the Hard Disk) with Copy Local = true, also.

Finally, i checked the GAC (ie. gacutil -l > c:\pewpew.txt) and
there's no StructureMap namespaces registered in there.

Finally, i tried adding the other two dll's that come with the
download, but that didn't help.

Can anyone have any suggestions?

Travis

unread,
Feb 12, 2010, 9:46:06 AM2/12/10
to structure...@googlegroups.com
Do you have any references to other assemblies that are not part of the .NET framework other than SM by chance?


--
You received this message because you are subscribed to the Google Groups "structuremap-users" group.
To post to this group, send email to structure...@googlegroups.com.
To unsubscribe from this group, send email to structuremap-us...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/structuremap-users?hl=en.


Justin A

unread,
Feb 12, 2010, 9:59:18 AM2/12/10
to structuremap-users
> Do you have any references to other assemblies that are not part of the .NET
> framework other than SM by chance?

Like, my own project assemblies in the solution? besides my own other
projects, i have Log4Net v 1.2.10.0, msnpsharp and
HibernatingRhinos.Profiler.Appender.

Travis

unread,
Feb 12, 2010, 10:09:17 AM2/12/10
to structure...@googlegroups.com
Make sure your other projects (and their dependencies) are compiled against 2.6.1, I had this problem when I had a small home grown utility library that was compiled against 2.6.0.


--

Justin A

unread,
Feb 12, 2010, 7:52:12 PM2/12/10
to structuremap-users
Yep - this was the very first thing i did. i also confirmed this by
checking the 'properties' on the SM reference, in the project. they
are all 2.6.1.0

:(

any other ideas?

Justin A

unread,
Feb 13, 2010, 6:13:24 AM2/13/10
to structuremap-users
Hmm. I think i've found the issue, but i'm not sure why. Maybe I
should take this up on StackOverflow cause it might not necesarily be
an SM issue.

i renamed the assembly from StructureMap.dll to StructureMap.2.6.1
then i used this renamed assembly. That's when it crashes. If i use
the assembly with it's original name, StructureMap.dll, then it works.

i can now replicate this issue :-

1. Install VS2010 RC
2. Create new ASP.NET MVC 2 web application
3. Run the default site -> it should work (funny that).
4. Add structuremap.dll reference, run site .. should still work.
5. rename the assembly to .. say .. structuremap.2.6.1.dll
6. Now, add structuremap v 2.6.1 assembly to the web site project
7. hit debug-run .. and boom. yellow screen of death with my error.

any ideas or thoughts?

Reply all
Reply to author
Forward
0 new messages