PowerShell 3.0 Sharepoint scripts not working - sharepoint

Today my powershell updated to version 3.0. This version is build against and uses .NET runtime 4.0. The Sharepoint 2010 cmdlets require .NET 3.5 and don't work under 4.0. Anyone has an idea how to get scripts work?
I receive this error:
Remove-SPSite : Microsoft SharePoint is not supported with version 4.0.30319.296 of the Microsoft .Net Runtime.

try to launch powershell with : powershell.exe -version 2.0

I had some trouble with this today too but this worked out for me.
C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -version 2.0 -NoExit " & ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1 ' "
At first I think i had a trailing space which made it not work but you can always check it out with $psversiontable and make sure that CLRVersion is 2.0.50727.5466

powershell.exe -v 2 also should work fine
Edit:
it's better to uninstall windows update which caused this issue KB2506143
check this article
Do not install the Windows Management Framework 3.0 (KB2506143) on SharePoint 2010 Servers

Type "PowerShell -v 2" (without quotes). on the top of the script
then you for second run comment it using #, if the script hangout
This loads PowerShell version 2, and you should be able to use it for SharePoint. Just type 'Exit' to get back to PowerShell v3

Related

Task failed because "LC.exe" was not found, or the .NET Framework SDK v2.0 is not installed

Anyone have the same problem with me? With visual studio 2005.
Task failed because "LC.exe" was not found, or the .NET Framework SDK v2.0 is not installed. The task is looking for "LC.exe" in the "bin" subdirectory beneath the location specified in the SDKInstallRootv2.0 value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework. You may be able to solve the problem by doing one of the following: 1.) Install the .NET Framework SDK v2.0. 2.) Manually set the above registry key to the correct location. 3.) Pass the correct location into the "ToolPath" parameter of the task
I had done with below link but still don't work:
Task failed because "LC.exe" was not found after upgrade to Windows 8.1
And I downloaded the .net 2.0 sdk from https://www.microsoft.com/en-us/download/confirmation.aspx?id=1639 but can't install on windows 10
Ok I just fixed my issue by reinstalling VS2005. Thanks for viewing that

Rider doesn't see NetCore 3.0

I had used VS CODE before. But now I would like to try JetBrains Rider. Currently, I have only NetCore 3.0. But before I had 2.2. I had removed old NetCore and installed new one. I am trying to create new project. But Rider don't see NetCore 3.0.
I did not see ability to change NetCore SDK. My operation system is Linux Mint 18. I have only one NetCore version. And it's 3.0.
Why it's happening?
It is pretty common problem. I have solved it by specifying path to .Net Sdk manually. This is the screen of settings:
Specify path to .NET binary file. It is usually has the following path /home/<your_user>/dotnet/dotnet
Specify path to MSBuild file. For example my path is the next : /home/aleksej/dotnet/sdk/3.0.100-preview6-012264/MSBuild.dll
Save
Profit!
P.S. My operation system is Linux Mint 19.1. And version of .Net Core is not important in this case.
Update
I forgot about one important moment. If you need to change .NET version for your solution, you have to place special global.json file in the root of your solution. If you are changing .NET version for a project - put global.json on the project root path.
Example of global.json for changing .NET version:
{
"sdk": {
"version": "2.2.300"
}
}
If you want to find the location of your sdk then write the following command: dotnet --list-sdks. It has to show you 3.1.403 [/usr/share/dotnet/sdk] or similar to it. If it's not then consider it installed using the following guide Install .NET Core on Linux . Then select the dotnet file in .NET CORE CLI executable path, with it's respective MSBuild.dll .
PD: Remember to save the changes globally!!!.
what solved for me was remove the .idea folder and start again.
I have to use the Jetbrain MSE build
I have to do some set of things to work, due to the windows security I have some issue
On windows 11 do this
launch powershell as an admin
Set-ExecutionPolicy Unrestricted
Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Set-ExecutionPolicy restricted
IGNORE THE ERRORS
on windows 10 do this
launch powershell as an admin}
run get-AppxPackage Microsoft.SecHealthUI -AllUsers | Reset-AppxPackage
if it doesn't work do this
run Add-AppxPackage -Register -DisableDevelopmentMode "C:\Windows\SystemApps\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy\AppXManifest.xml"
run get-AppxPackage Microsoft.SecHealthUI -AllUsers | Reset-AppxPackage
Then follow the instruction from here
https://rider-support.jetbrains.com/hc/en-us/articles/360006365380

Azure Node.js Express App scaffold.xml Missing

Am following Microsoft's "Getting Started" tutorial to deploy a Node.js Express app as a Cloud Service.
After carefully installing all the tools on two machines, one Win 7 and one Win 8, I get down to the point of generating "Hello World" and the tutorial suggests running the intuitively named: New-AzureServiceProject helloworld in Windows PowerShell.
Here is what happens:
PS C:\node> New-AzureServiceProject helloworld
New-AzureServiceProject : Could not find a part of the path 'C:\Program Files (x86)\Microsoft
SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\AzureRM.Profile\Resources\Scaffolding\General\scaffold.xml'.
At line:1 char:1
+ New-AzureServiceProject expressapp
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureServiceProject], DirectoryNotFoundException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.CloudService.Development.Scaffolding.NewAzureServiceProjectCommand
Taking a look at my system after installing Powershell and the Azure SDK as instructed, I DO have a directory:
C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\AzureRM.Profile
However, that directory does NOT have a subdirectory "Resources" and hence it never finds the scaffold.xml file....
I tried creating the subdirectory Resources\Scaffolding\General inside of AzureRM.profile. That changed the error to simply "could not find scaffold.xml"
I tried setting the write positions on "General" to be wide open. No change.
The above error is on the Win 8 machine. On my Win 7 machine after digging more carefully into the install and going multiple layers deep into prereqs not mentioned in the tutorial, AzureRM.Profile ends up installed in C:\Program Files\C:\Program Files\WindowsPowerShell\Modules rather than in C:\Program Files (x86)\Microsoft
SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager but the behavior is identical.
I have looked all over the web and have not been able to find any information on the missing scaffold.xml that might point to a solution. Is this a template that New-AzureServiceProject needs to create the app? Or is this something that is supposed to be generated by New-AzureServiceProject?
Any suggestions would be appreciated...
Thanks!
I solved this problem by copying folder
C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Services\Resources
to
C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\AzureRM.Profile
Need to copy the Resources folder from:
C:\Program Files\WindowsPowerShell\Modules\Azure\3.1.0\Compute
to
C:\Program Files\WindowsPowerShell\Modules\AzureRM.profile\2.3.0\Resources\Scaffolding\General
According your error message from PowerShell, it seems that you miss installed powershell AzureRM.* modules.
Please try to run the following commands from the Windows PowerShell console running as Administrator:
PS C:\> Install-Module AzureRM
PS C:\> Install-AzureRM
Then run New-AzureServiceProject helloworld again.
Meanwhile, if you want to get started with the node.js application on Azure Web Apps, you can refer to Azure Website Cmdlets.
Apologies for the terrible experience. This looks like a bug in one particular version of Azure PowerShell. To diagnose, we would need to know which version - if you used the msi installer, or WebPI, you will find thins in the 'Uninstall a Program' control panel, the entry is 'Microsoft Azure PowerShell'.
One piece of confusion in some of the comments - the hosted service cmdlets are part of the older RDFE (Service Management) commands in Azure. The cmdlets that support these are in the 'Azure' module, and not in any of the 'AzureRM' modules.
To install the latest version, I highly encourage you to use Web Platform Installer, or the msi installer that you can retrieve from our GitHub repo. PowerShell Gallery is a great solution as well, if you are very comfortable with PowerShell module management.
I will bring this tutorial to the attention of the documentation team. Meanwhile, if you can identify the azure powershell version and the sdk version you are using, I can see if there is a fix for the problem.
Copy content from
C:\Program Files\WindowsPowerShell\Modules\Azure\4.3.1\Services\Resources\Scaffolding\General
To
C:\Program Files\WindowsPowerShell\Modules\AzureRM.profile\3.3.1\Resources\Scaffolding\General

Unable to install VSIX in VS 2012 & Windows 10

I am trying to install RXX(VSIX Isntaller) in windows 10 & VS 2012. But it gives error as below
The extension 'Razor(cshtml) pre-processor requires a version of the .NET framework that is not installed.
It is working properly in Win 7 ( .NET Framework 4.5 ). When I tried to install .NET framework 4.5 in Win 10, its no allowing to do the same.
Can anyone suggest anything for this?
Thanks
I expect the VSIX manifest to reference a specific .NET framework version and doesn't specify a range. Since .NET 4.6 replaces 4.5 it may cause these type of issues.
Extract the VSIX using your favorite extraction tool (it's a zip file), edit the manifest file by removing or updating the dependencies specified and zip it back up.
The only way to install the extension was executing the VSIXInstaller.exe as administrator and passing the VSIX file as parameters. To do that, follow this procedure:
Open a CMD window as Administrator
Go to Common, IDE folder of the VS 2015 installation. In my case:
CD C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
Execute the installer passing the VSIX file as parameter. In my case:
VSIXInstaller.exe c:\AppBuilder.vsix
Finally, the installer will start the installation!
I hope it helps you
Source

Error 109 WAT080 : Failed to locate the Windows Azure SDK 2.1 on Visual Studio 2013

I have Visual Studio 2013 with update 3 installed.
On the first time i opened my project, it prompted me to download and install
Azure SDK 2.2 and so i did.
When i tried to build, it fails and gives me this error message:
Error 109 WAT080 : Failed to locate the Windows Azure SDK. Please make sure the Windows Azure SDK v2.1 is installed.
So I installed SDK 2.1 but the build still fails with the same error.
These are my installed azure SDKs: 2.1, 2.2, 2.3, 2.4.
I also confirmed that the folders of each version are NOT missing here:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Windows Azure Tools
We started the cloud project which is an MVC site on the 3rd quarter of 2013 when the Windows Azure 2.2 released and I had no problem.
Is it possible that these Azure SDKs are conflicting?
It's fixed now. Unfortunately, you cannot find the Azure SDK 2.2 for VS 2013 and older versions in web platform installer anymore. So you have to manually install all the components (according to version).
I noticed that this folder is missing.
C:\Program Files\Microsoft SDKs\Windows Azure.NET SDK\v2.2
Which means that WindowsAzureLibsForNet-x64.msi is not yet installed.
You can download it here: http://www.microsoft.com/en-us/download/details.aspx?id=40893.
I've seen solved threads about this but the solution didn't solve for everyone. I hope this would help.
I had to restart Visual Studio after Azure SDK install. ServiceHostingSDKBinDir was set fine in msbuild, but not in the VS.
I added C:\Program Files\Microsoft SDKs\Windows Azure.NET SDK\v2.3 (or whatever sdk you need eg. 2.2, 2.4) to the system path and it fixed the issue of VS2013 not being able to find the SDK.
After I'd changed the system path, I had to restart VS2013.

Resources