简体   繁体   中英

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?

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM