Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Getting started" steps fail with "FS0810: Property 'CultureName' cannot be set" #353

Closed
cmeeren opened this issue Nov 15, 2020 · 7 comments

Comments

@cmeeren
Copy link

cmeeren commented Nov 15, 2020

Description

When following the "Getting started" steps in the readme, the dotnet build step fails.

Repro steps

dotnet new -i FSharp.TypeProviders.Templates
dotnet new typeprovider -n LemonadeProvider -lang F#
cd LemonadeProvider
dotnet tool restore
dotnet paket update
dotnet build -c release

Expected behavior

The build succeeds.

Actual behavior

The build fails with the following errors:

D:\Source\Repos\LemonadeProvider\paket-files\fsprojects\FSharp.TypeProviders.SDK\src\ProvidedTypes.fs(2090,13): error FS0810: Property 'CultureName' cannot be set [D:\Source\Repos\LemonadeProvider\src\LemonadeProvider.DesignTime\LemonadeProvider.DesignTime.fsproj]
D:\Source\Repos\LemonadeProvider\paket-files\fsprojects\FSharp.TypeProviders.SDK\src\ProvidedTypes.fs(3162,13): error FS0810: Property 'CultureName' cannot be set [D:\Source\Repos\LemonadeProvider\src\LemonadeProvider.DesignTime\LemonadeProvider.DesignTime.fsproj]

Known workarounds

Change minimum target to net461. Replace all instances of net45 with net461, except for in netfx.props, where you can just delete the lines referencing net45* frameworks (I suspect the removal of those lines isn't strictly speaking necessary).

@cmeeren
Copy link
Author

cmeeren commented Nov 15, 2020

To be specific, the following lines are invalid on net45 because AssemblyName.CultureName is not settable on net45:

asmName.CultureName <- System.Globalization.CultureInfo.InvariantCulture.Name

asmName.CultureName <- System.Globalization.CultureInfo.InvariantCulture.Name

@cmeeren
Copy link
Author

cmeeren commented Nov 16, 2020

I was able to work around the issue by targeting net461 instead of net45. I simply replaced all instances of net45 with net461, except for in netfx.props, where I just deleted the lines referencing net45* frameworks.

@cmeeren
Copy link
Author

cmeeren commented Nov 16, 2020

I see that #339 was merged some weeks ago, so I tried with the contents of this folder on master and it works fine. I suggest the dotnet new template is updated. I'll leave this for you to close.

@JordanMarr
Copy link

I see that #339 was merged some weeks ago, so I tried with the contents of this folder on master and it works fine. I suggest the dotnet new template is updated. I'll leave this for you to close.

I’m having the same issue. So you are saying that this issue has been fixed but the template hasn’t been updated yet?

@cmeeren
Copy link
Author

cmeeren commented Nov 26, 2020

Correct.

@borseno
Copy link

borseno commented Mar 29, 2021

I removed the 45s from netfx and changed net45 to 461 in project files, (just as in the instruction above) but it now gives me this error:

C:\Users\user\source\repos\HelloWorldProvider\paket-files\fsprojects\FSharp.TypeProviders.SDK\src\ProvidedTypes.fs(55,9): error FS0074: The type referenced through 'System.String' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard'. [C:\Users\user\source\repos\HelloWorldProvider\src\HelloWorldProvider.DesignTime\HelloWorldProvider.DesignTime.fsproj]

@dsyme
Copy link
Contributor

dsyme commented Sep 21, 2021

This is fixed now in master

@dsyme dsyme closed this as completed Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants