.net-4.0

AsParallel: does it make sense for small number of elements in container?

public class ReplacementService : IReplacementService { public List<int> GetTeamReplacementWeight(int iTeamId) { IEnumerable<TeamReplacementGroup> groups = TeamReplacementGroup.GetTeamGroups(iTeamId); List<int> weights= groups .Select(group => group.GetWeight()) .AsParallel() .T...

ADO.Net DataService Performance Issue

We are using ADO.Net DataService ( .Net Framework 4.0, Visual Studio 2010). We have Select, Insert, Update and Delete operations. For Selecting we have queries like School school = _context.School.Expand("Address, ContactPerson, ContactPerson/Details......").Where(S => S.Name == "xxx").SingleOrDefault(); For Inserting _context.Ad...

can .net framework 4 works on top of windows xp?

Hello, I tried to run a small application that I've written using VS2010 on my old Windows XP desktop. I got the yellow screen of death showing me a portion of the web.config with assemblies. <compilation debug="true" targetFramework="4.0"> It looks like it didn't like the 4.0 framework. I re-wrote it, targeting 3.5 framework, this ...

Bug in WPF DataGrid after upgrading to .NET 4.0

Situation is as follows: A DataGrid has a RowDetailsTemplate, which contains another DataGrid (the subgrid). If you add a DataGridTemplateColumn which contains an EventHandler, a NullReferenceException is thrown by PresentationFramework.dll. This issue is only present in .NET 4.0. If the project targets .NET 3.5 (and uses WPFToolkit f...

xml as input for a .net 4.0 webservice

We're rewriting our 2008 VS website in 2010 and I have just gotten to our webServices and when I went to test them out I'm getting the Cross Site Scripting message because we need to accept XML as our input. I've seen all over the web where people are just putting the following into the web.config and I would rather not take our site ba...

Concurrent acess to EF4 entities (Parallel + EF4)

I'm currently working in a dispatcher service that processes thousands of messages delivered in different channels (email, private message, application message) using EF4 and WCF. To try to speed up message dispatching i'm trying to use Parallels: Parallel.ForEach(currentMessageList, m => { Processors.DispatcherWrapper.Dispatch(m, m.un...

String comparison in dotnet framework 4

Hi all, I explain my problem and interrogation (excuse my bad english), i have a dotnet exe which every milliseconds past to processing is very important. This program do lot's of string comparison (most of it is "string1.IndexOf(string2, StringComparison.OrdinalIgnoreCase")) When i switch in framework 4 my program time is twice than...

Bin DLL's target different .NET frameworks possible?

I have a website that is currently running under .NET 3.5. I am thinking of making it run under 4.0, but I use many 3rd-party DLL's for compressing, Bit.ly, Twitter, XML, etc. If these DLL's were created for .NET 3.5 (in VS2008), will they continue to run under 3.5? Or is 4.0 somehow backwards compatible for old libraries? ...

Exception escapes from workflow despite TryCatch activity

I have a workflow inside a Windows Service that is a loop that performs work periodically. The work is done inside a TryCatch activity. The Try property is a TransactionScope activity that wraps some custom activities that read and update a database. When the transaction fails, I would expect any exception that caused this to be caught b...

Visual Studio 2010 Conversion issue not recognizing prefix 'asp'

I just converted a project from Visual Studio 2008 to 2010 and all of my asp controls have a warning stating.. Unrecognized tag prefix or device filter 'asp'. It also is not showing any intellisense, anyone else experiencing similar issues? Is it possible my conversion did not go through correctly? Thank you. ...

Reference .NET 2.0 dll from .NET 4 client profile

I am wanting to move some winforms projects to the .NET 4.0 client profile. Unfortunately they reference an old project which has lots of crystal reports in it. Crystal Reports requiring System.Web among other assemblies not in the client profile. As I understand it running the main exe as .NET 4 client profile would try to run any ref...

ReportViewer 9 in .NET 4 application possible?

I am using ReportViewer 9 in WPF to talk to a remote SSRS server (because I have a SQL Server 2005 Reporting Services requirement) to add reports to a WPF .NET 4.0 application. I can create a project and run ReportViewer 9 using .NET 3.5, but I cannot (either from not being possible, or my lack or knowledge) get it to run within the WP...

Structuremap error when using HttpContextBase in constructor

I am building a ASP.NET MVC 2.0 app on .NET 4.0 and am using Structuremap 2.6.1 for IoC. I recently added a ICookie and Cookie class, the Cookie class takes HttpContextBase as a constructor parameter (See below) and now when I run my app I get this error :No Default Instance defined for PluginFamily System.Web.HttpContextBase. I have us...

convert text xml to binary xml in .NET 4

Is there any way to do that in .NET 4, may be with XmlDictionaryWriter? ...

Join 2 lists in one

I am new in .NET > 2 I have List<Dog> dogs; List<Cat> cats; List<Animal> animals; I need to join dogs and cats in animals. I know that there should be a elegant way to do it using LINQ or stuff from .NET 4, isn't it? My Initial variant: animals.AddRange(dogs); animals.AddRange(cats); ...

Get values of HttpClient TransportSettings.Credentials in WCF REST 4.0

I have a client wherein I pass in the username, password through network credentials. What I want to do is to pass these two parameters to the service itself for authentication purposes: Example shown below: Client: HttpClient client = new HttpClient("http://localhost:8080/ProductService/"); client.TransportSettings.Credentials = ...

Determine Declaring Order of Python/IronPython Functions

I'm trying to take a python class (in IronPython), apply it to some data and display it in a grid. The results of the functions become columns on the grid, and I would like the order of the functions to be the order of the columns. Is there a way to determine the order of python functions of a class in the order they were declared in t...

Directory tree data type?

What would be the return type of the following method? (T) public T GetDirectoryContentsRecursively (string path) { ... } The method will read the contents of a remote directory, and read the contents of each sub-directory and each of that object's sub-directories and so on. I have thought about using List<object>, where object coul...

Ajax post doesn't work with html in parameters in combination with .net 4 framework

After upgrading our project to the .net 4.0 framework (from 3.5), we facing some problems with ajax calls with html in the parameters. As soon as the user enters some html in a text area the ajax call isn't executed anymore. If the user enters plain text only, there is no problem. <script language="javascript"> /* Doesn't work */ var...

What's the difference between button.click event and button.command event?

Whats the difference between Button.Click Event and Button.Command Event in asp.net? ...