コンパイルエラー CS0246 が発生してパブリッシュできない

半年ほど前にパブリッシュできていたものが、修正後、以下のエラーが出てパブリッシュできなくなりました。
デバッグでの実行は問題ありません。
「未使用を削除」を実行しても解決しませんでした。
一度、Studioを終了し、.localを削除してからStudioで再度プロジェクトを開いて、パブリッシュしてみましたが、この手順でも改善しませんでした。
Studioのバージョンは 2024.10.10 LTS、Enterprise License です。

08/26/2025 09:42:33 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\microsoft.powershell.coreclr.eventing\7.2.22\runtimes/win/lib/net6.0/Microsoft.PowerShell.CoreCLR.Eventing.dll’ を読み込めません。理由: ‘LoadFromFailure. Could not load file or assembly ‘Microsoft.PowerShell.CoreCLR.Eventing, Version=7.2.22.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35’.’
08/26/2025 09:42:33 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/concrt140.dll’ を読み込めません。理由: ‘LoadFromFailure. Bad IL format. The format of the file ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/concrt140.dll’ is invalid.’
08/26/2025 09:42:33 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/cvextern.dll’ を読み込めません。理由: ‘LoadFromFailure. Bad IL format. The format of the file ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/cvextern.dll’ is invalid.’
08/26/2025 09:42:33 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/libusb-1.0.dll’ を読み込めません。理由: ‘LoadFromFailure. Bad IL format. The format of the file ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/libusb-1.0.dll’ is invalid.’
08/26/2025 09:42:33 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/msvcp140_1.dll’ を読み込めません。理由: ‘LoadFromFailure. Bad IL format. The format of the file ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/msvcp140_1.dll’ is invalid.’
08/26/2025 09:42:33 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/msvcp140_2.dll’ を読み込めません。理由: ‘LoadFromFailure. Bad IL format. The format of the file ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/msvcp140_2.dll’ is invalid.’
08/26/2025 09:42:33 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/msvcp140_atomic_wait.dll’ を読み込めません。理由: ‘LoadFromFailure. Bad IL format. The format of the file ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/msvcp140_atomic_wait.dll’ is invalid.’
08/26/2025 09:42:33 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/msvcp140_codecvt_ids.dll’ を読み込めません。理由: ‘LoadFromFailure. Bad IL format. The format of the file ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/msvcp140_codecvt_ids.dll’ is invalid.’
08/26/2025 09:42:33 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/msvcp140.dll’ を読み込めません。理由: ‘LoadFromFailure. Bad IL format. The format of the file ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/msvcp140.dll’ is invalid.’
08/26/2025 09:42:33 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/vcruntime140_1.dll’ を読み込めません。理由: ‘LoadFromFailure. Bad IL format. The format of the file ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/vcruntime140_1.dll’ is invalid.’
08/26/2025 09:42:33 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/vcruntime140.dll’ を読み込めません。理由: ‘LoadFromFailure. Bad IL format. The format of the file ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/vcruntime140.dll’ is invalid.’
08/26/2025 09:42:36 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/concrt140.dll’ を読み込めません。理由: ‘LoadFromFailure. Bad IL format. The format of the file ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/concrt140.dll’ is invalid.’
08/26/2025 09:42:36 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/cvextern.dll’ を読み込めません。理由: ‘LoadFromFailure. Bad IL format. The format of the file ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/cvextern.dll’ is invalid.’
08/26/2025 09:42:36 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/libusb-1.0.dll’ を読み込めません。理由: ‘LoadFromFailure. Bad IL format. The format of the file ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/libusb-1.0.dll’ is invalid.’
08/26/2025 09:42:36 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/msvcp140_1.dll’ を読み込めません。理由: ‘LoadFromFailure. Bad IL format. The format of the file ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/msvcp140_1.dll’ is invalid.’
08/26/2025 09:42:36 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/msvcp140_2.dll’ を読み込めません。理由: ‘LoadFromFailure. Bad IL format. The format of the file ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/msvcp140_2.dll’ is invalid.’
08/26/2025 09:42:36 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/msvcp140_atomic_wait.dll’ を読み込めません。理由: ‘LoadFromFailure. Bad IL format. The format of the file ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/msvcp140_atomic_wait.dll’ is invalid.’
08/26/2025 09:42:36 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/msvcp140_codecvt_ids.dll’ を読み込めません。理由: ‘LoadFromFailure. Bad IL format. The format of the file ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/msvcp140_codecvt_ids.dll’ is invalid.’
08/26/2025 09:42:36 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/msvcp140.dll’ を読み込めません。理由: ‘LoadFromFailure. Bad IL format. The format of the file ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/msvcp140.dll’ is invalid.’
08/26/2025 09:42:36 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/vcruntime140_1.dll’ を読み込めません。理由: ‘LoadFromFailure. Bad IL format. The format of the file ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/vcruntime140_1.dll’ is invalid.’
08/26/2025 09:42:36 => [Warning] 初期化: 指定した依存関係 ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/vcruntime140.dll’ を読み込めません。理由: ‘LoadFromFailure. Bad IL format. The format of the file ‘C:\Users\xxxxxx.nuget\packages\UiPath.emgucvbundle\1.3.0\lib/net6.0/vcruntime140.dll’ is invalid.’
08/26/2025 09:42:37 => [Error] ライブラリのコンパイル プロセス中に予期しないエラーが発生しました:
アセンブリのコンパイルから次のエラーが返されました:

  • C:\Users\xxxxxx\Documents\UiPath\ZZZ\ProjectName.local.codedworkflows\CodedWorkflow.cs(39,19): error CS0246: 型または名前空間の名前 ‘ConnectionsManager’ が見つかりませんでした (using ディレクティブまたはアセンブリ参照が指定されていることを確認してください)
  • C:\Users\xxxxxx\Documents\UiPath\ZZZ\ProjectName.local.codedworkflows\CodedWorkflow.cs(28,22): error CS0246: 型または名前空間の名前 ‘ConnectionsManager’ が見つかりませんでした (using ディレクティブまたはアセンブリ参照が指定されていることを確認してください)
  • C:\Users\xxxxxx\Documents\UiPath\ZZZ\ProjectName.local.codedworkflows\CodedWorkflow.cs(34,48): error CS0246: 型または名前空間の名前 ‘ConnectionsManager’ が見つかりませんでした (using ディレクティブまたはアセンブリ参照が指定されていることを確認してください)
  • C:\Users\xxxxxx\Documents\UiPath\ZZZ\ProjectName.local.codedworkflows\CodedWorkflow.cs(34,78): error CS0246: 型または名前空間の名前 ‘ConnectionsManager’ が見つかりませんでした (using ディレクティブまたはアセンブリ参照が指定されていることを確認してください)

.codedworkflows/*.csのnamespaceが現在のプロジェクト名と異なっておりました。(どういう経緯だったかは失念してしまいました)
こちらを現在のプロジェクト名と同じにしたら、エラーなくパブリッシュできました。
お騒がせいたしました。

こんにちは

取り急ぎnugetのキャッシュフォルダ

c:\Users\xxxx\.nuget\packages

を削除または(あとで戻せるように)一時的に別の場所に移動してから、Studio起動、当該プロジェクトをオープンして実行or パブリッシュ等をしてみてはと思います。

アドバイスありがとうございます。
先ほど記載しましたが、全然別の理由が原因でした。
現在、無事解決となっております。

1 Like

無事解決した場合は分かるようにSolutionにチェックをお願いします。

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.