.net-4.0

GC Roots misunderstanding?

让人想犯罪 __ 提交于 2019-12-05 18:47:57
I know that Roots are : static fields method parameters local fielfs f-queue which also holds a pointer to the " going to be finilized" objects cpu registers <=??? Now lets talk about registers. the code whch they can contain is like : mov bx, 0034h ; bx = 52 (stored in 16 bits) mov cl, bl ; cl = lower 8-bits of bx mov eax, ecx call print_int but wait ! If im not mistaken , this is the actually code which was Holding those those static , local and parameters - from the first place ! So why to write this TWICE ? ( or from another direction ?) Why to write ( for example ) Foo f = new Foo(); *

SQL Spatial polygon inside out

若如初见. 提交于 2019-12-05 18:31:31
问题 I am allowing users to draw a polygon in Silverlight by clicking to draw. Then I loop through the points, convert them to longitude and latitude and then save to SQL (in a geography column). The problem is that because of the world being round and all that, it only works if the user draws clockwise. Otherwise it tries to make the polygon right round the world and fails. So how do I do this correctly? Do I have to work out which way they are drawing, and if so how? 回答1: You can check, if the

Using ToList() on Enumerable LINQ query results for large data sets - Efficiency Issue?

百般思念 提交于 2019-12-05 18:07:43
I've been making a lot of use of LINQ queries in the application I'm currently writing, and one of the situations that I keep running into is having to convert the LINQ query results into lists for further processing (I have my reasons for wanting lists). I'd like to have a better understanding of what happens in this list conversion in case there are inefficiencies since I've used it repeatedly now. So, given I execute a line line like this: var matches = (from x in list1 join y in list2 on x equals y select x).ToList(); Questions: Is there any overhead here aside from the creation of a new

Dynamically calling 32-bit or 64-bit DLL from c# application using Environment.Is64BitProcess

巧了我就是萌 提交于 2019-12-05 17:30:16
I am working on a project written in C# for .NET 4.0 (via Visual Studio 2010). There is a 3rd party tool that requires the use of a C/C++ DLL and there are examples for 32-bit applications and 64-bit applications in C#. The problem is that the 32-bit demo statically links to the 32-bit DLL and the 64-bit demo statically links to the 64-bit DLL. Being a .NET application it could run as either a 32-bit or 64-bit process on the client PCs. The .NET 4.0 framework provides the Environment.Is64BitProcess property that returns true if the application is running as a 64-bit process. What I would like

Debugging .Net4 COM registered assembly from Win32 caller in Visual Studio 2010

痴心易碎 提交于 2019-12-05 17:13:39
This is a very simple setup, I can't believe but I didn't find anybody with the same problem so far... Create a .Net4 class library in VS2010. Create a simplest possible COM object: [ComVisible(true)] [Guid("CD157EBC-C89D-40b6-B531-E85FF4B3AE9A")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IAcorn { bool Foo(string moo); } [ComVisible(true)] [ClassInterface(ClassInterfaceType.None)] [Guid("854B7690-C1C4-40c4-8059-B4F3450B30D0")] public class Acorn : IAcorn { public Acorn() { } public bool Foo(string moo) { return true; } } Set "Register for COM interop" option for

Forms Authentication adding additional information along with ReturnUrl

别说谁变了你拦得住时间么 提交于 2019-12-05 17:05:47
With Forms Authentication when the app needs to redirect to sign-in page is there an event or any extensibility point that will let me do additional work to the request before it redirects to the sign-in page? I would like to send additional information in the query string that could vary such that it wouldn't work to just statically embed that in the link in the loginUrl node in the web.config. Edit: For clarification, I want to intercept the request prior to being redirected TO the login page. Example: <authentication mode="Forms"> <forms loginUrl="http://the/interwebs/login.aspx" timeout=

PartCover 4.0 Only Reports NUnit Libraries

☆樱花仙子☆ 提交于 2019-12-05 16:36:46
I'm using PartCover 4.0 (from the sourceforge page , latest dev build) with NUnit 2.5.8 on Windows 7 (x64). PartCover runs ok (using the -x86.exe), but it only shows me coverage for various NUnit packages -- not my own source-code. I originally didn't use CorFlags.exe since I didn't get the COM error; I tried it anyways, and it didn't make any difference. I've looked at all the other questions on Stack Overflow, and none seem to apply; I'm using PartCover 4.0, there are no spaces in any of my names, my coverage rule is the most broad ( +[*]* ), and I've run CorFlags.exe. What am I missing? I

Why is my assembly not visible in “Add Reference > .Net” when installed to the GAC?

≯℡__Kan透↙ 提交于 2019-12-05 16:12:33
问题 Just have a quick question about the GAC I created an assembly Awesome.DLL. Had it signed, then installed into the GAC: C:\MyApps\Awesome\Awesome\Awesome\bin\Release>sn -k Awesome.snk Microsoft (R) .NET Framework Strong Name Utility Version 4.0.30319.1 Copyright (c) Microsoft Corporation. All rights reserved. Key pair written to Awesome.snk C:\MyApps\Awesome\Awesome\Awesome\bin\Release>gacutil /i Awesome.dll Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.1 Copyright (c)

Communication between two WPF applications

爷,独闯天下 提交于 2019-12-05 16:09:28
I have two WPF applications, I need these two applications to be able to communicate with each other. I just need these applications to send some notifications to each other and nothing more. I have found two techniques yet, one is using WCF, and another is using DDE. But to me these seems too much complicated for my requirement. Please suggest what is the simplest way to go about this? What other options I have? If they are both on the same network(otherwise you need to port foward the port that you use), you could make a TCP connection between them, both need a TCPlistener and a TCP client.

ASP.Net using wrong web.config for virtual directory

﹥>﹥吖頭↗ 提交于 2019-12-05 15:54:52
We're running IIS 6 on Windows Server 2003 R2. We want to add a virtual directory that runs under .NET 4.0 to a site that runs under .NET 2.0. We've given the virtual directory its own app pool, and we've configured the virtual directory to run under 4.0. The parent site works fine, but the virtual directory throws errors that reference the parent site's web.config file. We need the virtual directory to use its own web.config file. The GUI in the IIS Manager says that the virtual directory is using its own web.config file, but the error messages we get refer to items in the parent's web.config