3

I am just creating one application which is start Solr from code side using ASP.NET Web Application. http://localhost:8080/solr/admin/ this link working perfect but am i startup initialize from code side it's give me error like file not found exception so please help me

code line :: Startup.Init("http://localhost:8080/solr");

error message :: System.IO.FileNotFoundException Could not load file or assembly 'HttpWebAdapters, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Thanks.

Dhaval950
  • 81
  • 1
  • 8

1 Answers1

5

The exception says you're missing a reference to HttpWebAdapters, which is an assembly normally merged into SolrNet. All releases have this merged into SolrNet.dll, so I'm guessing you grabbed the source code, compiled it, but didn't run the merge target, and then didn't reference HttpWebAdapters.

Solutions:

  • use a binary release, or
  • if you need something that isn't released yet, use a nightly build from the build server, or
  • if you really need to build from source, make sure you run the merge target or include HttpWebAdapters.dll in your references.
Mauricio Scheffer
  • 98,863
  • 23
  • 192
  • 275
  • Mauricio, I got the same issue when I grabbed SOLRNET from nuget...It is possible the OP did the same – JP. Dec 12 '10 at 07:58
  • @JP: there was no NuGet package when the question was created. I just tested fetching from NuGet and it works. Can you create a new question with more details or post in the SolrNet mailing list? – Mauricio Scheffer Dec 12 '10 at 14:24
  • http://stackoverflow.com/questions/4423416/solrnet-could-not-load-file-or-assembly-httpwebadapters-when-pulling-from-nug – JP. Dec 12 '10 at 19:05