Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8351331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:35:58+00:00 2026-06-09T08:35:58+00:00

I’ve generated unit tests on a private method using Visual Studio’s own Create Unit

  • 0

I’ve generated unit tests on a private method using Visual Studio’s own “Create Unit Tests…” option.

Great, it works, but if I try to check my code in now I break the build because VS has created a private accessor class in AppData/Local/Temp that is required to build. If I try to put this file in my source tree, it won’t compile as the compiler says it “must define a body”. Really don’t understand this reflection lark…

This is the accessor class:

#region Assembly AgentConfiguration_Accessor.exe, v4.0.30319
// C:\Projects\AgentConfigurationTests\obj\Debug\AgentConfiguration_Accessor.exe
#endregion

using Agent.ConfigurationData;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace Agent.AgentConfiguration
{
    [Shadowing("Agent.AgentConfiguration.AgentConfigurationGui")]
    public class AgentConfigurationGui_Accessor : BaseShadow
    {
        protected static PrivateType m_privateType;

        [Shadowing(".ctor@0")]
        public AgentConfigurationGui_Accessor();
        public AgentConfigurationGui_Accessor(PrivateObject value);

        [Shadowing("_agentPaths")]
        public AgentPaths _agentPaths { get; }
        [Shadowing("_agentServiceName")]
        public static string _agentServiceName { get; set; }
        [Shadowing("UpdateStatus@1")]
        public void UpdateStatus(string statusMessage);
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T08:36:00+00:00Added an answer on June 9, 2026 at 8:36 am

    After using the Private Accessors for some time, I had some troubles in getting the code to compile after some branching and merging with our Souce Code Versioning system.

    I started researching on the topic and found an article in the Visual Studio Team Test blog. As far as I have understood it, you should not use the Private Accessor classes any more.

    There is a blog article in the Generation of Private Accessors (Publicize) and Code Generation for Visual Studio 2010 that states that this feature is not further supported any more:

    We have stopped working on these features for Visual Studio 2010 and
    may remove them from the product in following releases. This is due
    to the following reasons:

    • Lack of resources and time: The focus for this release has been to improve the experience for manual testers, so the priority for the
      code generation and publicize features has been lowered. There have
      also been other issues with the publicize functionality that we
      utilize that have not been addressed.
    • New features by Language teams: As the language teams have made modifications to their project types and languages, we have been
      unable to respond to the changes they have made and have not been able
      to work with the new features they have introduced.

    Of course there are are suggestions about what you could do instead:

    For those who wish to continue testing internal APIs, you have three
    options:

    1. Use the Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject class to assist in accessing internal and private APIs in your code.
      This is found in the
      Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll assembly.
    2. Create a reflection framework that would be able to reflect off your code to access internal or private APIs.
    3. If the code you are trying to access is internal, you may be able to access your APIs using the InternalsVisibleToAttribute so your test
      code can have access to the internal APIs.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.