简体   繁体   English

Visual Studio Nuget install 'app.config is in use'

[英]Visual Studio Nuget install 'app.config is in use'

I can't seem to install the nuget package Oracle.ManagedDataAccess 18.3.0.0 in my C# class library. I can't seem to install the nuget package Oracle.ManagedDataAccess 18.3.0.0 in my C# class library.

Whenever I try to install it it throws the following error:每当我尝试安装它时,它都会引发以下错误:

System.IO.InvalidDataException: An error occurred while applying transformation to 'App.config' in project 'MyClassLibrary' The process cannot access the file 'R:\DEV\MyClassLibrary\App.config' because it is being used by another process. ---> System.IO.IOException: The process cannot access the file 'R:\DEV\MyClassLibrary\App.config' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
   at NuGet.ProjectManagement.FileSystemUtility.CreateFile(String fullPath)

When I delete the app.config before attempting to install the nuget it will recreate it during installation of the nuget, and this error perists.当我在尝试安装 nuget 之前删除 app.config 时,它将在安装 nuget 期间重新创建它,并且此错误仍然存在。 It refuses to install.它拒绝安装。

AFAIK there are no other processes running. AFAIK 没有其他进程正在运行。 After a reboot the same issue persists.重新启动后,同样的问题仍然存在。

I'm using Visual Studio 2017 Pro.我正在使用 Visual Studio 2017 Pro。 What can be the problem?可能是什么问题?

You may follow workarounds in this issue to figure out which is occupying the file.您可以按照此问题中的解决方法来确定哪个文件占用了文件。

Also Try:也试试:

1.Uninstall that package in current project 1.卸载当前项目中的package

2.Tools=>Nuget Package Manager=>Package Manager Settings=>Clear All nuget caches 2.Tools=>Nuget Package Manager=>Package Manager Settings=>清除所有nuget缓存

3.Navigate to Project directory, delete the bin and obj folders. 3.导航到项目目录,删除bin和obj文件夹。 Also delete the packages folder in Solution directory if it exists.如果存在,还要删除解决方案目录中的包文件夹。

4.Then start VS as admin to install the package, I suggest you can install it by Nuget package manager UI. 4.然后以管理员身份启动VS安装package,我建议你可以通过Nuget package管理器UI安装它。

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

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