Tôi đã viết một ứng dụng VB.NET đơn giản hoạt động tốt trên máy phát triển.Ứng dụng bị treo khi khởi động - thiếu Microsoft.VisualBasic.PowerPacks
Tuy nhiên trên một máy khác, mặc dù .NET Framework được cài đặt, nó bị treo khi khởi động với System.InvalidOperationException.
Có vẻ như đã xảy ra sự cố với việc tìm kiếm hội đồng Visual Basic.
Đây là một trong những thất bại (tôi đã thay thế thông tin nhạy cảm với ba dấu chấm):
*** Assembly Binder Log Entry (16/06/2013 @ 15:45:12) ***
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\Users\....
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = ...
LOG: DisplayName = Microsoft.VisualBasic.PowerPacks.Vs, Version=10.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/Users/......
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MSystemAdmin.exe
Calling assembly : MSystemAdmin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.VisualBasic.PowerPacks.Vs, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/.../Desktop/Microsoft.VisualBasic.PowerPacks.Vs.DLL.
LOG: Attempting download of new URL file:///C:/.../Desktop/Microsoft.VisualBasic.PowerPacks.Vs/Microsoft.VisualBasic.PowerPacks.Vs.DLL.
LOG: Attempting download of new URL file:///C:/.../Desktop/Microsoft.VisualBasic.PowerPacks.Vs.EXE.
LOG: Attempting download of new URL file:///C:/.../Desktop/Microsoft.VisualBasic.PowerPacks.Vs/Microsoft.VisualBasic.PowerPacks.Vs.EXE.
LOG: All probing URLs attempted and failed.
Nó hoạt động chỉ với DLL, nhưng tôi tưởng tượng rằng việc cài đặt các gói nguồn sẽ thực hiện công việc mà không có dll. –
Cảm ơn bạn đã bỏ phiếu, nhưng thực ra Hans Passant là người đưa ra câu trả lời đúng. Trong thực tế, tôi đã có vấn đề này và nên đã xem xét trường hợp cụ thể để nhớ điều tập tin .dll. Trong mọi trường hợp, tôi tiếp tục nghĩ rằng có/không có Visual Studio cài đặt có liên quan cho các PowerPacks; các liên kết được cung cấp bù đắp thiếu này (không chắc chắn nếu các tập tin .dll). – varocarbas