Come altri hanno indicato, stdole.dll
è un assembly di interoperabilità primario per un gruppo di componenti di interoperabilità COM di Office. Puoi determinare il motivo per cui viene incluso nel tuo progetto facendo quanto segue.
In Visual Studio, passare a Tools > Options > Projects and Solutions > Build and Run
. Modifica l'impostazione "Produttività output del progetto MSBuild" su Detailed
. Ora pulisci e ricostruisci il tuo progetto.
Aprire la finestra di output e cercare stdole
. Si dovrebbe trovare una sezione come questa:
25> Dependency "stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
25> Resolved file path is "D:\Program Files (x86)\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\Common\stdole.dll".
25> Reference found at search path location "{Registry:Software\Microsoft\.NETFramework,v4.0,AssemblyFoldersEx}".
25> For SearchPath "D:\Git\FoobarServices\Dependencies\Dependencies".
25> Considered "D:\Git\FoobarServices\Dependencies\stdole.winmd", but it didn't exist.
25> Considered "D:\Git\FoobarServices\Dependencies\stdole.dll", but it didn't exist.
25> Considered "D:\Git\FoobarServices\Dependencies\stdole.exe", but it didn't exist.
25> For SearchPath "{CandidateAssemblyFiles}".
25> Considered "Dependencies\CrystalDecisions.CrystalReports.Engine.dll", but its name "CrystalDecisions.CrystalReports.Engine" didn't match.
25> Considered "Dependencies\CrystalDecisions.Enterprise.Framework.dll", but its name "CrystalDecisions.Enterprise.Framework" didn't match.
25> Considered "Dependencies\CrystalDecisions.Enterprise.InfoStore.dll", but its name "CrystalDecisions.Enterprise.InfoStore" didn't match.
25> Considered "Dependencies\CrystalDecisions.ReportSource.dll", but its name "CrystalDecisions.ReportSource" didn't match.
25> Considered "Dependencies\CrystalDecisions.Shared.dll", but its name "CrystalDecisions.Shared" didn't match.
25> Considered "Dependencies\CrystalDecisions.Web.dll", but its name "CrystalDecisions.Web" didn't match.
25> For SearchPath "{TargetFrameworkDirectory}".
25> Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\stdole.winmd", but it didn't exist.
25> Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\stdole.dll", but it didn't exist.
25> Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\stdole.exe", but it didn't exist.
25> For SearchPath "{Registry:Software\Microsoft\.NETFramework,v4.0,AssemblyFoldersEx}".
25> Considered AssemblyFoldersEx locations.
25> Required by "CrystalDecisions.Web, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL".
25> Required by "CrystalDecisions.ReportSource, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL".
25> Required by "CrystalDecisions.CrystalReports.Engine, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL".
25> Required by "CrystalDecisions.Enterprise.InfoStore, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304".
25> The ImageRuntimeVersion for this reference is "v1.0.3705".
Potete vedere dove Visual Studio cercato per l'assemblaggio e ciò richiede in fondo. Nel mio caso si tratta di un gruppo di vecchi assembly Crystal Reports.
A volte è possibile incorporare i tipi di interoperabilità tramite le dipendenze come suggerisce Tony, ma non sempre. Per me, gli assembly Crystal Reports non supportano questo.
Ho risolto questo problema (e l'insidioso uno scottsanpedro menzionato) copiando lo stdole.dll
(32 KB, firmato digitalmente) da C:\Program Files (x86)\Microsoft.NET\Primary Interop Assemblies\
in una cartella "Dipendenze" all'interno del mio progetto. Ho aggiunto il file al mio progetto e aggiunto un riferimento esplicito ad esso (Aggiungi riferimento> Sfoglia).Finalmente ho aperto le nuove proprietà del riferimento e impostato Embed Interop Types
a True
.
Questa sembra essere una situazione migliore. Non dovrei aver bisogno di preoccuparmi di ottenere una versione senza firma dell'assembly.
Che ne dici? Il mio primo downvote. Un downvote senza feedback è altamente improduttivo. –
Sono interessato a questa domanda, perché stdole.dll viene visualizzato su tutte le app che faccio. Pubblico con click-once e sta causando problemi con Visual Studio 2015. Potrebbe non essere correlato a questa domanda, ma altre persone potrebbero trovare questa domanda alla ricerca di quella DLL. Questo altro ragazzo lo ha sostituito con una copia firmata nel suo: https://iznum.wordpress.com/2013/04/22/strong-name-signature-not-valid-for-this-assembly-stdole-dll/ – 249076
Un altro ragazzo ha postato un bug su questo: https://connect.microsoft.com/VisualStudio/feedback/details/1658072/could-not-load-assembly-file-stdole-dll-that-were-not-actually-using – 249076