user1052610 user1052610 - 1 year ago 222
C# Question

Where in a c# project are 'private accessors' defined

After doing a build of a legacy C# application within Visual Studio 2015, the following warning exists:

This task to create private accessor is deprecated and will be removed
in a future version of visual studio.

The warning references a project within the solution which contains only unit tests.

Microsoft dcumentation states:

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

This functionality was removed in Visual Studio 2012.

Searching the solution, there is no reference in any of the build files to

Where in a C# project would the task to create a private accessor be defined?

Answer Source

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 the project again and select "Edit project-name.csproj"

The accessor looks something like:

    <Shadow Include="Test References\some-name.accessor" />
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download