ASP.NET和Visual Studio - 添加项目引用VS bin文件夹中的DLL [英] ASP.NET and Visual Studio - Adding project references vs Bin Folder DLL

查看:1073
本文介绍了ASP.NET和Visual Studio - 添加项目引用VS bin文件夹中的DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚昨天开始了新的工作,这只是我的第二份工作在ASP.NET工作。我们设置了我的开发框并与像Telerik的一些第三方组件的麻烦,等我注意到,他们安装了这些第三方工具,追捕DLL文件,将它们复制到bin,然后加入到参考它指向的BIN的文件的项目。对我来说,这似乎是正常的做法并没有。

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 Telerik, etc. I was noticing that they were installed these third party tools, hunting down the DLL files, copying them into the bin and then adding a reference to the project which points to the file in the BIN. To me, this doesn't seem like normal practice.

我是IM pression下,如果你只是倾倒在bin文件夹一个DLL,你并不需要添加一个参考,它只是提供?原因是,在我上一份工作,我们使用我们建房子的数据访问一些类库,只是在下降,我们所做的任何新的网站(而不是web应用)的DLL文件。我不记得每个不必添加引用才能正常工作。

I was under the impression that if you just dump a DLL in the bin folder, you don't need to add a reference, it's just available? Reason being, at my last job we used a few class libraries we built in house for data access and just dropped the DLLs in any new websites (not webapps) that we made. I don't recall every having to add a reference to get it to work.

那么,能不能有人解释如何第三方引用添加到您的web应用程序的最佳做法?你添加任何地方,从该DLL被安装在系统中的参考?如果是这样,你检查复制本地所以它复制到bin?你只是DLL复制到bin,这就是它?你的DLL复制到bin,然后将其添加引用呢?

So, can someone explain best practices on how to add third party references to your web app? Do you add the reference from wherever the DLL is installed in the system? If so, do you check copy local so it copies to the bin? Do you just copy the dll to the bin and that's it? Do you copy the dll to the bin and then add a reference to it there?

对不起,我敢肯定,这似乎是一个简单的问题,但我对我见过用两个看似不同的方法混淆。

Sorry, I'm sure this seems like a simple question, but I'm confused by the two seemingly different methods I've seen used.

推荐答案

这取决于你的项目是如何设置的。如果您想precompile您的网站(并获得智能感知正常工作),你必须有一个Visual Studio参考。但任何在bin文件夹会自动由ASP.NET在运行时加载下降......所以可以访问code,它装配的控件/对象的后面不添加项目引用。

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.

对于小型项目我刚才扔DLL扔进垃圾桶,并添加引用。对于更复杂的网站/项目,我有一个第三方插件和code专用的库文件夹中。

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.

这篇关于ASP.NET和Visual Studio - 添加项目引用VS bin文件夹中的DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆