clr

Investigation of CLR via SOS

非 Y 不嫁゛ 提交于 2019-12-19 10:25:26
问题 Currently I am digging deeper into CLR and try to find proper size of my managed objects. I have two simple types: XClass class XClass { public XStruct StructField = new XStruct(); public int IntField; public double DoubleField; } and XStruct struct XStruct { public short ShortField; public long LongField; } Also cosider code snippet where this objects are involved: static unsafe void Main(string[] args) { double angle = 0.34; { double anotherDouble = 1.49; XStruct xStruct = new XStruct();

Do value types have Type objects?

怎甘沉沦 提交于 2019-12-19 09:09:14
问题 I am sure if the Title is explainatory or not, but I need some help understanding the concept. We have class (reference types) that has method table associated with Type object. In addition to the method tables, the type object also contains all the static fields, type obj pointer and sync block index. CLR refers to this method table when calling methods on instance of a reference type. Method table contains the IL for a particular method that is used to change the state of instance fields.

Error message in XSLT with C# extension function

混江龙づ霸主 提交于 2019-12-19 08:17:12
问题 I am received the following error while trying to implement a C# extension function in XSLT. Extension function parameters or return values which have CLR type 'Char[]' are not supported.** code: <xsl:variable name="stringList"> <xsl:value-of select="extension:GetList('AAA BBB CCC', ' ')"/> </xsl:variable> <msxsl:script language="C#" implements-prefix="extension"> <![CDATA[ public string[] GetList(string str, char[] delimiter) { ... ... return str.Split(delimiter, StringSplitOptions.None); }

How to resolve the following linker errors in Visual Studio?

吃可爱长大的小学妹 提交于 2019-12-19 07:16:13
问题 Here is My scenario. I have a project which contains 30 subprojects. In one of the projects I have used CLR (common language runtime) so I modified its runtime with /mdd (multi threaded debug DLL). Individually all the projects are built successfully. But when I try to compile the main project I am getting the following linker errors: LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library LIBCMTD.lib(winxfltr.obj) : error LNK2005: __XcptFilter

Use of Different .Net Languages?

末鹿安然 提交于 2019-12-19 04:08:09
问题 Is there a breakdown of the popularity of the different .Net languages available? Does anyone know of any surveys that give this information, or even if it is possible to determine this? Update The answer is not a list of the different .Net languages. I would like to see statistics showing the relative usage/popularity of each .Net language. Thanks. 回答1: Not sure if this is what you are after but it's interesting nonetheless. I was surprised to see C# as far down as it was. http://langpop.com

How do actually castings work at the CLR level?

≯℡__Kan透↙ 提交于 2019-12-19 03:09:38
问题 When doing an upcast or downcast, what does really happen behind the scenes? I had the idea that when doing something as: string myString = "abc"; object myObject = myString; string myStringBack = (string)myObject; the cast in the last line would have as only purpose tell the compiler we are safe we are not doing anything wrong. So, I had the idea that actually no casting code would be embedded in the code itself. It seems I was wrong: .maxstack 1 .locals init ( [0] string myString, [1]

UnhandledException not called when exception thrown in another thread

Deadly 提交于 2019-12-18 23:53:22
问题 According to the Microsoft documentation, when an unhandled exception occurs on a thread (from either the thread pool or created using the System.Threading.Thread class) the AppDomain.UnhandledException event should fire for the default AppDomain of the application. Here is the MSDN link which explains it after the second NOTE section. But I cannot reproduce this behaviour, as far as I can tell from my test application it never fires the UnhandledException on either the default AppDomain or

Can I run a .NET garbage collection from WinDbg?

孤人 提交于 2019-12-18 18:55:40
问题 I'm looking into why a managed process is using a lot of memory. Is there a way to run GC.Collect(3) from WinDbg, so that I can focus on the actual memory allocation? 回答1: I don't think there is any way to run a .NET garbage collection from WinDbg, but I also don't think it is necessary. See Rico Mariani's Performance Tidbits - Tracking down managed memory leaks (how to find a GC leak) for information about finding out what kind of stuff is on your heap. Additional possibly useful links: When

Remove signing from an assembly

∥☆過路亽.° 提交于 2019-12-18 16:12:10
问题 I have a project open in Visual Studio (it happens to be Enyim.Caching). This assembly wants to be delay-signed. In fact, it desires so strongly to be delay-signed, that I am unable to force Visual studio to compile it without delay signing. I have unchecked "Delay sign only" and "Sign the assembly" on the Visual Studio project properties box, and rebuilt. The assembly is still marked for delay sign (as shown by sn.exe -v ). I have unloaded the project and verified that the signing is set to

“Assembly Same Simple Name already been imported” error

时光怂恿深爱的人放手 提交于 2019-12-18 14:52:23
问题 This is a CLR project. I'm importing two DLL files with the same name, quizz.dll (I rename the old version as legacyquizz.dll ) and I include the newer version as quizz.dll into a legacy converter test project. (The legacy converter project being tested only imports the old quizz.dll ). This is the error I'm getting . . . An assembly with the same simple name 'Quizz, Version=2.0.0.1, Culture=neutral, PublicKeyToken=null has already been imported. Try removing one of the references or sign