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 8007985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:00:06+00:00 2026-06-04T18:00:06+00:00

In C# in Depth 2nd Edition, Jon Skeet’s book – which I’ve just read

  • 0

In “C# in Depth 2nd Edition”, Jon Skeet’s book – which I’ve just read until end of part 2 -, it is mentioned in 7.7.3 that InternalsVisibleTo can also be used with signed assemblies. At the moment I did not use signatures at all. The security issue for released binaries is actually quite critical so I plan to remove completely the attribute for release assemblies using a preprocessor variable test.

Just for interest, how would it be practical to use signed assemblies and InternalsVisibleTo? In order to use InternalsVisibleTo for specifying a signed friend assembly, I need to specify its public key. I have it only after compiling the friend assembly which has a dependency on the assembly under test (dynamic assembly loading and reflexion left aside, what would bloat-up coding and readability). This sound like a chicken-egg problem requiring a bootstrap of the assembly to be tested. I can imagine some tricks with MSBuild and scripting to automate this. Is there a more practical way of doing this?

In case it remains so tedious I will stick to my first idea of dropping Unit Testing for the release builds (which is somewhat unsatisfying as subtle timing issues could be left untested…)

  • 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-04T18:00:09+00:00Added an answer on June 4, 2026 at 6:00 pm

    Use the same key to sign all the projects in the solution, don’t generate a different one for each project and on each build.
    I’d recommend having the same physical key file referenced by each project in the project properties, instead of copying it into each project.

    That way, all of them are associated with the same PublicKey constant.
    And use a single entry, such as:

    [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("UnitTests, PublicKey=<your key>")]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm reading the book 'C# in Depth, 2nd Edition' of Jon Skeet. He said
So I started reading Jon Skeet's 2nd edition of C# in depth and kind
I'm currently reading Jon Skeet's C# in depth 2nd edition and the following question
I'm currently researching the 2nd edition of C# in Depth, and trying to implement
I am currently reading C# in Depth by Jon Skeet and have been reading
In C# in depth (an excellent book thus far), Skeet explains events aren't fields
In C# in depth, Jon Skeet uses IEquatable<> to override overload the Equals() operation.
I'm starting to read in-depth on the .NET framework, and its Common Language Runtime.
This is an in-depth continuation of my question from earlier this morning , which
I am implementing stereovision depth mapping as given in example in opencv text book

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.