NuGet version (4.6.0)
VS version: 15.7.3
I cannot create any NuGet packages anymore (even though that during the same day I did it a couple of times). I get an error that db.lock file is used by another process (which is VSs process ServiceHub.Host.CLR.x86). It doesn麓t matter which project from the solution I want to use to create package. Neither removing the file or restarting VS/OS doesn麓t help.
> PM> nuget pack <myprojectname>.nuspec -IncludeReferencedProjects
> Attempting to build package from '<myprojectname>.nuspec'.
> nuget : The process cannot access the file '<path_mysolutionname>\.vs\<mysolutionname>\v15\Server\sqlite3\db.lock' because it is being used by another process.
> At line:1 char:1
> + nuget pack <myprojectname>.nuspec -IncludeReferencedProjects
> + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> + CategoryInfo : NotSpecified: (The process can...nother process.:String) [], RemoteException
> + FullyQualifiedErrorId : NativeCommandError
can you clean .vs folder and then try? (you can also try git clean -xdf if your solution is part of git)
Also, just curious why are you running nuget.exe inside visual studio? do you get the same error when you run it from outside command prompt?
Cleaning .vs doesn't help (and it is not a part of git). But running the command outside the VS works well, thanks! :)
Met the same issues.
We use nuget.[email protected] to restore package for each project in the same solution.
It seems that the issues only happens in VSTS incredibuild. There is no issue when run msbuild even with /m parameter locally without incredibuild.
More detail:
+Solution directory
I meet the same issue by just upgrade Nuget.exe from v3.5 to v4.4+, and it seems the first restore is fine but then the 2nd restore will fail.
2>------ Build started: Project: Microsoft.OData.Edm.NetStandard.VS2017, Configuration: Debug Any CPU ------
1>Build started 10/18/2018 3:23:19 PM.
2>Build started 10/18/2018 3:23:19 PM.
1>Target RestoreNuGetPackages:
1> Restoring NuGet package StyleCop.MSBuild.4.7.49.
1> Adding package 'StyleCop.MSBuild.4.7.49' to folder 'E:\Github\odata.net\sln\packages'
1> Added package 'StyleCop.MSBuild.4.7.49' to folder 'E:\Github\odata.net\sln\packages'
1>
2>Target RestoreNuGetPackages:
2> Restoring NuGet package StyleCop.MSBuild.4.7.49.
1> NuGet Config files used:
1> E:\Github\odata.net\sln.nuget\NuGet.Config
1> C:\Userschuanboz\AppData\Roaming\NuGet\NuGet.Config
1> C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config
1> C:\Program Files (x86)\NuGet\Config\ServiceFabricSDK.config
1>
1> Feeds used:
1> C:\Userschuanboz.nuget\packages\
1> https://www.myget.org/F/odata/
1> https://api.nuget.org/v3/index.json
1> https://www.myget.org/F/dotnet-buildtools/
1> https://msazure.pkgs.visualstudio.com/_packaging/Intune_External/nuget/v3/index.json
1> https://msazure.pkgs.visualstudio.com/_packaging/Intune_Dev/nuget/v3/index.json
1> C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
1> C:\Program Files\Microsoft SDKs\Service Fabric\packages
1>
1> Installed:
1> 1 package(s) to packages.config projects
1>Target GenerateAssemblyAttributeFile:
1> Skipping target "GenerateAssemblyAttributeFile" because all output files are up-to-date with respect to the input files.
2> Adding package 'StyleCop.MSBuild.4.7.49' to folder 'E:\Github\odata.net\sln\packages'
2> Added package 'StyleCop.MSBuild.4.7.49' to folder 'E:\Github\odata.net\sln\packages'
...
6>------ Build started: Project: Microsoft.OData.Edm.Tests.NetCore, Configuration: Debug Any CPU ------
5>Build started 10/18/2018 3:23:24 PM.
5>Target _GetProjectReferenceTargetFrameworkProperties:
4>Build started 10/18/2018 3:23:24 PM.
6>Build started 10/18/2018 3:23:24 PM.
6>Target _GetProjectReferenceTargetFrameworkProperties:
4>Target RestoreNuGetPackages:
4> Restoring NuGet package StyleCop.MSBuild.4.7.49.
4> Adding package 'StyleCop.MSBuild.4.7.49' to folder 'E:\Github\odata.net\sln\packages'
4> EXEC : warning : The process cannot access the file 'E:\Github\odata.net\sln\packages\StyleCop.MSBuild.4.7.49.0\tools\mssp7en.dll' because it is being used by another process.
4>
I'm getting the same errror on our build server after updating the nuget version on the build agents:
2018-11-02T11:02:33.0809500Z The process cannot access the file 'N:\2015 Build Agents\F\_work\59\s\packages\Castle.Core.4.3.1\lib\netstandard1.3\Castle.Core.dll' because it is being used by another process.
2018-11-02T11:02:33.0809500Z The process cannot access the file 'N:\2015 Build Agents\F\_work\59\s\packages\Moq.4.10.0\lib\netstandard1.3\Moq.dll' because it is being used by another process.
2018-11-02T11:02:33.0965500Z The process cannot access the file 'N:\2015 Build Agents\F\_work\59\s\packages\System.ValueTuple.4.4.0\lib\net47\System.ValueTuple.dll' because it is being used by another process.
Any progress on this issue at all?
Is there something I can do other than reverting the nuget versions?
Does it repro with latest NuGet.exe 4.8.1 (https://dist.nuget.org/win-x86-commandline/v4.8.1/nuget.exe)? If yes, then can someone provide simple repro steps for the issue?
I'm not in the office at the moment, but this behaviour was seen after performing a self update on nuget yesterday, so I presume that it was the latest.
I stopped the issue by reverting to the previous version as it was preventing any builds from running on the server.
I am seeing this issue with our teamcity build server with nuget 4.9.1
I am seeing this issue with out team city build server as well. Nuget v. 4.9.2.5706. Any info about when this might get resolved?
Most helpful comment
can you clean
.vsfolder and then try? (you can also trygit clean -xdfif your solution is part of git)Also, just curious why are you running nuget.exe inside visual studio? do you get the same error when you run it from outside command prompt?