tamaramata / solrnet

Automatically exported from code.google.com/p/solrnet
0 stars 0 forks source link

SolrNet fails to load with non-included StructureMap versions #126

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Start a web mvc project and include a newish version of structuremap (> 
2.5.4)
2. Configure structuremap and start the app, everything works fine
3. Add the 0.3.0b1 SolrNet assembly and reference it
4. Add SolrNet configuration as shown in docs:

x.AddRegistry(new SolrNetRegistry(solrConnectionString));

5. Start the app. You will receive an error that StructureMap cannot be loaded 
as the SolrNet is expecting StructureMap 2.5.4. 

What is the expected output? What do you see instead?
SolrNet should use any version of StructureMap and only throw an exception if 
there is an actual error.

Including the SolrNetRegistry file directly into my project and building with 
it seems to work correctly.

The application is ASP.NET MVC 2 on .NET 4.0 using VS2010.

Original issue reported on code.google.com by jar...@gmail.com on 1 Dec 2010 at 12:22

GoogleCodeExporter commented 8 years ago
StructureMap is strongly named, which fixes the version of the reference. The 
only way around this would be to write the SolrNetRegistry using reflection to 
avoid having a static dependency on StructureMap's types, but IMHO that's a 
hack. 
SolrNet master (the latest revision in git) currently builds against 
StructureMap 2.6.1. After it's released, it will be up to StructureMap to 
decide if a future version of StructureMap will be backwards-compatible with 
2.6.1. If they decide to change the assembly version, compatibility will be 
broken.

Original comment by mauricio...@gmail.com on 1 Dec 2010 at 2:27

GoogleCodeExporter commented 8 years ago
Fair enough. The reflection option is definitely a hack. 

I guess I could do an assembly redirect, but I assume that would have to be in 
my app. I'll give that a shot.

Original comment by jar...@gmail.com on 1 Dec 2010 at 2:39

GoogleCodeExporter commented 8 years ago
Yup, assembly redirection would work too (if there aren't any real breaking 
changes in StructureMap)

Original comment by mauricio...@gmail.com on 1 Dec 2010 at 10:53

GoogleCodeExporter commented 8 years ago

Original comment by mauricio...@gmail.com on 1 Dec 2010 at 10:53