internalsvisibleto Questions

24

Solved

I am trying to use the InternalsVisibleTo assembly attribute to make my internal classes in a .NET class library visible to my unit test project. For some reason, I keep getting an error message th...
Zareba asked 20/9, 2008 at 2:59

7

Solved

I insert the line: [assembly: InternalsVisibleTo("MyTests")] inside my project under test( Properties/AssemblyInfo.cs) where MyTests is the name of the Unit Test project. But for some reason I s...
Somnambulate asked 17/9, 2013 at 9:6

1

Solved

I am currently trying to write unit tests in my solution, but I want to put my unit tests in a different separate project. The problem is when I am generating some fake testing data I need to set p...
Catch asked 2/2, 2021 at 9:40

2

Is there a signed version of LinqPad that I could use in order to access internals of signed assemblies?
Iroquoian asked 25/10, 2014 at 11:51

3

Before asp.net 5 I would add "internalsVisibleTo(some.namespace.name)" to AssemblyInfo.cs - But I no longer have assemblyInfo.cs in my WebApi project. How do I expose internals in a WebAPI project...
Merthiolate asked 12/1, 2016 at 11:27

2

Solved

InternalsVisibleTo is not working for my managed C++ projects, but it is for my C# projects. Any help would be appreciated. Here is a simplified layout. Project A - C#, has an internal property I ...
Asoka asked 6/1, 2009 at 19:47

2

A new version of the .Net framework and C# offer a new access modifier: private protected. In order to access such a member, the class must both reside in the same assembly and derive from the de...
Lifework asked 1/12, 2017 at 10:19

2

I would like to define several friend assemblies. It is easy to do so when editing the AssemblyInfo file manually: [assembly:InternalsVisibleTo("Friend1a")] [assembly:InternalsVisibleTo("Friend1b...
Io asked 13/9, 2016 at 12:34

1

Solved

I'm having an issue with cross-assembly / friend assembly type visibility. I have the following program (which I sign / strong-name). It tells Castle DynamicProxy (I'm using version 4.2.1 of the C...

1

It's possible to specify [assembly: InternalsVisibleTo("NameOfOtherAssembly")] in AssemblyInfo.cs. But is it possible to restrict this to specific internal functions? Is there e.g. an attribute t...
Laurasia asked 2/4, 2014 at 16:18

1

Solved

So, the issue is that I have a bunch of internal classes in my assembly that are used by the class I want to test. Since accessors have been removed from VS2012, I'm fine with using [InternalsVisib...
Shawntashawwal asked 26/11, 2012 at 21:2

3

Solved

I am using Rhino Mocks as a mocking framework for unit testing. I have a class called Subject which is the class I want to test. It has a dependency on IStore. IStore is defined as follows: //in...
Laughingstock asked 28/7, 2011 at 7:49

1

Solved

I could not find any clear statement on MSDN regarding this, there are some examples with strong names other are without, for me it seems like it should work even without but its not working. Than...
Sumptuary asked 8/5, 2012 at 6:22

3

Solved

I have an assembly with functionality that I don't want exposed as public but still accessible to my other assemblies. This can be done using InternalsVisibleToAttribute by specifying each assembly...
Voluntaryism asked 17/10, 2011 at 6:35

4

Solved

I have a class with internal constructor and want to Resolve it from Unity (2.0). public class MyClass { internal MyClass(IService service) { } } then I'm doing _container.Resolve<MyClass&...
Laager asked 20/6, 2011 at 13:48

1

I am trying to expose some internals to my unit test project by using: [assembly: InternalsVisibleTo("MyTest")] But I am getting the error: Error 1 Friend assembly reference MyTest' is invali...
Rudman asked 25/8, 2011 at 13:38

2

Solved

In our shop, we are using Cruise Control & MSBuild to automate the builds of the product as part of continuous integration. Part of the build is to sign the assemblies so they have strong name...

3

Solved

The situation is as follows: I want to release the full source to a class library I want to release binaries as well, signed by me, with a key file I don't want to publish I will provide batch fi...
Groats asked 14/11, 2010 at 19:56

5

Solved

[Of course, the question is not restricted to a specific "friend" implementation, feel free though to point out implementation specifics if relevant] Reading through the unanswered questions, I st...

2

Solved

Before I go on I did go through this InternalsVisibleTo attribute ain’t workin'! Hence the title Okay so I had a working version of my project that was using something like the following. [assembly...

3

Solved

I understand that the InternalVisibleTo attribute is used to expose types and methods with the internal access modifier to a specified assembly. I have only ever used this for exposing internal met...
Margarettemargarida asked 19/7, 2010 at 8:59

3

Solved

In general, I design classes in such a manner as to not require access to privates for testing purposes. An InternalsVisibleTo can also assist. However, I'm currently dealing with a codebase that ...
Publicness asked 25/6, 2009 at 13:23
1

© 2022 - 2024 — McMap. All rights reserved.