【发布时间】:2019-10-02 10:16:36
【问题描述】:
我似乎无法在我的 C# 类库中安装 nuget 包 Oracle.ManagedDataAccess 18.3.0.0。
每当我尝试安装它时,它都会引发以下错误:
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)
当我在尝试安装 nuget 之前删除 app.config 时,它将在安装 nuget 期间重新创建它,并且此错误仍然存在。它拒绝安装。
AFAIK 没有其他进程在运行。重新启动后,同样的问题仍然存在。
我正在使用 Visual Studio 2017 Pro。可能是什么问题?
【问题讨论】:
-
您的项目似乎不在解决方案目录下,您可以在默认的 `C:\Users\xxx\source\repos` 下新建一个项目来检查此问题是否仍然存在。
标签: c# visual-studio nuget