简体   繁体   English

为什么“临时ASP.NET文件”中的ASP.NET DLL没有在重建时获得更新?

[英]Why are my ASP.NET DLL's in “Temporary ASP.NET Files” not getting updated on rebuilds?

I am working on a DLL that a webservice I have uses, I added some new code and would like to compile and debug into it via an NUnit testing suite. 我正在研究一个我使用的web服务的DLL,我添加了一些新代码,并希望通过NUnit测试套件编译和调试它。 The steps I have taken are. 我采取的步骤是。

  1. Write my code in Visual Studio 2008 with the output directory pointing to my applications bin directory (C:\\Program Files\\etc...). 在Visual Studio 2008中编写我的代码,输出目录指向我的应用程序bin目录(C:\\ Program Files \\ etc ...)。

  2. When I launch my webservice process and attach to it, I get the warning that my program was built without debug information, I found that if I copied the .pdb files in the the C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\Temporary ASP.NET Files\\... directory then I could avoid warning but still not hit my code section. 当我启动我的webservice进程并附加到它时,我收到警告,我的程序是在没有调试信息的情况下构建的,我发现如果我复制了C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\Temporary ASP.NET Files\\...的.pdb文件C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\Temporary ASP.NET Files\\...目录然后我可以避免警告但仍然没有点击我的代码部分。

  3. I stopped my application, re-built my DLL's, and re-started the web application. 我停止了我的应用程序,重新构建了我的DLL,并重新启动了Web应用程序。

  4. Upon further inspection, I noticed that when I stopped my application via. 经过进一步检查,我注意到当我停止申请时。 process explorer and deleted the sub-directory under the Temporary ASP.NET directory, then when I restarted my process the sub-directories get re-created, however they do not contain the new DLL's that I had just previously built but an older version of the DLL's, and no PDB files either. 进程资源管理器并删除了Temporary ASP.NET目录下的子目录,然后当我重新启动我的进程时,子目录被重新创建,但是它们不包含我刚刚构建的新DLL但是旧版本的DLL的,也没有PDB文件。

To sum it up my question is how do I get Visual Studio to both build and update the DLL's in the temporary ASP.NET directory? 总结一下,我的问题是如何让Visual Studio在临时ASP.NET目录中构建和更新DLL? For more kudo's how do I get Visual Studio to automatically copy the PDB files to the same temporary directory without any batch assistance? 对于更多kudo,如何让Visual Studio自动将PDB文件复制到同一个临时目录而不需要任何批处理帮助?

Ideally I would like to avoid this automatic copying of my DLL's to the temporary directory, but through my searching today I could not find any suitable way to do this as the ASP internals are quite out of my control. 理想情况下,我想避免将我的DLL自动复制到临时目录,但是通过我今天的搜索,我找不到任何合适的方法来执行此操作,因为ASP内部结构完全不受我的控制。

NOTE: I have the shadow copy feature on NUnit disabled when I hit my webservice via an external executable. 注意:当我通过外部可执行文件访问我的Web服务时,我在NUnit上禁用了卷影复制功能。

Figured this out, needed to build into the ASP.NET Websites bin directory in order to get new DLL's. 想出这个,需要构建到ASP.NET Websites bin目录中以获取新的DLL。 Changed output paths from C:\\Program Files\\MyApp\\Bin to C:\\Program Files\\MyApp\\MyWebService\\Bin , this seemed to solve the issues I was having and the new DLL's get copied and all the debugging works. 将输出路径从C:\\Program Files\\MyApp\\Bin更改为C:\\Program Files\\MyApp\\MyWebService\\Bin ,这似乎解决了我遇到的问题,新DLL被复制并且所有调试都有效。

Cheers! 干杯!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM