ASP.NET如何找到代码隐藏的DLL [英] How does ASP.NET find code-behind DLLs

查看:45
本文介绍了ASP.NET如何找到代码隐藏的DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的本​​地方框上有一个ASP.NET网站,设置为编译为

bin \Debug和bin \在调试和发布模式下发布。两个目录

都填充了dll,因为解决方案已经在两个
模式下编译。当我浏览本地网站时,它可以工作,但它使用了哪一套

dlls?当我部署到Test并且只有

a \bin \目录时,会发生什么,没有\调整或\发布?


我假设。 NET有一些路径搜索规则可以控制网站的二进制文件的内容,但是我无法在

网页上找到这些规则。有谁知道一个很好的参考?


谢谢,

克里斯

I''ve got an ASP.NET website on my local box, set to compile to
bin\Debug and bin\Release in debug and release modes. Both directories
are populated with dlls, as the solution has been compiled in both
modes. When I browse to the local website, it works, but which set of
dlls is it using? What happens when I deploy to Test and there is only
a \bin\ directory, no \Debug or \Release?

I assume .NET has some path-searching rules that govern where it looks
for a website''s binaries, but I''ve been unable to find these on the
web. Does anyone know of a good reference?

Thanks,
Chris

推荐答案

Visual Studio IDE使用Debug和Release目录,

将来自不同构建的相应程序集放在那里。在你的应用程序中,

你只需要一个:bin。


-

HTH,

Kevin Spencer

Microsoft MVP

..Net开发人员

跟随者和贷方都不是。


" Chris Durkin" <杜******* @ hotmail.com>在消息中写道

新闻:11 ********************* @ c13g2000cwb.googlegro ups.com ...
The Debug and Release directories are used by the Visual Studio IDE, to
place the respective assemblies from different builds in there. In your app,
you only need ONE: bin.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Chris Durkin" <du*******@hotmail.com> wrote in message
news:11*********************@c13g2000cwb.googlegro ups.com...
我的本地方框上有一个ASP.NET网站,设置为编译为
bin \Debug和bin \在调试和发布模式下发布。两个目录
都填充了dll,因为解决方案已经在两种模式下编译。当我浏览本地网站时,它可以工作,但是它使用了哪些套件?当我部署到Test并且只有一个\bin \目录,没有\Debug或\ Release时会发生什么?

我认为.NET有一些路径搜索规则它决定了网站的二进制文件的位置,但是我无法在网页上找到这些内容。有没有人知道一个很好的参考?

谢谢,
Chris
I''ve got an ASP.NET website on my local box, set to compile to
bin\Debug and bin\Release in debug and release modes. Both directories
are populated with dlls, as the solution has been compiled in both
modes. When I browse to the local website, it works, but which set of
dlls is it using? What happens when I deploy to Test and there is only
a \bin\ directory, no \Debug or \Release?

I assume .NET has some path-searching rules that govern where it looks
for a website''s binaries, but I''ve been unable to find these on the
web. Does anyone know of a good reference?

Thanks,
Chris



更正 - 这实际上并不是工作。删除临时ASP.NET文件的内容后,我将删除它们。目录,网站不再加载。


ASP.NET似乎是硬编码的,用于在临时的

ASP.NET文件夹中查找dll和approot\bin目录,以及其他任何地方。

似乎没有任何支持不同的调试和发布

目录。

Correction - this actually doesn''t work. After I deleting the contents
of the "temporary ASP.NET files" directory, the site no longer loads.

ASP.NET appears to be hard-coded to look for the dlls in the temporary
ASP.NET files folder and the approot\bin directory, and nowhere else.
There doesn''t seem to be any support for different Debug and Release
dirs.


是的,但是当你在IDE中构建,或选择Debug ...开始,

它只将dll放在Debug或Release中,它不会将它们复制到

网站的bin目录中。所以该网站没有运行,你得到一堆

的误导性错误。视觉工作室的部分行为非常错误。


重现的步骤:


创建一个空白的asp.net web项目
将一些代码放在默认页面中

将构建位置更改为bin \Debug和bin \发布

在两种模式下构建网站

尝试浏览网站


结果 - 类似于此:


解析器错误消息:无法加载类型''WebApplication2.Global''。

这是因为vstudio没有将dll复制到\\​​\\ bin,而ASP.NET

看起来没有比\ bin更深。在我看来,正确的行为,

是vstudio将最近构建的dll复制到\\​​\\ bin文件夹

作为构建过程的一部分。另一个不错的功能是如果ASP.NET

跟随某种搜索模式通过bin到任何子文件夹

它找到了。


希望这在Whidbey中得到修复。 (我正在使用2003年)。任何人都可以测试一下2005年的b $ b $看看这个bug是否存在吗?

Right, but when you build from within the IDE, or choose Debug...Start,
it only puts the dlls in Debug or Release, it doesn''t copy them to the
website''s bin directory. So the site doesn''t run, and you get a bunch
of misleading errors. Very buggy behavior on visual studio''s part.

steps to reproduce:

Create a blank asp.net web project
Put some code in the default page
Change build locations to bin\Debug and bin\Release
Build the website in both modes
Try to browse to the website

Result - something similar to this:

Parser Error Message: Could not load type ''WebApplication2.Global''.
This happens because vstudio doesn''t copy the dlls to \bin, and ASP.NET
doesn''t look any deeper than \bin. The correct behavior, in my opinion,
is for vstudio to copy the most recently built dlls to the \bin folder
as part of the build process. Another nice feature would be if ASP.NET
followed some kind of search pattern down through bin to any subfolders
it found.

Hopefully this is fixed in Whidbey. (I''m using 2003). Can anybody test
2005 and see if this bug exists there?


这篇关于ASP.NET如何找到代码隐藏的DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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