clr

VB.NET Socket Exception only while Debugging

蹲街弑〆低调 提交于 2019-12-11 04:21:17
问题 I have recently encountered some rather baffling behavior while up-converting a VB.NET solution from VS2005 to VS2010. For reference, the solution targets .NET 2.0 and was running without error in the debugger prior to the conversion. In addition to the IDE change, corporate has seen it fit to refresh my device from Win XP (x86) to Win 7 (x64). Now that I have converted the solution to VS2010, I receive a Socket exception as soon as the debugger loads (details below). This ONLY occurs in the

Where exactly is SomeDelegate.Invoke implemented and how is it “wired” to the delegate classes

柔情痞子 提交于 2019-12-11 03:57:45
问题 Where exactly (CLR source file) can in find the actual implementation of the SomeDelegate.Invoke method? How does the .Net runtime knows that calling SomeDelegate.Invoke should result in calling that implementation? Keep in mind that the SomeDelegate.Invoke method can have any number of arguments. 回答1: So, here is how the voodoo magic works (from what I found by glancing over the sources for an hour): At some time, the method table for the SomeDelegate class is populated and the runtime

C# 4 and CLR Compatibility

此生再无相见时 提交于 2019-12-11 03:55:56
问题 Are all the additions to C# for version 4 (dynamic, code contracts etc) expected to run on the current .NET CLR, or is there a planned .NET upgrade as well? 回答1: C# 4 will require the .NET 4.0 CLR. 回答2: Well, .NET 4.0 will require CLR 4.0; however, it is a little harder to answer what parts of C# 4.0 will work on .NET 2.0/3.x. We can hope that VS2010 will still be multi-targeting(I don't have the CTP "on me" so to speak, so I can't check...). But some of the language features don't seem

Loading managed dll into AppDomain from native c++ code

允我心安 提交于 2019-12-11 03:47:28
问题 I want to load managed assembly into the AppDomain from native c++ code. If it worth something the native code is a CLR profiler so I get notification each time AppDomain is created. 回答1: I believe you need to host CLR. 回答2: You're probably looking for ICLRRuntimeHost::ExecuteInDefaultAppDomain() . It will load an assembly into the default AppDomain. You asked about loading into "the" AppDomain, so presumably you don't care about other non-default AppDomains. ICLRRuntimeHost is a COM

What does ----s mean in the context of StringBuilder.ToString()?

给你一囗甜甜゛ 提交于 2019-12-11 03:46:15
问题 The Reference Source page for stringbuilder.cs has this comment in the ToString method: if (chunk.m_ChunkLength > 0) { // Copy these into local variables so that they // are stable even in the presence of ----s (hackers might do this) char[] sourceArray = chunk.m_ChunkChars; int chunkOffset = chunk.m_ChunkOffset; int chunkLength = chunk.m_ChunkLength; What does this mean? Is ----s something a malicious user might insert into a string to be formatted? 回答1: In the CoreCLR repository you have a

Why is there no intellisense in a CLR/CLI project

元气小坏坏 提交于 2019-12-11 03:27:56
问题 I don't know if I have done anything wrong, but when I try to write code there are no intellisense popups indicating options or errors. I am creating a CLR/CLI type of project with Microsoft's Visual C++ 2010. 回答1: You're not doing anything wrong, Intellisense is not supported in Managed C++ (C++/CLI). There is a long blog post explaining the details at the Visual C++ blog. Edit: Correcting name of the blog as per comment. :) 回答2: See the 2nd comment, in this blog post from May 2009: http:/

UnmanagedFunctionPointer causes stackoverflow when using .NET 4.0, 3.5 works

家住魔仙堡 提交于 2019-12-11 03:26:06
问题 I have a simple function inside of a click handler that has a try catch block. If I throw an exception within this try catch block it catches the exception successfully. If I put a call to an unmanaged DLL before I throw the exception the exception is unhandled and not caught. What is the unamanged DLL call doing that could be breaking my programs exception handling? If I run the program in debug mode it catches the exception even with "break on exception" unticked for all exceptions. The

Error settings breakpoints but only on some lines while debugging

拜拜、爱过 提交于 2019-12-11 03:25:54
问题 This line is causing the "key not found" in the PostEntityImages collection. Entity pimage = _context.PostEntityImages["postcreate"]; When I put a break point on that line and put it in the watch window it works fine and that key is present. UPDATE: protected override void ExecutePlugin() { try { Entity pimage = null; if (_context.PostEntityImages.ContainsKey("postcreate")) pimage = _context.PostEntityImages["postcreate"]; } catch (Exception) { // Never hits this line throw; } } // When

Why is TypedReference.MakeTypedReference so constrained?

情到浓时终转凉″ 提交于 2019-12-11 03:01:53
问题 I've finally understood the usage of the TypedReference.MakeTypedReference method, but why are the arguments so limited? The underlying private InternalMakeTypedReference(void* result, object target, IntPtr[] flds, RuntimeType lastFieldType) can do a lot more things than the MakeTypedReference that limits the field array to have elements and the field types to be non-primitive. I've made a sample usage code that shows the full possibility of it: private static readonly MethodInfo

A CLR function equivalent to string.Format in C#

不羁岁月 提交于 2019-12-11 02:54:52
问题 I was looking for a CLR function that will do the same thing as String.Format in C#. As an example, I would like to do the following through a CLR function: String.Format("My name is {0}, and I live in {1}",myName, cityName) I would like to be able to pass variable number of parameters after the first parameter, which would be as many place holders are specified in the first parameter to this CLR function. Anyone has any idea on what would be the C# code for such a CLR function? 回答1: I'm