Package manager console fails to initialize - powershell

Whenever I try to open package manager console in Visual studio 2013 update 3 I get this error :
Cannot load Windows PowerShell snap-in Microsoft.PowerShell.Management because of the following error: > Could not load file or assembly
'file:///C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Microsoft.PowerShell.Commands.Management.dll' or
one of its dependencies. The system cannot find the file specified.
I have uninstalled/Re installed powershell. It didn't change anything.
any ideas?
Thank you.

Related

Powershell Publish-Module to Powershell Gallery fails after creating Nuget Package

I am trying to publish a new version of a Powershell module to the Powershell Gallery by using
Publish-Module -Name "Nuttercode-PRTG" -NuGetApiKey $apiKey -Verbose -RequiredVersion 1.4
The module .psm1 and .psd1 files can be found here.
After dotnet.exe created the package in {myUserDir}\AppData\Local\Temp\{random numbers}\Nuttercode-PRTG it reports:
VERBOSE: finished running C:\Program Files\dotnet\dotnet.exe with exit code 0
VERBOSE: Created Nuget Package
VERBOSE: Successfully created nuget package at
Write-Error: Failed to publish module 'Nuttercode-PRTG': 'Cannot bind argument to parameter 'NupkgPath' because it is an empty string.'.
Afterwards the temp-folder gets deleted. To me this sounds like an internal problem of Publish-Module or dotnet.exe, but I have no idea what is going on or if I am doing something very wrong myself. I also created a new api key just in case but it did not affect the result.
I am using Windows 10 20H2 (Build 19042.1469), Powershell 7.2.2, PowerShellGet 2.2.5, and dotnet.exe 6.0.201. I am able to replicate the problem on another computer using the same command and arguments using Windows 11 21H2 (Build 22000.556), Powershell 7.2.1, PowershellGet 2.2.5, and dotnet.exe 5.0.102.

Cordova app for Windows, NuGet fails to get correct version of System.Collections.Specialized

I'm tearing my hair out trying to build a windows app using Cordova. The build error I'm getting is:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\
MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.targets(377, 5):
error : The package System.Collections.Specialized with version 4.0.0
could not be found in C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\.
Run a NuGet package restore to download the package.
[C:\cygwin64\home\Owner\src\apps\mytestapp-
gen\platforms\windows\CordovaApp.Windows10.jsproj]
In visual studio, I attempt to add the version of the package to the project and I get the following error:
Severity Code Description Project File Line Suppression State
Error Could not install package 'System.Collections.Specialized
4.0.0'. You are trying to install this package into a project that targets
'native,Version=v0.0', but the package does not contain any assembly
references or content files that are compatible with that framework. For
more information, contact the package author.
Can anyone advise how to resolve this?
I've looked at this very old question How can I make my managed NuGet package support C++/CLI projects? but I can't find anything (particually from the VS2017 era) that helps
May be, this helps others to solve the issue:
My Visual Studio 2017 installation must obviously have been damaged when removing the Visual Studio 2015 installation from that same machine. After I performed a repair of Visual Studio 2017 via Visual Studio Installer the isuue disappeared.

NuGet restore during first asp.net vNext project

Today I installed ASP.NET 5 on windows and begun creating my first application in Visual Studio 2015.
When the project loads I get an error: "Package restore failed", specifically the following error:
Restore failed Det gick inte att hitta en del av s�kv�gen C:\Users\h\.dnx\packages\Microsoft.Win32.Primitives\4.0.0\Microsoft.Win32.Primitives.4.0.0.nupkg.sha512. NuGet Config files used:
C:\Users\h\AppData\Roaming\NuGet\nuget.config
C:\Users\h\documents\visual studio 2015\Projects\NextTest\nuget.config
Feeds used:
https://api.nuget.org/v3-flatcontainer/
C:\Program Files (x86)\Microsoft Web Tools\DNU
When I look for the missing file I find the following path missing:
C:\Users\h\.dnx\packages\Microsoft.Win32.Primitives\4.0.0\Microsoft.Win32.Primitives.4.0.0.nupkg.sha512
But this one exists, note the extra 0 in the version:
C:\Users\h\.dnx\packages\Microsoft.Win32.Primitives\4.0.0.0\Microsoft.Win32.Primitives.4.0.0.0.nupkg.sha512
How would I go about to solve this?
I've tried to search through the project files but no mention of neither Primitives nor verion 4.0.0.
The "Solution DNX SDK version" is 1.0.0-beta8, (beta5 was also available but not selected).
Delete C:\Users\h.dnx\packages folder and try running "dnu restore" command.

Mongodb Error on running phpunit test

I tried to run mongdodb's driver test using phpunit as stated at http://www.php.net/manual/en/mongo.testing.php but it seems to have a problem with a MongoInt32Test.php filew.
# phpunit tests/mongosuite.php
Warning: require_once(MongoInt32Test.php): failed to open stream: No such file or directory in C:\Documents and Settings\owner\Desktop\mongo-php-driver\tests\MongoSuite.php on line 4
Fatal error: require_once(): Failed opening required 'MongoInt32Test.php' (include_path='.;\programming_tools\xampp-portable\php\PEAR') in C:\Documents and Settings\owner\Desktop\mongo-php-driver\tests\MongoSuite.php on line 4
I am using a php_mongo-1.3.1-5.4-vc9.dll and running mongodb 2.0.8 in windows xp. Anybody knows how to fix this? I can't find MongoInt32Test.php anywhere.
The PHPUnit tests in the extension are legacy tests and are no longer supported. I created a ticket, PHP-695, to remind us to remove mention of them from the documentation. All extension tests are phpt files, and instructions for executing them are documented in the GitHub repository.

psake msbuild error

I want to build my solution using psake and msbuild (v3.5) on an x64 pc. When I execute the script I get the following error:
error MSB4019: The imported project "C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
The message is correct, the file is missing but I have installed the 32 bit version of VS 2008 and therefor it is in the folder 'C:\Program Files (x86)...'
Is there any solution to tell msbuild to use the 32 bit version, not the 64 bit version?
You can specify what framework version is used for build. See $framework variable. In your case you need $framework = '3.5×86' at the beginning of the script.