NuGet: “Impossibile caricare uno o più dei tipi di richieste”
-
14-10-2019 - |
Domanda
ho installato NuGet in Visual Web Developer 2010 Express, ma quando vado a Esplora soluzioni, fare clic destro sulla cartella "Riferimenti" di un progetto, e selezionare "Aggiungi Biblioteca pacchetto Reference", immediatamente ottengo questo errore:
Impossibile caricare uno o più dei tipi richiesti. Recuperare la proprietà LoaderExceptions per ulteriori informazioni.
C'è solo un pulsante OK, e non c'è modo per me per recuperare le informazioni aggiuntive mi sta raccontando.
Si tratta di una nuova installazione di NuGet; Non ho mai installato sul PC in precedenza.
Come posso risolvere e / o diagnosticare questo errore così posso avere NuGet al lavoro?
Soluzione
It turns out this error occurs when PowerShell is not installed. In trying to further diagnose the problem, I went to Tools > Library Package Manager > Package Manager Console, and the console came up with red text that said:
Error: The Package Manager Console requires PowerShell 2.0 runtime, which is not detected on this machine. Please install the PowerShell 2.0 from http://support.microsoft.com/kb/968929 and restart Visual Studio.
After I installed PowerShell, the Add Library Package Reference dialog started working.
I've filed a bug report against NuGet, asking for a better error message when prerequisites are missing (and ideally for the installer to actually install the prerequisites): Item #530: "Unable to load one or more of the requested types" error