.NET types or members that are accessible only within files in the same assembly.
Questions tagged [.net-internals]
11 questions
55
votes
4 answers
Chrome cancels CORS XHR upon HTTP 302 redirect
It looks like according to the CORS Spec, GET and POST requests should transparently follow 302 redirects. But Chrome is canceling my request.
Here's the JS that does the request:
var r = new XMLHttpRequest();
r.open('GET',…

Matthias
- 13,607
- 9
- 44
- 60
37
votes
1 answer
GC behavior when pinning an object
While browsing through the code of PinnableObjectCache from mscorlib, I've encountered the following code:
for (int i = 0; i < m_restockSize; i++)
{
// Make a new buffer.
object newBuffer = m_factory();
// Create space between the…

Yuval Itzchakov
- 146,575
- 32
- 257
- 321
14
votes
3 answers
Delegates in .NET: how are they constructed?
While inspecting delegates in C# and .NET in general, I noticed some interesting facts:
Creating a delegate in C# creates a class derived from MulticastDelegate with a constructor:
.method public hidebysig specialname rtspecialname instance
…

Saulius Valatka
- 7,017
- 5
- 26
- 27
12
votes
2 answers
Understanding of .NET internal StringBuilderCache class configuration
When I was looking at decompiled .NET assemblies to see some internals, I've noticed interesting StringBuilderCache class used by multiple framework's methods:
internal static class StringBuilderCache
{
[ThreadStatic]
private static…

Konrad Kokosa
- 16,563
- 2
- 36
- 58
10
votes
3 answers
Why calling some functions of the Object class, on a primitive type instance, need boxing?
I have discovered that if i run following lines of code.
int i = 7;
i.GetHashCode(); //where GetHashCode() is the derived
//function from System.Object
No boxing is done, but if i call i.GetType() (another derived function from…

waheed
- 533
- 5
- 15
4
votes
0 answers
When are GCHandles Created for Managed Objects Being Passed to Unmanaged Code?
This is a question I had when I read the answer to this StackOverflow question. When exactly are GCHandles created for managed objects being passed into unmanaged code, and when are these handles freed?
An example where a GCHandle is created -…

MiniWalrus
- 51
- 4
3
votes
2 answers
Security internals of new operator and delegates in .NET
Some time ago I read about various security recommendations for C/C++. After that I started thinking if they apply to .NET I found some answers but not all so here are my questions.
It is a recommended to use HeapAlloc method instead of VirtualAlloc…

Michał Komorowski
- 6,198
- 1
- 20
- 24
1
vote
1 answer
How does the .NET runtime determine that two types are the same?
I have assembly A that depends (statically) on type T (reference type, a class) in assembly B.
I do not own assembly A but I do own assembly B. T unfortunately is a real type (not an interface) but luckily A uses reflection to discover its…

MMind
- 1,845
- 2
- 17
- 26
1
vote
1 answer
.NET Instrumentation - Call to Custom Assembly Fails - COR PROFILER
I am trying to deploy my .NET Instrumentation profiler into Azure web apps. Using COR_PROFILER_32 and *_64 and COR_PROFILING_ENABLED i am enabling my profiler in Azure web app.
My profiler will instrument codes into all the modules including .NET…

Sel_va
- 588
- 5
- 25
1
vote
2 answers
What is assembly in C# in the context of internal access modifier?
I thought that assembly is a project in a solution in Visual Studio, but then I was trying to understand inheritance and internal/protected access modifiers and I got lost.
*Project1 and Project2 are separate VS projects in one solution:
namespace…

user3616181
- 975
- 2
- 8
- 27
0
votes
1 answer
Force FSI, the .NET 4 version, to load assamblies that are compiled for .NET 2.0
I'm working primarily with .NET 4.0 using fsi, F# interactive, but I have a couple of dll that I need to access that are only compiled for the .NET 2.0 version of the framework (I checked the manifest they reference mscorlib version 2).
I'm getting…

Robert
- 6,407
- 2
- 34
- 41