Closed eeevans closed 6 years ago
It is a PSPropertyAdapter
. I haven't had this problem and use the module frequently in both Windows PowerShell and PowerShell Core. Please update to a newer version and see if it repros. IF it does, please also include the $PSVersionTable
from whatever PowerShell instance you're using as it could be a bug on their side.
when I install any of the PreRelease versions they don't contain the files Microsoft.VisualStudio.Setup.Configuration.Interop.dll Microsoft.VisualStudio.Setup.PowerShell.dll
If I download the zip file from the project site, the Interop dll is from 6/23/2017 so not sure if that is correct but it then gives the same error.
Name Value
PSVersion 5.1.17134.112 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.17134.112 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
The interop DLL rarely needs to be updated, but I do see the prerelease versions are missing the DLLs. I'll take a look. But 2.0.1.32208 certainly does contain these DLLs. That is the version you reported originally. Could you clarify which module version you're reporting?
VSSetup 2.0.1.32208 - has the DLLs - gives the error All 3 prerelease complain about the missing DLLs; when I download the zip files from github and copy the files there manually, they also give the error. This is on 2 different developer machines with Windows 10
The missing DLLs I can repro. In fact, I'm just about ready to push a commit and prep a release. But you're the first to report the other issue after several hundred thousand downloads and untold more times the module has been loaded. The InstanceAdapter
is definitely a PSPropertyAdapter
so I'm not sure why PowerShell is complaining.
Can you run the following and paste the result (replace the error record index with whatever is appropriate, but the following should work as-is):
import-module vssetup
$Error[0].Exception | select * | clip
ErrorRecord : The following error occurred while loading the extended type data file: Error in TypeData "Microsoft.VisualStudio.Setup.Instance": Type "Microsoft.VisualStudio.Setup.PowerShell.InstanceAdapter" should be a PSPropertyAdapter.
WasThrownFromThrowStatement : False Message : The following error occurred while loading the extended type data file: Error in TypeData "Microsoft.VisualStudio.Setup.Instance": Type "Microsoft.VisualStudio.Setup.PowerShell.InstanceAdapter" should be a PSPropertyAdapter.
Data : {} InnerException : TargetSite : Void ThrowTypeOrFormatErrors(System.String, System.String, System.String) StackTrace : at System.Management.Automation.Runspaces.InitialSessionState.ThrowTypeOrForm atErrors(String resourceString, String errorMsg, String errorId) at System.Management.Automation.Runspaces.InitialSessionState.UpdateTypes(Exe cutionContext context, Boolean updateOnly) at System.Management.Automation.Runspaces.InitialSessionState.Bind_UpdateType s(ExecutionContext context, Boolean updateOnly) at System.Management.Automation.Runspaces.InitialSessionState.Bind(ExecutionC ontext context, Boolean updateOnly, PSModuleInfo module, Boolean noClobber, Boolean local) at System.Management.Automation.Runspaces.InitialSessionState.Bind(ExecutionC ontext context, Boolean updateOnly) at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleManifest(String moduleManifestPath, ExternalScriptInfo manifestScriptInfo, Hashtable data, Hashtable localizedData, ManifestProcessingFlags manifestProcessingFlags, Version minimumVersion, Version maximumVersion, Version requiredVersion, Nullable`1 requiredModuleGuid, ImportModuleOptions& options, Boolean& containedErrors) HelpLink : Source : System.Management.Automation HResult : -2146233087
That's a different error. Please type $Error
first, figure out the index of the original error you reported, and use that (the stack - the array - grows "down"). For example, you might need $Error[1]
. You can examine it before you paste it here and make sure the error message represents the issue you reported.
sorry, I had uninstalled and downloaded the packages to look for the files and forgot to install again before running the commands...I updated the error.
Can you run process monitor (https://sysinternals.com, procmon) and fuslogvw.exe (part of the Windows / .NET SDK). From the former, is the DLL being loaded fully? From the latter, do you see any fusion errors reported?
Or are you otherwise aware of any policies that prevent unsigned files (either Authenticode or strong name, though I'm not aware of any policy settings that prevent the loading of non-strong named-signed files) from being loaded? I don't see an inner exception (I was hoping maybe to see a TypeLoadException
or something like that, but no) so I doubt that's the case.
But I'm afraid I just can't repro this nor has it been reported before, and I know quite a few people who use it regularly besides myself. It's likely a difference in the machines' configuration (my home machine loads this fine and is pretty standard with not a lot of extra non-Store software - pretty much VS, VSCode, git, gpg, vim, and a few other basics).
Assembly Binder Log Entry (6/21/2018 @ 5:29:01 PM)
The operation failed. Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll Running under executable C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe --- A detailed error log follows.
LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe.Config LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: The same bind was seen before, and was failed with hr = 0x80070002. ERR: Unrecoverable error occurred during pre-download check (hr = 0x80070002).
Starting from fresh powershell: Assembly Binder Log Entry (6/21/2018 @ 5:43:37 PM)
The operation failed. Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll Running under executable C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe --- A detailed error log follows.
LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe.Config LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Attempting download of new URL file:///C:/Windows/System32/WindowsPowerShell/v1.0/Microsoft.VisualStudio.Setup.PowerShell.DLL. LOG: Attempting download of new URL file:///C:/Windows/System32/WindowsPowerShell/v1.0/Microsoft.VisualStudio.Setup.PowerShell/Microsoft.VisualStudio.Setup.PowerShell.DLL. LOG: Attempting download of new URL file:///C:/Windows/System32/WindowsPowerShell/v1.0/Microsoft.VisualStudio.Setup.PowerShell.EXE. LOG: Attempting download of new URL file:///C:/Windows/System32/WindowsPowerShell/v1.0/Microsoft.VisualStudio.Setup.PowerShell/Microsoft.VisualStudio.Setup.PowerShell.EXE. LOG: All probing URLs attempted and failed.
get-module -list packagemanagement, powershellget
Running Process Monitor and examining what files PowerShell is trying to open would really help.
I understand it's probably something with my environment. I often have Path issues after installing SQL 2K8 R2, 2012, 2014, 2016 at the same time...each adds 4 or 5 paths to the Path env variable and gives me grief. I appreciate any help or pointers but understand this is not really an issue with the package.
The context for all the packages is Machine...I'm not a big fan of User.
C:\Users\ed.evans> get-module -list packagemanagement, powershellget
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
Script 1.1.7.2 PackageManagement {Find-Package, Get-Package, Get-PackageProvider, ... Binary 1.0.0.1 PackageManagement {Find-Package, Get-Package, Get-PackageProvider, ... Script 1.6.5 PowerShellGet {Find-Command, Find-DSCResource, Find-Module, Fin... Script 1.0.0.1 PowerShellGet {Install-Module, Find-Module, Save-Module, Update...
Procmon logfile here https://gist.github.com/eeevans/22450c36cbf7a6a41145354f0645e11f
It's definitely being found:
"9:20:49.4941699 AM","powershell.exe","26452","CloseFile","C:\Program Files\WindowsPowerShell\Modules\VSSetup\2.0.1.32208\Microsoft.VisualStudio.Setup.PowerShell.dll","SUCCESS",""
Both modules above are pretty old. Try updating them first. You may actually need to use install-module
rather than update-module
because those appear to be the in-box versions that don't have the metadata to upgrade (i.e. pre-installed):
install-module -force packagemanagement, powershellget
Then try to reload the VSSetup
module. FWIW, I was still able to load this with older versions of those packages as well.
So, I installed Powershell Core latest and VSSetup work fine in there so it is definitely something wrong in the normal Powershell. I ran sfc /scannow to check for corrupt system files and that didn't find anything.
As for the versions of PackageManagement and PowershellGet they are 1.1.7.2 and 1.6.5 respectively which is in the output above. They also have 1.0.0.1 but the formatting got screwed up in pasting into github comment.
My only other suggestion is to remove the module and try re-installing it. I'm really not sure what else you could try, but it's pretty clear this isn't the module so I'm resolving as external.
I've sent an email internally to the PowerShell team but no closer to an answer. If the above suggestion doesn't fix it, you might try comparing procmon or even fusion logs (logging all bindings - even successful ones) to see if some policy on the machine is causing this problem. I'll post back if I hear anything new.
version 2.0.1.32208
import-module vssetup import-module : The following error occurred while loading the extended type data file: Error in TypeData "Microsoft.VisualStudio.Setup.Instance": Type "Microsoft.VisualStudio.Setup.PowerShell.InstanceAdapter" should be a PSPropertyAdapter. At line:1 char:1