dotnet / dotnet/docs

Failed to translate expression 'new System.Random().Next(1, MaxNumber + 1)'

Open
#42,248 1 comment 0 reactions 0 assignees View on GitHub
:watch: Not Triaged dotnet-framework/svc wf/subsvc
Dominant language
No language data
Stars
4.8k
Forks
6.1k
Avg merge
19h 10m
Merged PRs (30d)
268

Description

### Type of issue

Code doesn't work

### Description

Hello
I have tried to do your sample. I can't build it. It falls with error below:

Error Failed to translate expression 'new System.Random().Next(1, MaxNumber + 1)' because of the following error:
Translating the method 'Random.Next' or one of its overloads to an activity is not supported. WorkflowTest2 C:\Users\hf\source\repos\WorkflowTest2\WorkflowTest2\Workflow1\Workflow.xaml 65

Regards

### Page URL

https://learn.microsoft.com/en-us/dotnet/framework/windows-workflow-foundation/how-to-create-a-flowchart-workflow

### Content source URL

https://github.com/dotnet/docs/blob/main/docs/framework/windows-workflow-foundation/how-to-create-a-flowchart-workflow.md

### Document Version Independent Id

2e8a64e6-e2ce-cacd-bc6f-645bc95eaf49

### Article author

@gewarren

### Metadata

* ID: f8a93236-b0ab-b367-b086-deadf52a7c82
* Service: **dotnet-framework**
* Sub-service: **wf**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.