1

I am using Visual Stidio 2010 Beta 2 and just started using MVC, I copied a bunch of dlls into a Bin folder and Included this Bin folder in the project. It seems that there is no reference to these dlls from Controller classes?

Is this an MVC thing, or a broken project/VS installation?

Mark Redman
  • 24,079
  • 20
  • 92
  • 147

2 Answers2

2

What do you mean by "included this bin folder in the project", to add a reference, you need right click the project in visual studio, click "Add Reference", then add those dlls into your project. Is this what you are looking for?

J.W.
  • 17,991
  • 7
  • 43
  • 76
  • I would prefer to drop them in the Bin folder and have them auomatically referenced, in order to manage versions, than reference a 3rd folder. This does work in VS 2008? – Mark Redman Feb 11 '10 at 12:20
  • OK, I have used "Add Reference" and browsed to the Bin Folder and selected those? I now have reference to those dlls, but this seems wrong? Is this standard practice? – Mark Redman Feb 11 '10 at 12:29
  • You manage references by having something like a "libs" folder where you put all your references. Then when you add a reference you do it from that folder. If you update a reference in the "libs" folder and build the project, the new version will be used. This is usually the easiest way to handle references in a website as well. Because its better for source control tools (like svn or git). This has always been the behavior in a web application. – Mattias Jakobsson Feb 11 '10 at 12:31
  • @Mattias Jakobsson: Thanks, it looks like we will need to take this route. Should we add this Library folder into the App_Data folder so xml and other files remain non-accessible or deleted before deployment etc? Or should this not be part of the application repository? – Mark Redman Feb 11 '10 at 12:41
  • 1
    I usually put it outside of my project structure. I have it set up something like this: /[projectname] (solution file) /[projectname]/libs (all my dependencies) /[projectname]/[projectname].Web (the web application structure) And then one folder for each project I have (like a core class library that is in the same solution as my web project). – Mattias Jakobsson Feb 11 '10 at 12:45
  • just for info! what if we are to code / build / work on a project from commandline(have no access to IDE), how to reference dll then ? any idea ? – Asad Feb 11 '10 at 12:51
1

edit - J.W. answered as I was typing. :)

Instead of dropping them in the bin folder, try right clicking on "References" and adding them using the Browse... tab.

mark123
  • 1,065
  • 1
  • 11
  • 16