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

Multiple definitions #437

Closed
1 of 4 tasks
NebojsaMancic opened this issue Sep 12, 2022 · 1 comment
Closed
1 of 4 tasks

Multiple definitions #437

NebojsaMancic opened this issue Sep 12, 2022 · 1 comment
Labels
duplicate 👥 Indicates that an identical issue or PR already exists external ⤴️ Something related to or caused by an external project mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit

Comments

@NebojsaMancic
Copy link

Describe the bug

I have installed nuget package and added [ObservableObject] to my ViewModel class. When I have build app, I have a lot of error messages for duplicated items

My ViewModel class looks like this

[ObservableObject]
public partial class KalkulacijaViewModel 
{

    [ObservableProperty]
    private int velicinaFonta;
    public KalkulacijaViewModel()
    {
    }

}

and errors are

Severity Code Description Project File Line Suppression State
Error CS0102 The type 'KalkulacijaViewModel' already contains a definition for 'PropertyChanged' Sara C:\Users\Manca\source\repos6\Softman22\Sara\CommunityToolkit.Mvvm.SourceGenerators\CommunityToolkit.Mvvm.SourceGenerators.ObservableObjectGenerator\Sara.ViewModels.Nabavka.KalkulacijaViewModel.g.cs 11 Active
Error CS0102 The type 'KalkulacijaViewModel' already contains a definition for 'PropertyChanging' Sara C:\Users\Manca\source\repos6\Softman22\Sara\CommunityToolkit.Mvvm.SourceGenerators\CommunityToolkit.Mvvm.SourceGenerators.ObservableObjectGenerator\Sara.ViewModels.Nabavka.KalkulacijaViewModel.g.cs 15 Active
Error CS0111 Type 'KalkulacijaViewModel' already defines a member called 'OnPropertyChanged' with the same parameter types Sara C:\Users\Manca\source\repos6\Softman22\Sara\CommunityToolkit.Mvvm.SourceGenerators\CommunityToolkit.Mvvm.SourceGenerators.ObservableObjectGenerator\Sara.ViewModels.Nabavka.KalkulacijaViewModel.g.cs 22 Active
Error CS0111 Type 'KalkulacijaViewModel' already defines a member called 'OnPropertyChanging' with the same parameter types Sara C:\Users\Manca\source\repos6\Softman22\Sara\CommunityToolkit.Mvvm.SourceGenerators\CommunityToolkit.Mvvm.SourceGenerators.ObservableObjectGenerator\Sara.ViewModels.Nabavka.KalkulacijaViewModel.g.cs 33 Active
Error CS0111 Type 'KalkulacijaViewModel' already defines a member called 'OnPropertyChanged' with the same parameter types Sara C:\Users\Manca\source\repos6\Softman22\Sara\CommunityToolkit.Mvvm.SourceGenerators\CommunityToolkit.Mvvm.SourceGenerators.ObservableObjectGenerator\Sara.ViewModels.Nabavka.KalkulacijaViewModel.g.cs 44 Active
Error CS0111 Type 'KalkulacijaViewModel' already defines a member called 'OnPropertyChanging' with the same parameter types Sara C:\Users\Manca\source\repos6\Softman22\Sara\CommunityToolkit.Mvvm.SourceGenerators\CommunityToolkit.Mvvm.SourceGenerators.ObservableObjectGenerator\Sara.ViewModels.Nabavka.KalkulacijaViewModel.g.cs 55 Active
Error CS0111 Type 'KalkulacijaViewModel' already defines a member called 'SetProperty' with the same parameter types Sara C:\Users\Manca\source\repos6\Softman22\Sara\CommunityToolkit.Mvvm.SourceGenerators\CommunityToolkit.Mvvm.SourceGenerators.ObservableObjectGenerator\Sara.ViewModels.Nabavka.KalkulacijaViewModel.g.cs 76 Active
Error CS0111 Type 'KalkulacijaViewModel' already defines a member called 'SetProperty' with the same parameter types Sara
....

All duplicated members are in .g.cs file

Regression

No response

Steps to reproduce

build app

Expected behavior

My code without duplicated members.

Screenshots

No response

IDE and version

VS 2022

IDE version

17.3.3

Nuget packages

  • CommunityToolkit.Common
  • CommunityToolkit.Diagnostics
  • CommunityToolkit.HighPerformance
  • CommunityToolkit.Mvvm (aka MVVM Toolkit)

Nuget package version(s)

8.0.0

Additional context

No response

Help us help you

No, just wanted to report this

@NebojsaMancic NebojsaMancic added the bug 🐛 An unexpected issue that highlights incorrect behavior label Sep 12, 2022
@Sergio0694 Sergio0694 added duplicate 👥 Indicates that an identical issue or PR already exists external ⤴️ Something related to or caused by an external project mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit and removed bug 🐛 An unexpected issue that highlights incorrect behavior labels Sep 12, 2022
@Sergio0694
Copy link
Member

Duplicate of #343.

@Sergio0694 Sergio0694 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate 👥 Indicates that an identical issue or PR already exists external ⤴️ Something related to or caused by an external project mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit
Projects
None yet
Development

No branches or pull requests

2 participants