clr

CLR: What is the lifetime of const string values in memory?

Say we have a class with 10000 const string members. class Schema { //Average string length is 20 public const string ID1 = "some.constant.value"; public const string ID2 = "some.other.constant.value"; //... } Not all fields are referenced in the rest of the code. Only 10% of them is accessed on startup - their reference is as...

Is there any good books about SSCLI?

More and more I realized that without jumping into the code details, I cannot really understand the how CLR works. So could you recommend some good books on SSCLI (Shared Source CLI)? Many thanks. ...

Unused namespace directives can cause any change ?

Hello everybody I am sure that codes will produce same result but CLR will consider unused namespace directives while allocating memory ? Another question can be that CLR consider unused code blocks while allocating memory ? ...

How do I see the c# code that caused a crashdump in clr.dll?

I have a Windows Forms application (.NET 4) that runs fine on my development machine but crashes on two other test machines. I can load the minidump that it creates in VS2010. Choosing to "Debug with Mixed" leads to apparently endless (I killed devenv after about 20 minutes) abuse of the CPU by Visual Studio. When I "Debug with Native ...

Is the CLR capable of static interfaces?

And if so, why can't you do this: public interface IParsable { static IParsable Parse(string s); static bool TryParse(string s, out IParsable); } in C#? EDIT: Or, alternatively: public interface IParseable<T> { static T Parse(string s); static bool TryParse(string s, out T); } EDIT #2: I have learned the folly of m...

How do I embed iron ruby into a c# program?

I want to embed iron ruby into a mud that I am creating and for some reason I'm having trouble finding the correct examples to get started. All I want to do is create a game where 'you' the player will program bots in iron ruby and then I will interperet the code in c# and make the bots do what you want them to. Also, I want to make it...

sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible'.

Hi, I'm new to this. I'm writing a clr stored procedure that calls another stored procedure to get a value that's used in a calculation. A stored procedure returns int (I guess SqlInt32? the type of the value in the table is int) that is then needed to be converted to decimal. Here's the code I have: public static int CalculateMyV...

Calling managed code from unmanaged code in VS2010

Hi, I have an managed c# application that uses expression encoder 4 SDK, and thus requires .NET 4 and hence VS2010. I wish to startup and stop this application as an in process DLL. This article and demo on code project proved a very useful proof of principle http://www.codeproject.com/KB/mcpp/ijw_unmanaged.aspx The included demo wo...

How is JIT compiled code injected in memory and executed?

"Consider a typical Windows x86 or AMD64 architecture, the memory is divided in executable sections that cannot be written to and data sections that can be written to but cannot be executed (think DEP)." "JIT compiles methods in-memory, does (generally) not store anything to disk, instead moves it around where the...

SQLDatareader via CLR not returning SQL Message right way

I execute the following code via CLR, is there a reason why the message is not printed to the SQL Server, does it need to wait until the Stored Procedure returns all the rows (there is about 7 Billion rows to return) SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.StoredProcedu...

CLR: System.InvalidOperationException: The context connection is already in use.

I keep getting this error when trying to perform a delete in the middle of my DataReader: System.InvalidOperationException: The context connection is already in use. I get all the rows that need to be deleted and then iterate through the data reader as there are a lot of rows returned. SqlConnection conn = new SqlConnection("context c...

Difference between CLR and CLI

Possible Duplicate: CLR and CLI - What is the difference? What is the difference between CLR and CLI? (in .NET) ...

CLR differences between Silverlight and normal .NET Framework?

Are there any aggregated guides to writing libraries which need to be Silverlight-compatible? Or is the standard procedure to just build, look for errors, fix, repeat? Obviously I recognize the answer may depend on what version of Silverlight is being targeted, but I'd expect any answer to just specify version if the solution is specif...

System.Int32 contains... another System.Int32

Hey guys, I thought about writing a language for the sake of writing a language, and now that I'm done with the parser and the AST, I have to do something about the library. Specifically, basic types. I'm going to use a very basic intermediate representation before I pass that down to LLVM and get native code that way. Though, since my...

Can we share a static field across Application domains?

Consider a process, in which multiple Application domains are created. Can we share a single static field across these Application domains or can we pass this static field across these application domains? How does CLR handle this? ...

Can we create a Application Domain inside another Application domain?

Inside an application Domain "AD1", try to crate another Application domain "AD2" (Like nested application domain). Is this possible? e.g. When we create an process, that process will run in default application domain. In this process, if we create an new Application domain named "AD1", is this "AD1" is created inside default application...

why imaxdiv_t __cdecl in such function does not want to compile under /clr:pure ?

so I have such code in my VS ffmpeg video encoder project in C++ which compies perfectly under CLR (inttypes.h part of ffmpeg's includes) // ISO C9x compliant inttypes.h for Miscrosoft Visual Studio // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 // // Copyright (c) 2006 Alexander Chemeris // // Redistribution...

Can any one provide a basic example of using C++ CLR lib from C++ project? (VS08)

So I want to see a wary simple class (like Class1) with 1 or 2 functions in lib used by C++ main app in one sln. A tutorial or zip... please help. ...

Why is C# 4.0's covariance/contravariance limited to parameterized interface and delegate types?

Is this a limitation of the CLR or are there compatibility concerns with existing code? Is this related to the messed up variance of delegate combining in C# 4.0? Edit: Would it be possible to have a language using co-/contravariance without that limitation running on the CLR? ...

What OpCodes were introduced in CLR 4.0?

Are there any IL opcodes that are new in .NET 4.0 as compared to 3.5, and if so, where can I find a list of them? ...