Where in the C # project "private accessors" are defined

After creating an obsolete C # application in Visual Studio 2015, the following warning exists:

This task of creating private access is outdated and will be removed in a future version of the visual studio.

A warning refers to a project within a solution that contains only unit tests.

Microsoft dcumentation status:

Previous versions of Visual Studio, you could use Publicize.exe to specify internal application programming interfaces (APIs) and create a public API that you can call in your tests, which in turn will call the internal APIs of your product. You could then use code generation to create test stubs and create snippet code inside this stub.

This feature has been removed in Visual Studio 2012.

The solution search does not contain links in any of the build files to publicize.exe.

Where in the C # project will the task of creating private access be defined?

+4
source share
1 answer

You should find the accessor in the .csproj file of your unit test project.

In Visual Studio, right-click on your test project and select Unload Project . Then right-click on the project and select " Change project-name.csproj "

An accessor looks something like this:

  <ItemGroup>
    <Shadow Include="Test References\some-name.accessor" />
  </ItemGroup>
+5
source

Source: https://habr.com/ru/post/1654266/


All Articles