question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem on the basic usage.

See original GitHub issue

Hi, 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:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
VincenzoCarlinocommented, Jul 2, 2022

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.

0reactions
domn1995commented, Jul 2, 2022

No worries. Glad you got it working!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found