How do you attach a dll to a asp.net site? I want to be able to debug and edit the dll without having to keep replacing the reference in my asp.net site. I checked attach to process but didn't see the worker process. I am using asp.net, iis 7.
你如何将一个DLL附加到asp.net网站?我希望能够调试和编辑dll,而无需在我的asp.net站点中继续替换引用。我检查了附加到进程,但没有看到工作进程。我使用的是asp.net,iis 7。
4 个解决方案
#1
12
Just put it into /bin folder of your web application.
只需将其放入Web应用程序的/ bin文件夹即可。
OR
Add reference to this .dll by right clicking on References > Add Reference > Browse >
Select your .dll file and lick OK.
右键单击引用>添加引用>浏览>选择.dll文件并单击确定,添加对此.dll的引用。
Then set it's "Copy Local" property to "True". This way .dll will be copied into /Bin folder each time you build application.
然后将其“复制本地”属性设置为“True”。这种方式.dll将在每次构建应用程序时复制到/ Bin文件夹中。
alt text http://xmages.net/out.php/i170817_1.png
alt text http://xmages.net/out.php/i170817_1.png
#2
1
Using Visual Studio you should create a Solution that has your website as a project and the DLL (code) as another project. Make a reference in the Website project to the DLL project and it should update it automatically.
使用Visual Studio,您应该创建一个解决方案,将您的网站作为项目,将DLL(代码)作为另一个项目。在网站项目中引用DLL项目,它应该自动更新。
If you are not using the Web Application model and just the Website model you could just have your DLL project output to your website's /bin directory directly. That will update the DLL in the website/bin folder whenever you build your DLL project.
如果您不使用Web应用程序模型而只使用网站模型,则可以直接将DLL项目输出到网站的/ bin目录。这将在您构建DLL项目时更新website / bin文件夹中的DLL。
If I could suggest, because I still use it, go to LearnVisualStudio.com and check out the free video's.
如果我可以建议,因为我仍然使用它,请访问LearnVisualStudio.com并查看免费视频。
#3
0
If you want to edit the dll, open that project up in a second instance of Visual Studio and treat it like you would for any other project.
如果要编辑dll,请在Visual Studio的第二个实例中打开该项目,并像对待任何其他项目一样对待它。
Set the reference in your /bin folder to the debug dll that the second Visual Studio creates.
将/ bin文件夹中的引用设置为第二个Visual Studio创建的调试DLL。
#4
0
I'm assuming you have Visual Studio...
我假设你有Visual Studio ......
If you're just trying to add a dll, you can add a reference to it by right clicking on your website node and choosing "Add Reference..." . You will be able to debug the dll if you have its pdb along with it (to load the symbols from). You will NOT be able to edit the dll.
如果您只是尝试添加dll,可以通过右键单击网站节点并选择“添加引用...”来添加对它的引用。如果你有一个pdb(从中加载符号),你将能够调试dll。您将无法编辑dll。
If the dll is in fact another project you have the source code for, just add the project to your solution, and from your website project add a reference from the "projects" tab. VS should add a reference and dependency so that it keeps the dll updated when you change code in your dll project.
如果dll实际上是另一个项目,你有源代码,只需将项目添加到您的解决方案,并从您的网站项目添加“项目”选项卡中的引用。 VS应该添加一个引用和依赖项,以便在更改dll项目中的代码时保持dll更新。
#1
12
Just put it into /bin folder of your web application.
只需将其放入Web应用程序的/ bin文件夹即可。
OR
Add reference to this .dll by right clicking on References > Add Reference > Browse >
Select your .dll file and lick OK.
右键单击引用>添加引用>浏览>选择.dll文件并单击确定,添加对此.dll的引用。
Then set it's "Copy Local" property to "True". This way .dll will be copied into /Bin folder each time you build application.
然后将其“复制本地”属性设置为“True”。这种方式.dll将在每次构建应用程序时复制到/ Bin文件夹中。
alt text http://xmages.net/out.php/i170817_1.png
alt text http://xmages.net/out.php/i170817_1.png
#2
1
Using Visual Studio you should create a Solution that has your website as a project and the DLL (code) as another project. Make a reference in the Website project to the DLL project and it should update it automatically.
使用Visual Studio,您应该创建一个解决方案,将您的网站作为项目,将DLL(代码)作为另一个项目。在网站项目中引用DLL项目,它应该自动更新。
If you are not using the Web Application model and just the Website model you could just have your DLL project output to your website's /bin directory directly. That will update the DLL in the website/bin folder whenever you build your DLL project.
如果您不使用Web应用程序模型而只使用网站模型,则可以直接将DLL项目输出到网站的/ bin目录。这将在您构建DLL项目时更新website / bin文件夹中的DLL。
If I could suggest, because I still use it, go to LearnVisualStudio.com and check out the free video's.
如果我可以建议,因为我仍然使用它,请访问LearnVisualStudio.com并查看免费视频。
#3
0
If you want to edit the dll, open that project up in a second instance of Visual Studio and treat it like you would for any other project.
如果要编辑dll,请在Visual Studio的第二个实例中打开该项目,并像对待任何其他项目一样对待它。
Set the reference in your /bin folder to the debug dll that the second Visual Studio creates.
将/ bin文件夹中的引用设置为第二个Visual Studio创建的调试DLL。
#4
0
I'm assuming you have Visual Studio...
我假设你有Visual Studio ......
If you're just trying to add a dll, you can add a reference to it by right clicking on your website node and choosing "Add Reference..." . You will be able to debug the dll if you have its pdb along with it (to load the symbols from). You will NOT be able to edit the dll.
如果您只是尝试添加dll,可以通过右键单击网站节点并选择“添加引用...”来添加对它的引用。如果你有一个pdb(从中加载符号),你将能够调试dll。您将无法编辑dll。
If the dll is in fact another project you have the source code for, just add the project to your solution, and from your website project add a reference from the "projects" tab. VS should add a reference and dependency so that it keeps the dll updated when you change code in your dll project.
如果dll实际上是另一个项目,你有源代码,只需将项目添加到您的解决方案,并从您的网站项目添加“项目”选项卡中的引用。 VS应该添加一个引用和依赖项,以便在更改dll项目中的代码时保持dll更新。