.net-4.0

Reflector Not Decompiling 'System.Data.Entity.dll' .NET 4.0

狂风中的少年 提交于 2019-12-17 21:32:03
问题 When looking at the System.Data.Entity.dll for .NET 4.0, no methods are being decompiled. I only see the method stubs. I tried re-installing reflector but it still didn't work. I am able to decompile other .NET assemblies just fine. 回答1: I think your issue is that you've pointed Reflector at the metadata-only version of the assembly. A number of assemblies are installed for use by VS 2010 that contain only the metadata, not the method's IL, of the original assembly. They did this for

Serialized data on tcpclient needs to state amount?

旧时模样 提交于 2019-12-17 21:23:19
问题 I have sent data as byte using TcpClient and I wanted to send my own class instead bytes of data. By bytes of data, what I meant is that I am sending the data converted into bytes like this: using (MemoryStream bufferStream = new MemoryStream()) { using (BinaryWriter bufferData = new BinaryWriter(bufferStream)) { // Simple PONG Action bufferData.Write((byte)10); } _logger.Info("Received PING request, Sending PONG"); return bufferStream.ToArray(); } And instead I would like to send it like

ItemsControl ItemTemplate Binding

霸气de小男生 提交于 2019-12-17 21:02:17
问题 In WPF4.0, I have a class that contains other class types as properties (combining multiple data types for display). Something like: public partial class Owner { public string OwnerName { get; set; } public int OwnerId { get; set; } } partial class ForDisplay { public Owner OwnerData { get; set; } public int Credit { get; set; } } In my window, I have an ItemsControl with the following (clipped for clarity): <ItemsControl ItemsSource={Binding}> <ItemsControl.ItemTemplate> <DataTemplate>

Unable to find enum type for static reference in WPF

人盡茶涼 提交于 2019-12-17 20:43:38
问题 I'm trying to bind an enum to a radio button in WPF (Inspired by this answer), but I have trouble finding the enum type for the converter parameter: The enum is defined in the following way namespace Application.Models { public class Enums { public enum MySelections { one, two ,three }; public MySelections CurrentSelection; ... } } I am trying to bind now the checkbox like this (The data context is assumed to be correct and the value converter implemented:) <Window x:Class="Application

how to access the underlying default concurrent queue of a blocking collection

大兔子大兔子 提交于 2019-12-17 20:21:00
问题 I have multiple producers and a single consumer. However if there is something in the queue that is not yet consumed a producer should not queue it again. (unique no duplicates blocking collection that uses the default concurrent queue) if (!myBlockingColl.Contains(item)) myBlockingColl.Add(item) However the blocking coll does not have a contains method nor does it provide any kind of trypeek() like method. How can I access the underlying concurrent queue so I can do do something like if (

Processing large text file in C#

自古美人都是妖i 提交于 2019-12-17 20:15:51
问题 I have 4GB+ text files (csv format) and I want to process this file using linq in c#. I run complex linq query after load csv and convert to class? but file size is 4gb although application memory double size of file. how can i process (linq and new result) large files? Thanks 回答1: Instead of loading whole file into memory, you could read and process the file line-by-line. using (var streamReader = new StreamReader(fileName)) { string line; while ((line = streamReader.ReadLine()) != null) { /

.NET 4.0 Excel Interop issues with dynamic collections

别等时光非礼了梦想. 提交于 2019-12-17 19:52:02
问题 In Excel you can return a dynamic array System.Object[*] , from a series object using XValues . In .NET 3.5 you can access the elements in this object by casting it to and array, i.e.: var values = (Array)series.XValues; In .NET 4.0, this no longer works, and the message "Unable to cast object of type 'System.Object[*]' to type 'System.Object[]'" is given. Any ideas? The following doesn't work: Casting it as dynamic. Casting it to a System.Object[*] . Just placing the object in a for each

Can I deploy .net 4.0 web application on IIS6?

混江龙づ霸主 提交于 2019-12-17 19:42:37
问题 I've recently upgraded VS 2008 to VS 2010. On our server we have IIS6 installed and we can not change that in near future. Even though we will develop new applications to be deployed on IIS7 but if situation demands we may need to develop an application using .net 4.0 and to be deployed on IIS6, then in this case I wanted to know whether IIS6 supports .net 4.0 application or not? If I can deploy, then do I need to take care of any configuration or any other setting I should change before

When to use volatile to counteract compiler optimizations in C#

我与影子孤独终老i 提交于 2019-12-17 19:37:40
问题 I have spent an extensive number of weeks doing multithreaded coding in C# 4.0. However, there is one question that remains unanswered for me. I understand that the volatile keyword prevents the compiler from storing variables in registers, thus avoiding inadvertently reading stale values. Writes are always volatile in .Net, so any documentation stating that it also avoids stales writes is redundant. I also know that the compiler optimization is somewhat "unpredictable". The following code

Task could not find “AL.exe” using the SdkToolsPath

非 Y 不嫁゛ 提交于 2019-12-17 19:34:31
问题 I have this problem tring to build one solution Task could not find "AL.exe" using the SdkToolsPath "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\" or the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A". Make sure the SdkToolsPath is set and the tool exists in the correct processor specific location under the SdkToolsPath and that the Microsoft Windows SDK is installed I know there is a similar question, but the aswer didn't work for me