Questions tagged [clr4.0]

57 questions
4
votes
1 answer

How does one create a .NET Expression with NodeType of ExpressionType.Index?

I'm writing code that evaluates .NET Expression trees. I'm trying to create a C# 4 test to exercise my handling of an ExpressionType.Index, but I can't figure out how to create that type of expression through a LambdaExpression. No matter what I…
Jacob
  • 72,750
  • 22
  • 137
  • 214
4
votes
1 answer

Loading/Executing CLR 2.0 assemblies in CLR 4.0

Can the CLR 4.0 execute CLR 2.0 IL without the need for source code recompilation?
jumpinjackie
  • 1,987
  • 3
  • 19
  • 25
4
votes
1 answer

SQL server 2012 wont load CLR 4.0 assembles

I just upgraded to SQL Server 2012 with SP1 because I could not load CLR assemblies from .net 4.0. Now I have both 2008 and 2012 running on my VM. Im trying to load the assemblies into 2012 but I still get the same unsupported version errors. when i…
Chris
  • 165
  • 1
  • 1
  • 7
3
votes
1 answer

Tail call optimization in last CLR

I've discovered (by accident) that the last CLR does the tail call optimization. I have tested it with a piece of code, but frankly it doesn't behave the way I expected. I thought the tail call optimization may happen when the last thing in the…
Lukasz Madon
  • 13,748
  • 13
  • 58
  • 93
3
votes
1 answer

Is there an example of how to customize a .NET 4.0 profiler?

I know there is one for profiler 2.0: http://www.codeproject.com/KB/dotnet/dotnetprofiler.aspx But the profiler API has changed in .NET 4.0 and we need to consider in-process side by side issues. I need an example to customize our own profiler.…
Kevin C.
  • 261
  • 3
  • 8
3
votes
2 answers

What's the difference between using useLegacyV2RuntimeActivationPolicy and multiple supportedRuntimes

What is the difference between the three following scenarios (in an app.config files of an exe)?
bsara
  • 7,350
  • 3
  • 26
  • 46
3
votes
1 answer

FileNotFoundException with XmlSerializers in application built using Spoon Studio .Net 4.0

I'm getting the following exception in our virtualized application packaged using Spoon Studio and .Net 4.0 Exception='System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\temp\Serialization\mf3je3jx.dll' or one of its…
Sandeep Singh Rawat
  • 1,627
  • 1
  • 14
  • 27
3
votes
2 answers

Can we construct an instance of `OpCode`?

The .NET Framework 4.0 introduces several items to the Reflection API that range from extremely useful to vital for my work. Among these are protected constructors for Assembly, Module, MethodBody, and LocalVariableInfo and the new…
Sam Harwell
  • 92,171
  • 18
  • 189
  • 263
3
votes
2 answers

How can two .NET CLR loaded in the same process talk to each other?

Now that it is possible to have two CLRs running on the same box, how could they 'talk' to each other? Let's say that the GUI is running under .NET 2.0 CLR and there is a script running on the .NET 4.0 CLR, for example, is there a way to modify the…
Dinis Cruz
  • 3,753
  • 2
  • 26
  • 46
2
votes
0 answers

Should I Change Project Target Framework When Server Has .NET 4.5.X runtime Installed

My understanding is that the the 4.5.X runtime is actually an in-place upgrade to the 4.0 runtime. So in other words, it replaces 4.0. But if I have applications on a server that target framework version 4.0, will they start using 4.5 framework…
Issa Fram
  • 2,318
  • 6
  • 32
  • 59
2
votes
0 answers

Is the CLR optimizer deterministic on internal environment?

I have recently noticed some odd behavior in the CLR optimizer. In particular, certain simple methods were getting optimized out in release builds sometimes. I can run the same program (no user/external input) 10 times in a row and 3 times it will…
Micah Zoltu
  • 5,388
  • 2
  • 38
  • 63
2
votes
4 answers

MSDeploy - Cannot deploy .NET v4.5 package to v4.0 Application Pool

After migrating TeamCity from one server to another, and also switching to Visual Studio 2013, our build fails when using MSDeploy to push a TC-built .zip package to IIS. The application pool that you are trying to use has the …
Luke Puplett
  • 36,042
  • 37
  • 161
  • 231
2
votes
1 answer

In .Net many classes are thread-safe if they are static, how is that implemented?

For many classes in the .NET frameworks, MSDN describes thead safety as: Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe. How is that implemented? is…
Amit Bens
  • 1,277
  • 2
  • 12
  • 18
2
votes
4 answers

Is there a c# precompiler define for the CLR version

I need to compile code conditionally by the CLR version. e.g there's a code that I need to compile only in CLR 2 (.NET 3.5 VS2008) and not in CLR 4 (.NET 4 VS2010) Is there a precompiler directive for the current CLR version that I can use inside an…
Ohad Horesh
  • 4,190
  • 5
  • 25
  • 45
2
votes
1 answer

Registering to 'GCAllocationTick_V1' CLR event from C#

I'm trying to add some profiling capabilities to a server application. I have found 'GCAllocationTick_V1' event and I would like to monitor it and react to it in code. Unfortunately, I couldn't find any information regarding this topic. Actually, I…
Omeriko
  • 1,151
  • 11
  • 19