ASP.NET and Visual Studio - Adding project references vs Bin Folder DLL

后端 未结 5 2123
甜味超标
甜味超标 2021-02-14 19:32

I just started a new job yesterday and this is only my second job working in ASP.NET. We were setting up my dev box and were having trouble with some third party components like

5条回答
  •  心在旅途
    2021-02-14 19:52

    It depends on how your project is set up. If you want to precompile your site (and get Intellisense to work properly) you have to have a Visual Studio reference. But anything dropped in the bin folder will be automatically loaded by ASP.NET at runtime... so it's possible to access that assembly's controls/objects in code behind without adding a project reference.

    For small projects I just throw the DLL into the bin and add reference. For more complex sites/projects, I have a dedicated "library" folder for third party add-ons and code.

提交回复
热议问题