-KenI have been developing a suite of assemblies over the past couple of weeks,and this afternoon somethign started misbehaving.If I do not run the IDE and compiler the code from the command line, thecompilation seems to work properly almost all of the time. More on thislater.If I launch one copy of the IDE, then I can usually compile the project atleast once. At some point, the build fails reporting "Could not copytemporary files to the output directory" and then indicates that one of theDLL could not be copied to the run directory. At this point I cannot evendelete the file from the file explorer until I quit the IDE -- it seems thatsomething is locking the file!I have tried to stop and start the IDE, log out and back in and even reboot,all to no avail. This has been working fine for over two weeks, with merunning teo copies of the IDE -- one for debugging the server component andone for debugging the client component, both within the same system andsharing a couple of the assemblies. The DLL is question is one that is usedby the server component only.The first indication something was different was when I compiled within onecopy of the IDE, started that component, switched to the other IDE, and whenI attempted to start that component running (debugging) it tried torecompile all of the assemblies again, and this fails since some of theassemblies are actually being used by the debug session in the other IDEinstance. Since the components that fail are not ones that I needed torecompile, I generally ignored the problem and kept on debugging. This wenton all day until finally one copy (and now both copies) refuse tosuccessfully recompile, reporting the above error (on the same assembly).One thing I should note is that I have all of the assembly projectsconfigured to place their resulting binaries (DLL or EXE) in the samedirectory. This is done to make it easier to debug the applications andservices since the files are kept together.As part of the checks I made on the project, I deleted all of the files fromthe Drive:\Root\Bin\Release and Drive:\Root\Debug directories and thenattempted to rebuild from scratch. I did locate one circular reference thatI had introduced, and corrected that, and then I noticed that the *.csprojfiles are reference using the relative path to the debug directory, whichmeant that if I deleted all files and attempted to build the Release versionit failed! I had to build the debug version first. After thinking about thisI changed all of the project files to reference the dependant DLLs from theRelease directory.I have not located the problem, and I am still unable to build the solutionand not get this error if even one IDE is running -- but when I lauch andIDE, I can rebuild the entire solution once!Does anyoine have any idea why this is happening and what I can do tocorrect this?-Ken推荐答案 Ken Allen写道:Ken Allen wrote:我有过去几周一直在开发一套程序集,今天下午,一些人开始行为不端。 如果我不运行IDE并从命令行编译代码,那么稍​​后。 如果我启动IDE的一个副本,那么我通常可以至少编译一次项目。在某些时候,构建失败报告无法将临时文件复制到输出目录。然后指示无法将其中一个DLL复制到运行目录。此时我甚至无法从文件浏览器中删除文件,直到我退出IDE - 似乎某些东西锁定了文件! 我试图停止并启动IDE,注销并重新启动甚至重启,一切都无济于事。这已经工作了两个多星期了,我一直在运行IDE的teo副本 - 一个用于调试服务器组件,一个用于调试客户端组件,两者都在同一个系统中,并且/>共享几个程序集。 DLL是一个仅由服务器组件使用的问题。 第一个指示不同的是当我在IDE的一个副本中编译时,启动了组件,切换到另一个IDE,当我试图启动该组件运行(调试)时,它试图再次重新编译所有组件,这是因为一些组件失败了实际上是由其他IDE 实例中的调试会话使用。由于失败的组件不是我需要重新编译的组件,因此我通常会忽略该问题并继续进行调试。这一整天都是,直到最后一个副本(现在两个副本)拒绝成功重新编译,报告上述错误(在同一个程序集上)。 我有一件事应该注意的是,我将所有的汇编项目配置为将生成的二进制文件(DLL或EXE)放在同一个目录中。这样做是为了更容易调试应用程序和服务,因为文件保存在一起。 作为我在项目上进行的检查的一部分,我删除了所有文件驱动器:\ Root \Bin \Release和Drive:\ Root \Debug目录然后尝试从头开始重建。我确实找到了一个我已经介绍过的循环引用,并更正了,然后我注意到* .csproj 文件是使用调试目录的相对路径引用的,这意味着如果我删除所有文件并尝试构建发布版本它失败了!我必须首先构建调试版本。在考虑了这个之后我改变了所有项目文件,以便从 Release目录中引用相关的DLL。 我没有找到问题,我仍然无法构建解决方案即使一个IDE运行也不会出现此错误 - 但是当我开始使用IDE时,我可以重建整个解决方案一次! anyoine有没有知道为什么会发生这种情况以及我能做些什么来解决这个问题? I have been developing a suite of assemblies over the past couple of weeks, and this afternoon somethign started misbehaving. If I do not run the IDE and compiler the code from the command line, the compilation seems to work properly almost all of the time. More on this later. If I launch one copy of the IDE, then I can usually compile the project at least once. At some point, the build fails reporting "Could not copy temporary files to the output directory" and then indicates that one of the DLL could not be copied to the run directory. At this point I cannot even delete the file from the file explorer until I quit the IDE -- it seems that something is locking the file! I have tried to stop and start the IDE, log out and back in and even reboot, all to no avail. This has been working fine for over two weeks, with me running teo copies of the IDE -- one for debugging the server component and one for debugging the client component, both within the same system and sharing a couple of the assemblies. The DLL is question is one that is used by the server component only. The first indication something was different was when I compiled within one copy of the IDE, started that component, switched to the other IDE, and when I attempted to start that component running (debugging) it tried to recompile all of the assemblies again, and this fails since some of the assemblies are actually being used by the debug session in the other IDE instance. Since the components that fail are not ones that I needed to recompile, I generally ignored the problem and kept on debugging. This went on all day until finally one copy (and now both copies) refuse to successfully recompile, reporting the above error (on the same assembly). One thing I should note is that I have all of the assembly projects configured to place their resulting binaries (DLL or EXE) in the same directory. This is done to make it easier to debug the applications and services since the files are kept together. As part of the checks I made on the project, I deleted all of the files from the Drive:\Root\Bin\Release and Drive:\Root\Debug directories and then attempted to rebuild from scratch. I did locate one circular reference that I had introduced, and corrected that, and then I noticed that the *.csproj files are reference using the relative path to the debug directory, which meant that if I deleted all files and attempted to build the Release version it failed! I had to build the debug version first. After thinking about this I changed all of the project files to reference the dependant DLLs from the Release directory. I have not located the problem, and I am still unable to build the solution and not get this error if even one IDE is running -- but when I lauch and IDE, I can rebuild the entire solution once! Does anyoine have any idea why this is happening and what I can do to correct this? 我假设你有一个项目A,B和C的解决方案,以及引用B 和C.此外B和C引用一些给定的程序集。在这种情况下,我有时会看到B或C因为这个 错误而无法编译。如果我先编译B然后再编译C就可以了。你可以尝试只设置一个 的引用复制本地是真的而另一个复制本地是假的。 这可能解决冲突。 另一个解决方案(没有双关语意思)是将一些项目分离成一个单独的解决方案并从主解决方案中引用程序集,而不是 项目。 Frans。 - 获取LLBLGen Pro,新的O / R映射器for .NET: http://www.llblgen.com 我的.NET博客: http://weblogs.asp.net/fbouma Microsoft C#MVPI assume you have a solution with projects A, B and C, and A references Band C. Furthermore B and C reference both some given assembly. What Isometimes see in this scenario is that B or C fail to compile due to thiserror. If I first compile B and then C it''s ok. You could try to set only oneof the references to copy local is true and the other to copy local is false.This might solve the conflict.Another solution (no pun intended) is the separation of some projects into aseparate solution and reference the assemblies from the main solution, notthe projects.Frans.--Get LLBLGen Pro, the new O/R mapper for .NET: http://www.llblgen.comMy .NET Blog: http://weblogs.asp.net/fboumaMicrosoft C# MVP 2004年4月28日星期三01:20:31 -0700,Frans Bouma [C#MVP] < pe ****************** @ xs4all.nl>写道:On Wed, 28 Apr 2004 01:20:31 -0700, "Frans Bouma [C# MVP]"<pe******************@xs4all.nl> wrote: Ken Allen写道:Ken Allen wrote:过去几周我一直在开发一套装配,和今天下午,一些人开始行为不端。 如果我没有运行IDE并从命令行编译代码,那么几乎所有时间的编辑似乎都能正常工作。更多关于这个稍​​后。 如果我启动IDE的一个副本,那么我通常可以至少编译一次项目。在某些时候,构建失败报告无法将临时文件复制到输出目录。然后指示无法将其中一个DLL复制到运行目录。此时我甚至无法从文件浏览器中删除文件,直到我退出IDE - 似乎某些东西锁定了文件! 我试图停止并启动IDE,注销并重新启动甚至重启,一切都无济于事。这已经工作了两个多星期了,我一直在运行IDE的teo副本 - 一个用于调试服务器组件,一个用于调试客户端组件,两者都在同一个系统中,并且/>共享几个程序集。 DLL是一个仅由服务器组件使用的问题。 第一个指示不同的是当我在IDE的一个副本中编译时,启动了组件,切换到另一个IDE,当我试图启动该组件运行(调试)时,它试图再次重新编译所有组件,这是因为一些组件失败了实际上是由其他IDE 实例中的调试会话使用。由于失败的组件不是我需要重新编译的组件,因此我通常会忽略该问题并继续进行调试。这一整天都是,直到最后一个副本(现在两个副本)拒绝成功重新编译,报告上述错误(在同一个程序集上)。 我有一件事应该注意的是,我将所有的汇编项目配置为将生成的二进制文件(DLL或EXE)放在同一个目录中。这样做是为了更容易调试应用程序和服务,因为文件保存在一起。 作为我在项目上进行的检查的一部分,我删除了所有文件驱动器:\ Root \Bin \Release和Drive:\ Root \Debug目录然后尝试从头开始重建。我确实找到了一个我已经介绍过的循环引用,并更正了,然后我注意到* .csproj 文件是使用调试目录的相对路径引用的,这意味着如果我删除所有文件并尝试构建发布版本它失败了!我必须首先构建调试版本。在考虑了这个之后我改变了所有项目文件,以便从 Release目录中引用相关的DLL。 我没有找到问题,我仍然无法构建解决方案即使一个IDE运行也不会出现此错误 - 但是当我开始使用IDE时,我可以重建整个解决方案一次! anyoine有没有知道为什么会发生这种情况以及我能做些什么来解决这个问题? I have been developing a suite of assemblies over the past couple of weeks, and this afternoon somethign started misbehaving. If I do not run the IDE and compiler the code from the command line, the compilation seems to work properly almost all of the time. More on this later. If I launch one copy of the IDE, then I can usually compile the project at least once. At some point, the build fails reporting "Could not copy temporary files to the output directory" and then indicates that one of the DLL could not be copied to the run directory. At this point I cannot even delete the file from the file explorer until I quit the IDE -- it seems that something is locking the file! I have tried to stop and start the IDE, log out and back in and even reboot, all to no avail. This has been working fine for over two weeks, with me running teo copies of the IDE -- one for debugging the server component and one for debugging the client component, both within the same system and sharing a couple of the assemblies. The DLL is question is one that is used by the server component only. The first indication something was different was when I compiled within one copy of the IDE, started that component, switched to the other IDE, and when I attempted to start that component running (debugging) it tried to recompile all of the assemblies again, and this fails since some of the assemblies are actually being used by the debug session in the other IDE instance. Since the components that fail are not ones that I needed to recompile, I generally ignored the problem and kept on debugging. This went on all day until finally one copy (and now both copies) refuse to successfully recompile, reporting the above error (on the same assembly). One thing I should note is that I have all of the assembly projects configured to place their resulting binaries (DLL or EXE) in the same directory. This is done to make it easier to debug the applications and services since the files are kept together. As part of the checks I made on the project, I deleted all of the files from the Drive:\Root\Bin\Release and Drive:\Root\Debug directories and then attempted to rebuild from scratch. I did locate one circular reference that I had introduced, and corrected that, and then I noticed that the *.csproj files are reference using the relative path to the debug directory, which meant that if I deleted all files and attempted to build the Release version it failed! I had to build the debug version first. After thinking about this I changed all of the project files to reference the dependant DLLs from the Release directory. I have not located the problem, and I am still unable to build the solution and not get this error if even one IDE is running -- but when I lauch and IDE, I can rebuild the entire solution once! Does anyoine have any idea why this is happening and what I can do to correct this? 我假设您有项目A,B和C的解决方案,并且A参考B 和C.此外B和C引用了一些给定的组件。我在这种情况下有时会看到的是,由于这个错误,B或C无法编译。如果我先编译B然后再编译C就可以了。你可以尝试只设置一个复制本地的引用是真的而另一个复制本地是假的。这可能解决冲突。 另一个解决方案(没有双关语是将一些项目分离成一个单独的解决方案,并从主要解决方案中引用程序集,而不是项目。I assume you have a solution with projects A, B and C, and A references Band C. Furthermore B and C reference both some given assembly. What Isometimes see in this scenario is that B or C fail to compile due to thiserror. If I first compile B and then C it''s ok. You could try to set only oneof the references to copy local is true and the other to copy local is false.This might solve the conflict.Another solution (no pun intended) is the separation of some projects into aseparate solution and reference the assemblies from the main solution, notthe projects. 我也遇到过同样的问题。虽然我的错,但感到愚蠢 这样说。当我运行测试工具时,我的代码中有一个错误,而且应用程序没有正确卸载。调试器 已经停止,但是使用任务管理器我注意到这个过程是 仍然有效。结束这个过程解决了我所有的问题,我能够直接编译。I too have had this same problem. Twas my fault though and feel stupidsaying this. When I was running up test harnesses, there was a bug inmy code and the application was not unloading correctly. The debuggerhad stopped, but using task manager I noticed that the process wasstill active. Ending the process solved all my problems and I was ableto compile straight away.你误解了这个问题。这不是编译失败,而是编译程序集转移到目标 目录中。我可以这样做一次,但是其中一个目标文件得到了 ''已锁定''我在退出IDE之前无法删除它! 我在另一个帖子中添加了更多细节。 -Kn Frans Bouma [C#MVP]" < PE ****************** @ xs4all.nl>在消息中写道 news:xn *************** @ msnews.microsoft.com ...You have mis-understood the problem. It is not the compilation that isfailing, but the transfer of the compiled assembly into the targetdirectory. I can do this once, but then one of the target files gets''locked'' and I cannot delete it until I exit the IDE!I have put more detail in another posting.-Ken"Frans Bouma [C# MVP]" <pe******************@xs4all.nl> wrote in messagenews:xn***************@msnews.microsoft.com... Ken Allen写道: Ken Allen wrote:在过去的几个b $ b周内,我一直在开发一套装配,今天下午,一些人开始行为不端。 我认为你有项目A,B和C以及A​​参考B 和C的解决方案。此外,B和C参考了一些给定的组件。我在这种情况下有时会看到的是,由于这个错误,B或C无法编译。如果我先编译B然后再编译C就可以了。您可以尝试仅设置 I have been developing a suite of assemblies over the past couple ofweeks, and this afternoon somethign started misbehaving. I assume you have a solution with projects A, B and C, and A references B and C. Furthermore B and C reference both some given assembly. What I sometimes see in this scenario is that B or C fail to compile due to this error. If I first compile B and then C it''s ok. You could try to set only 复制本地的引用之一为true,另一个复制本地是 false。这可能会解决冲突。 另一个解决方案(没有双关语)是将一些项目分离成a单独的解决方案并从主要解决方案中引用程序集,而不是项目。 Frans。 - 获取LLBLGen Pro,.NET的新O / R映射器: http://www.llblgen.com 我的.NET博客: http://weblogs.asp.net/fbouma Microsoft C#MVPone of the references to copy local is true and the other to copy local isfalse. This might solve the conflict. Another solution (no pun intended) is the separation of some projects intoa separate solution and reference the assemblies from the main solution, not the projects. Frans. -- Get LLBLGen Pro, the new O/R mapper for .NET: http://www.llblgen.com My .NET Blog: http://weblogs.asp.net/fbouma Microsoft C# MVP 这篇关于Visual Studio的奇怪问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-06 01:23