C#: Inconsistent accessibility: property type

前端 未结 4 1713
南笙
南笙 2020-12-06 04:00

What\'s wrong with

public partial class MainWindow : Window
{
    public ObservableCollection Tabs { get; set; }
    public ICollectionV         


        
4条回答
  •  死守一世寂寞
    2020-12-06 04:48

    All of the information above is completely correct and works fine. I just want to add from personal experience that if you are using TFS and getting your project from TFS, different Visual Studio versions can also generate this error.

    I entered a project with Visual Studio 2013 update 2 and synched with the TFS to get the solution. When I tried to run the project I got 80 errors. All of them were like "... less accessible than property...". Now it turns out I needed update 4. Once my Visual Studio was update I revered the changes and it worked perfectly.

    This might be useful if none of the above works and you are using TFS.

提交回复
热议问题