Problem on the basic usage.
See original GitHub issueHi, I’ve tried to use the basic usage on my machine with SDK .net 6.0.100, but I cannot compile due to the following errors:
- Program.cs(13, 2): [CS0246] The type or namespace name ‘UnionAttribute’ could not be found (are you missing a using directive or an assembly reference?);
- Program.cs(13, 2): [CS0246] The type or namespace name ‘Union’ could not be found (are you missing a using directive or an assembly reference?);
This is my cproj and my Program.cs:
` <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Dunet" Version="1.0.0" />
</ItemGroup>
</Project>`
`using Dunet;
var shape = new Shape.Rectangle(3, 4); var area = shape.Match( circle => 3.14 * circle.Radius * circle.Radius, rectangle => rectangle.Length * rectangle.Width, triangle => triangle.Base * triangle.Height / 2 ); Console.WriteLine(area);
[Union] partial record Shape { partial record Circle(double Radius); partial record Rectangle(double Length, double Width); partial record Triangle(double Base, double Height); }`
What I’m missing?
Issue Analytics
- State:
- Created a year ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Computer Basics: Basic Troubleshooting Techniques
Whenever you have a problem with your computer, don't panic! There are many basic troubleshooting techniques you can use to fix issues like...
Read more >How to Write a Problem Statement (With 3 Examples)
An effective problem statement helps you define a blocker and plan ways to overcome it. Use this guide to write your own.
Read more >How To Write a Problem Statement (With an Example)
Watch this video to understand best practices and use this guide to write a professional problem statement at work!
Read more >What is troubleshooting and why is it important?
Troubleshooting is systematic approach to problem-solving. Learn how it works, the seven steps troubleshooters often use and other helpful resources.
Read more >Use Basic Facts to Solve Multiplication Problems - YouTube
Students will multiply larger numbers, relying on basic multiplication facts to help them solve. Patterns found while working with exponents ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Like a dumb, I’ve forgotten to have set SDK 7-preview as default (and global.json did not affect rider build). I’ve set default SDK 6.0.301, and all worked properly.
Thank you for the support, and I’m sorry I wasted your time.
No worries. Glad you got it working!