Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 publicize.exe.

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

like image 854
user1052610 Avatar asked Sep 11 '16 12:09

user1052610


1 Answers

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:

  <ItemGroup>
    <Shadow Include="Test References\some-name.accessor" />
  </ItemGroup>
like image 66
Wolfgang Avatar answered Oct 20 '22 20:10

Wolfgang