簡體   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.

每當我嘗試安裝它時,它都會引發以下錯誤:

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。 可能是什么問題?

您可以按照此問題中的解決方法來確定哪個文件占用了文件。

也試試:

1.卸載當前項目中的package

2.Tools=>Nuget Package Manager=>Package Manager Settings=>清除所有nuget緩存

3.導航到項目目錄,刪除bin和obj文件夾。 如果存在,還要刪除解決方案目錄中的包文件夾。

4.然后以管理員身份啟動VS安裝package,我建議你可以通過Nuget package管理器UI安裝它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM