0

I am trying to write an application where I am using Ninject DI container for dependency injection. While building I keep getting this exception saying cannot find AssemblyNameRetriever.cs. How can I get this file into my application when it doesn't exist in the system? Also, there are many folders inside the Ninject folder all containing same 3 files..

  1. Ninject.dll
  2. Ninject.pdb
  3. Ninject.xml

Which .dll file of Ninject is actually being used? Forgot to mention: There is also Ninject.3.0.1.10.nupkg file which looks like it's a jar equivalent of java source files.

user3527975
  • 1,683
  • 8
  • 25
  • 43

1 Answers1

0

Well the file is located here: https://github.com/ninject/ninject/blob/master/src/Ninject/Modules/AssemblyNameRetriever.cs

Edit/Update: As it turns out Visual Studio was asking the OP for the file in debugging mode. Why? Because an exception occured in AssemblyNameRetriever.cs and VS wants to display the file so one can debug.

To fix the underlying issue, one does not need to download or get the source code (AssemblyNameRetriever.cs) file. The source might reveal additional information helpful in fixing the issue, but download it is not the fix. One should start with looking at the exception. In this case it pinpointed the issue to Ninject trying to load an assembly which dependend on MVC 3 - which was not present.

Community
  • 1
  • 1
BatteryBackupUnit
  • 12,934
  • 1
  • 42
  • 68
  • I didn't download the Ninject manually. I used visual studio's Nuget package manager to do it. It didn't download any source files, just the 3 files I have mentioned in my question post. Do I need to download the source files or the assemblies separately? PS: I did download the AssemblyNameRetriever.cs file from GitHub. Wasn't compatible with my application. It threw a bunch of exceptions – user3527975 Jul 08 '14 at 18:25
  • Ok. no you don't need to download any source files, or at least you should not need to. the nuget should be sufficient. It is strange though, that it says its missing the file. Could you make a screenshot of the error? – BatteryBackupUnit Jul 08 '14 at 18:45
  • http://stackoverflow.com/questions/24536792/an-exception-of-type-system-io-fileloadexception-occurred-in-ninject-dll-but-w – user3527975 Jul 08 '14 at 18:49