Can't compile the F# compiler on Windows - f#

I want compile F# on Windows
my Windows have installed .NET 4.7.2
I run build.cmd, as https://github.com/dotnet/fsharp said
got error:
Can't find property "PositionalBinding" for class "System.Management.Automation.CmdletBindingAttribute" at
C:\code\fsharpfromgithub\fsharp\eng\build.ps1:17 char 15
+ [CmdletBinding <<<< (PositionalBinding=$false)]
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyAssignmentException
I create a VM, install only .net core 2.2, but got same error
Is some one got same error? How to fix it, Thanks!

I think the error is more about PowerShell than .NET Framework or Core. See https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.cmdletbindingattribute?redirectedfrom=MSDN&view=powershellsdk-1.1.0
You might try installing this: https://www.nuget.org/packages/Microsoft.PowerShell.SDK/
Or updating your Windows SDK at https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk

Related

'Serilog' already has a dependency defined for 'Microsoft.CSharp'

I am trying to install serilog and I'm getting error
PM> Install-Package Serilog
Install-Package : 'Serilog' already has a
dependency defined for 'Microsoft.CSharp'. At line:1 char:1
+ Install-Package Serilog
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
Microsoft.CSharp is already referenced in my project
As #Tieson T. said, Update "Nuget Package Manager for Visual Studio" from Visual Studio Window > Tools > Extensions and Updates > Click Updates tab. Select Nuget plugin and update. Then restart the visual studio after installation complete. I tried (Windows 8.1 64bit & Visual Studio 2013 Ultimate) and it works.
To add to this. I had a similar issue but the problem was due to our build server being based on TFS 2012 and using an old version of MSBuild (which we can't update in the near term). Everything built and ran fine locally, but when the build server tried to run we got the same error.
The workaround I found was to go into the packages folder of the solution, find the package having the issue (in my case Serilog.2.3.0 and the associated Sink packages I had installed). Open the "lib" folder and you should see some folders associated to the various .Net frameworks. Delete the netstandard folders which correspond to the .Net Core versions.
The downside to this is you have to check in the folders you modify like this so MSBuild doesn't try to restore them.
Please do the 2 steps below, it works for me or teamcity/jenkins
If you still using the Nuget CommandLine 2.8, please try to upgrade to 3.5.
If you using the private Nuget Server, Please update the Serilog.2.3.0.nupkg with the steps below:
2.1 Update Nuget Spec File:
Remove
...
...
2.2 Remove the folder lib/netstandard1.0 and lib/netstandard1.0
2.3 Then redeploy the Serilog.2.3.0.nupkg to your private Nuget Server

Could not install EntityFramework 6.1.3

I'm using Visual Studio 2015 and windows 10.
I created a new web project (MVC) with no authentication, I Tried to install EntityFramework 6.1.3 with this command in package manager "Install-Package EntityFramewor" but I got this error :
Type 'get-help EntityFramework' to see all available Entity Framework
commands. Package 'EntityFramework 6.1.3' does not exist in folder
'C:\Projects\WebApplication1\packages' Install-Package : Object
reference not set to an instance of an object. At line:1 char:1
+ Install-Package EntityFramework -Version 6.1.3
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
I can install EntityFramework 6.1.2 without any problem.
using manage Nuget package install entityframework 6.1.2 then update it to 6.1.3.

MvcSiteMapProvider Installation Error

I got this error while installing the sitemapprovider for mvc:
Install-Package : Updating 'Microsoft.AspNet.Razor 3.2.2' to 'Microsoft.AspNet.Razor 2.0.20505.0' failed. Unable to find versions of
'Microsoft.AspNet.WebPages, Microsoft.AspNet.Mvc' that are compatible with 'Microsoft.AspNet.Razor 2.0.20505.0'.
At line:1 char:1
+ Install-Package MvcSiteMapProvider.MVC4
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
The error indicates you are installing the MvcSiteMapProvider.MVC4 NuGet package, but your project is MVC 5 (because it has Razor 3.2.2). You must install the package that matches your version of MVC (in this case, MvcSiteMapProvider.MVC5) into your project.
PM> Install-Package MvcSiteMapProvider.MVC5
Do note that the MvcSiteMapProvider NuGet package is obsolete and should not be installed into any project unless you intend to use MvcSiteMapProvider v3.x.
If you are upgrading from MvcSiteMapProvider v3 to v4, please see the upgrade guide.

Visual Studio cannot find custom tool RazorGenerator

I've installed the NuGet package for RazorGenerator.mvc and then run the shell command Enable-RazorGenerator and get the following message:
Exception calling "RunCustomTool" with "0" argument(s): "The custom tool 'RazorGenerator' failed. The method or operation is not implemented."At \packages\RazorGenerator.Mvc.1.3.2.0\tools\RazorGenerator.psm1:77 char:40+ $_.Object.RunCustomTool <<<< () + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : ComMethodTargetInvocation
I also tried right-clicking and selecting "Run Custom Tool" and it provides a dialog stating it cannot find the custom tool RazorGenerator on the system.
What am I missing?
I had that same problem too and I realized that along with the package for the solution you will also need to install the Visual Studio Extension called RazorGenerator
Go to Tools, then Extension Manager
Search for Razor Generator
Click the Download button.
Once the install has completed, restart Visual Studio.

Failure of Castle Winsor 3.0 NuGet installation

I'm trying to install Castle Windsor 3.0 using NuGet, and it fails with the following message:
PM> Install-Package Castle.Windsor
'Castle.Core (≥ 3.0.0)' not installed. Attempting to retrieve dependency from source...
Done.
Install-Package : Id is required.
Version is required.
Authors is required.
Description is required.
At line:1 char:16
+ Install-Package <<<< Castle.Windsor
+ CategoryInfo : NotSpecified: (:) [Install-Package], ValidationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.Cmdlets.InstallPackageCmdlet
I've tried it both using the command-line (above) and using the Library Package Manager.
My environment is a default MVC3.0 installation, using the web site template, in Visual Studio 2010, with absolutely nothing changed from the defaults.
The error looks like there is something wrong with the package being downloaded from NuGet.
Can anyone shed any light on this? I can work around it with a manual install of Castle Windsor, but would like to use NuGet if possible.
Thanks in advance for any suggestions.
Update NuGet to the latest version. I recently upgraded from 1.3 to 1.6, but had to completely reinstall (as administrator) to get my project working. I think it was for a FluentValidation.MVC3 project I was whipping up.
I had the same problem even having the latest version of NuGet. I had to settle for:
Install-Package Castle.Core -Version 2.5.2

Resources