Questions tagged [clr4.0]

57 questions
42
votes
3 answers

Single objects still limited to 2 GB in size in CLR 4.0?

As I understand it there's a 2 GB limit on single instances in .NET. I haven't paid a lot of attention to that since I have mainly worked on 32 bit OS so far. On 32 but it is more or less an artificial limitation anyway. However, I was quite…
Brian Rasmussen
  • 109,816
  • 33
  • 208
  • 305
30
votes
4 answers

Event and delegate contravariance in .NET 4.0 and C# 4.0

While investigating this question I got curious about how the new covariance/contravariance features in C# 4.0 will affect it. In Beta 1, C# seems to disagree with the CLR. Back in C# 3.0, if you had: public event EventHandler
Daniel Earwicker
  • 108,589
  • 35
  • 194
  • 274
19
votes
2 answers

Repercussions of enabling useLegacyV2RuntimeActivationPolicy?

For my current project, we're using some CLR 2 based mixed mode assemblies. In order to use these from within a .NET 4 targetted assembly, I know you have to add useLegacyV2RuntimeActivationPolicy=true to the element within app.config. I…
Reed Copsey
  • 522,342
  • 70
  • 1,092
  • 1,340
12
votes
2 answers

Why a machine with .NET 4 installed on it cannot run an exe that targeted .NET 4.5 while if they use the same CLR version?

In Common Language Runtime (CLR) Microsoft page, it says that both .Net Framework 4 and 4.5 uses the CLR version 4. However in this page (.NET Framework Versions and Dependencies) it writes '.Net Framework version 4.5 Included an updated version of…
pencilCake
  • 45,443
  • 73
  • 211
  • 346
11
votes
3 answers

What exactly are new ETW features in CLR 4.0?

My colleague mentioned that there are some major improvements in CLR 4.0 related to Event Tracing for Windows but I couldn't find details of what exactly is new. There are few blog posts that mention only about improvements but do not provide any…
imak
  • 6,109
  • 7
  • 43
  • 71
9
votes
2 answers

typeof(T) may return null

When using the typeof operator on type created through TypeBuilder, the operator will return null. I'm curious why this happens and how to prevent it. I'm starting to think this is a VS bug in the immediate window, but I'm not quite sure. It's very…
redb
  • 502
  • 7
  • 22
9
votes
3 answers

Garbage collections improvements in CLR 4.0

Recently I was running the example provided by Andrew Hunter on his blog "The Dangers of the Large Object Heap" compiled against .NET 4 and I got the following numbers: With large blocks: 622Mb allocated With large blocks, frequent garbage …
Eugeniu Torica
  • 6,986
  • 11
  • 44
  • 61
8
votes
1 answer

Does HyperDescriptor work when built in .NET 4?

I'm working on a .NET 4 project, and would be able to benefit from the dynamic property access that HyperDescriptor provides, but it doesn't seem to be working properly when built in .NET 4. I downloaded the source from CodeProject, converted the…
Samuel Meacham
  • 9,845
  • 7
  • 42
  • 50
7
votes
2 answers

Does LINQ cache computed values?

Suppose I have the following code: var X = XElement.Parse (@" "); Enumerable.Range (1, 100) .Select (s => X.Elements () .Select (t => Int32.Parse (t.Attribute…
Shredderroy
  • 2,768
  • 1
  • 26
  • 50
6
votes
1 answer

.NET 4 GC known thresholds to trigger collection?

I know that the logic for GC to trigger is not simple but it has certain thresholds to monitor. Anyone knows what are these thresholds could be for .NET 4 workstation and server GC ? Thank you
Boppity Bop
  • 7,680
  • 10
  • 58
  • 123
5
votes
2 answers

Viewer tool for Global Assembly Cache (Viewer)

To view a list of the assemblies in the global assembly cache, at the command prompt, type the following command: gacutil –l In earlier versions of the .NET Framework, the Shfusion.dll Windows shell extension enabled you to view the global assembly…
Kiquenet
  • 13,271
  • 31
  • 133
  • 232
5
votes
1 answer

Why did the BeforeFieldInit behavior change in .NET 4?

In C# 4, the behavior of types without the beforefieldinit flag was changed, so now a type initializer can call before first use of any static field of the class. My questions are why has the C#/.NET team changed that behavior? What is the main…
weqew q
  • 271
  • 2
  • 9
4
votes
2 answers

This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded

here's what i have got two box one win 2003 server IIS6 another one win2008 server IIS 7.0 I have a standalone app named Util (win app) built in .net 2.0 (VS2005) trying to load .net 4.0 dll/assembly (VS2010). this needed a simple setting in the…
Gauls
  • 1,791
  • 5
  • 27
  • 43
4
votes
0 answers

Windows Shell Extension using Managed Code

basically every SO thread concerning Windows Shell Extensions (to e.g. display overlay icons or extend the explorer context menu for specific files) heavily advises against using managed code for this purpose. I perfectly understand the reasoning…
Hinnerk
  • 145
  • 2
  • 7
4
votes
1 answer

Using a .NET-2.0-targeted COM DLL in the GAC on a .NET-4-only system

Greetings again, Following up my previous question, I'm trying to maximize the compatibility of my C#-written Windows Explorer extension. In particular, I'm interested in making sure it works in an environment in which .NET 4 is installed and .NET…
Paul Accisano
  • 1,287
  • 1
  • 13
  • 23
1
2 3 4