Cannot overwrite .dll files in Visual Studio 2008. Access denied

This is strange. Visual Studio 2008 does not seem to release its handle to create the .DLLs created for my project, so the second time (and in the following moments) that I create when Studio tries to overwrite the modified DLLs, it gets an access denied error. I also can not copy / delete .dll in the question (Tasks.dll), while Visual Studio opens after I built once. Process Explorer tells me that the file is used by devenv.exe, so I know that Visual Studio will not let it go after the build is complete.

Has anyone seen this before, and if so, what can I do about it? Obviously, opening and closing a visual studio between each assembly is not an acceptable solution, and the problem persists in restarting the system.

Another example: I use the DLL (Tasks.dll) that causes the error in the UseTask MSBuild directive in another project, let it call Test. The build order of the project is set so that Tasks are created before the test, and then the Test AfterBuild task calls the task from / bin / debug / Tasks.dll.

+3
source share
2 answers

. . , , , , , ..

, , , , , .

, ( ), , - , , , , :

  • -
      - MyProject (dir)
        - ()
          * Proj1.exe
          * Proj2.dll
          * Proj3.dll
        - Src (dir)
          - Proj1 (dir)
          - Proj2 (dir)
              - bin (dir)
          - Proj3 (dir)
              - bin (dir)

  • Proj1 (, console/windows - *.exe) , MyProject/Bin

  • Proj2 (.dll) , MyProject/Src/Proj2/bin/... postbuild "MyProject/Bin"

    copy "$ (TargetDir)\$(TargetName).dll" "$ (SolutionDir) Bin"
    copy "$ (TargetDir)\$(TargetName).pdb" "$ (SolutionDir) Bin"

  • Proj3 (.dll) , MyProject/Src/Proj3/bin/... postbuild , Proj2

  • . , Proj1 Proj2, Proj2 Proj3.

    • Proj3, postbuild MyProject/Bin
    • Proj2 MyProject/Bin/Proj3.dll( , ). , Proj3. "Proj2", MyProject/Bin ( postbuild).
    • , , Proj1 MyProject/Bin/Proj2.dll( ). , Proj2 . .

:

  • , , .
  • , , ReSharper, , .
  • , , .
  • , , , .
+2

, , - taskkill, Visual Studio .

PowerShell.

taskkill -IM devenv.exe /F /T

/F orce /T .

: taskkill -? .

0

Source: https://habr.com/ru/post/1743886/


All Articles