Skip to content

[Bug]: Unable to use the [Reactive] attribute with error that attribute is inaccessible due to its protection level #338

@matthewacme

Description

@matthewacme

Describe the bug 🐞

Trying to convert my system over to use the new SourceGenerator nuget package instead of the ReactiveUI Fody nuget package.

Removed Fody assembly from references
Added the ReactiveUI.SourceGenerators nuget to the project

Tried to build and got hundreds of these errors

Image

Step to reproduce

  1. Open a project that was created using ReactiveUI.Fody and that is currently working correctly
  2. Confirm the project is set to use <TargetFramework>net8.0-windows10.0.26100.0</TargetFramework>
  3. Confirm the project is set to use <LangVersion>preview</LangVersion>
  4. Remove Fody nuget reference
  5. Add ReactiveUI.SourceGenerators nuget package reference
  6. Open class that inherits from ReactiveObject
  • [Mod to steps]
  • I forgot to add the step,
    - Set the class and the properties that have the Reactive attribute to be partial
  1. Clean Solution
  2. close Visual Studio and clean up all the build artifacts (bin / obj / debug, etc artifacts)
  3. Reopen Visual Studio and the solution
  4. Try to build
  5. You get errors everywhere the [Reactive] attribute is declared with an error or 'ReactiveAttribute' is inaccessible due to its protection level
  6. Right mouse click on an instance where the error is shown for [Reactive] attribute and select "Go to definition"
  7. The ReactiveUI.SourceGenerator is generating the ReactiveAttribute as an internal sealed class.

Reproduction repository

https://github.com/reactiveui/ReactiveUI

Expected behavior

I should complete steps 1 thru 8 successfully and then when open and built, the errors should show up only for those properties that don't match the new format system for the Reactive attribute usage

Screenshots 🖼️

No response

IDE

Visual Studio 2022

Operating system

Windows11 - 10.0.26200.7171

Version

No response

Device

Microsoft Surface Book

ReactiveUI Version

22.3.1 SourceGenerators - 2.5.1

Additional information ℹ️

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions