.net-4.0

.net 4.0 migration

Can a .net 3.5 c# project reference a .net 4.0 assembly and compile with it? What about run time? What about 4.0 compiling / running with 3.5? EDIT: in particular, I have a 3rd party .net assembly. It has extension points: I register my dll in app.config and it calls me (probably via reflection). Can I implement my dll in .net 4.0? wh...

Can't choose asp.net web service application in VS 2010 when .net 4.0 is choosen?

Hi Can't you have a .net 4.0 web service application? When I choose .net 3.5 the "asp.net web service application" shows up in the list but once I change it back to 4.0 it goes away. Did something replace it or they just don't have a webservice at 4.0 yet? ...

Simplest way to get an interactive console for my app

I want a simple, interactive way to demo middle-tier features of my app which have not had a UI created yet. I want an interactive console. When my application (WPF but it shouldn't matter) boots up I would like to also start a console window. This window should run powershell (or ruby, or python, but preferably powershell) and have i...

Is a linq query to ConcurrentDictionary Values threadsafe?

Hello, let's say I have the following code: ConcurrentDictionary<long, long> myDict= new ConcurrentDictionary<long, long>(); Normally every access by key is threadsafe, but is also the following linq query threadsafe? I have not found anything in the docs: http://msdn.microsoft.com/en-us/library/dd287226.aspx if myDict.Values.Any(x ...

A site built in .NET 3.5 to target 4.0, when server runs 3.5

I have a legacy .NET site that has been around since the 1.1 days. As I've upgraded my VS, I've upgraded the target framework as well. Currently the site is running 3.5. I just got VS10 and it is asking me to upgrade the site to 4.0. However, my (shared) server is still running 3.5 and I can't upgrade it. Is it safe to upgrade the site t...

A potentially dangerous Request.Form value was detected from the client in .Net 4...

So, this whitepaper describes one of the breaking changes in .Net 4 to be the error message "A potentially dangerous Request.Form value was detected from the client in", and the fix to enter into the Web.config file I have 2 problems with this. Does this mean that any website where I want a wysiswyg editor like tinymce, or ckeditor, t...

Dynamically set the view base type for a partial view?

Hi, Is it possible to dynamically set the view base type for a partial view? I'm doing a lot of dynamic page generation, using custom IViewFolder and IViewFile implementations, and need to set a specific base type for certain views...it's not a problem injecting the correct block, I just need to know what block to inject. I've ...

Entity framework calling a FOR XML stored procedure truncates at 2033 characters

I have a stored procedure which uses a FOR XML statement at the end of it, and returns me some XML. I am using .NET 4 and the Entity Framework and when I do a function import of this stored procedure and try to call it through the Entity Framework it truncates the return at 2033 characters. I swapped the Entity Framework for a traditi...

Dynamic Survey Form in asp.net

Hi all, I currently have a db structure that looks something like what i have below and i was wondering what the best way would be to go about building dynamic forms based on the DB for the Question & Answer input portion. Also what is the safest way to do this? QuestionID | Question ...

Is there a C# version of CTypeDynamic?

From the documentation: The CTypeDynamic method applies dynamic conversions in accordance with the conversion semantics defined by the object itself. If a dynamic object inherits from DynamicObject, the CTypeDynamic method first attempts to perform the conversion by using a user-defined, static conversion. If the user-defined, static...

Why am I getting the error "Unrecognized attribute 'targetFramework'" in iis6?

I have a MVC application using .Net 4.0 and have installed it on a server with IIS 6 on it. I installed .Net 4 on the server and changed the ASP.Net version to 4.0.xxx. Unfortunately, I am still getting the error "Unrecognized attribute 'targetFramework'". What am I missing? ...

.Net 4.0 application running in IIS 7.0 - Hanging under load

Hey, My company is running a .NET 4.0 site in IIS 7 on a windows 2008 server machine. Our site hits are steadily increasing and now we're getting issues during peak usage periods. The site will hang for a time making requests that should be nearly instantaneous take long periods of time (up to 30 seconds). We run a load balanced envi...

Wf 4 Receive Activity: Difference between Messages and Parameters

Receive activities in WF4 can take two kind of values, Message or Parameters. Does anybody know the different between these two? cheers ...

How does the Entity Framework handle SQL Server Schemas?

We are developing an application against a SQL Server 2005 database that uses several schemas for security purposes. The application will be using EF 2 in the .NET 4.0 framework. What I'm wondering is how those SQL Schemas (Support, Admin, Employee) etc. can/will/should be represented on the EF side. Should I separate the various entit...

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

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. ...

How to compare 2 lists of objects and remove the items that are not common?

I've got 2 generic lists that do not contain the all fields of the same type IList<Category> and List<CategoriesRow>Categories categoryList = IList<Category> but both have common fields Name and ID. I want to compare list Categories with categoryList and find from categoryList where categoryList[index].ID does not exist in the list ...

WPF 4.0 TreeViewItem.Expanded called recursively for parents of the expanded node

Has anyone got any idea why in WPF .NET 4 the treeview TreeViewItem.Expanded event is call by the expanded node, then by each of the parents recursively up the tree until and including the root node? I can get around it but I'd just like to know the mechanics of the problem. Ed ...

Webservices vs WCF

I am working on an asp.net application (.net 4 framework) design and was wanting to know what are the pros and cons and best practices for using webservices vs WCF techology? This application will eventually be used by outside clients to consume data. When would you use WebServices and when would you use WCF? Is one more scalable than t...

How to get started with .NET grid computing

I'm interested in getting started with some grid computing on the .NET platform. Can ayone recommend "getting started" resources and / or sample applications with source code? Thanks... edit: By "grid computing" I mean distributed processing of complex problems across multiple machines... ...

What is the point of a .NET 4.0 TryCatch Activity if the Finally is not guaranteed to execute?

I was designing an Activity today and I came across an issue by which rethrowing an exception within the Catch of a TryCatch block does not execute the Finally which is also associated with it. Upon further investigation I came across the following http://connect.microsoft.com/wf/feedback/details/557601/try-catch-activity-never-execut...