.net-4.0

Can I host a .net 2.0 virtual directory in asp.net 4.0 site?

We've had no problems running .NET 4.0 virtual directories in 2.0 web sites, but the opposite way around is giving us some issues. This is understandable, but is there a way to work around this problem? They are running with different application pools... can we have the virtual directory skip the website's web.config and go directly to ...

MageUI not including compatibleFrameworks element

I've got a ClickOnce .NET 4 app deployed by VisualStudio 2010, via UNC Path. I open the .application file, change the startup location to use the http address, sign, and close. The app then gives this error: - Application manifest does not accept specification of . Does anyone know how to get MageUI to include this needed element when...

LDAP using UserPrincipal missing a few fields in ActiveDirectory

I am accessing the Active Directory to fetch the employee Id from the Directory Server from my ASP.Net MVC account using the below code. I am able to get the Given Name,SurName and voice telephone number but not the Employee ID.But I know for sure that it is there. I am developing in one machine and deploying in another so can I by som...

Is there a Linq to Entities debug Visualizer working?

I found this but this is not working for me.I added a reference and also tried to also copy it to this directory -\Microsoft Visual Studio 9.0\Common7\Packages\Debugger\Visualizers Has anyone tried using this or something similiar that helps me see the sql code generated by Linq query.I know I can use the profiler but I want something mo...

When I publish a WCF rest service in IIS the services do not work?

Im using WCF REST 4.0 meaning to say their is no .svc file.. So I have 3 different service classes in one service WCF Rest Application project. And I registered all these services in the Global.asax What im trying to do is that I have a set of Business Functions from a lower framework e.g: .NET 1.0/2.0 where in i use datasets and not ca...

Create our own WorkflowDesigner class for rehost debugging in C# .NET 4.0

Hi all, I need to develop our own WorkflowDesigner UI for our workflow. Our customer doesn't really like the default WorkflowDesigner from VS2010 and they want to have entirely new UI for the workflow. Currently what in my head is To get the tree data structure from the memory that represents the workflow that I want to display on m...

.NET version of Java's assertGC: Unit tesing memory leaks

I am trying to write a unit test using .NET 4 to ensure that an object can be garbage collected after some code is run. In Java, I would use assertGC to ensure that a weak reference is collected. How can I write this type of test for .NET? I have tried keeping a WeakReference to the object and calling GC.Collect(), but as you'd expect, ...

WCF 4 throws an exception when using FormsAuthentication within the containing website.

I have a WCF 4 REST WebService within a folder in my ASP.Net MVC 2 project. JSONP is also enabled on the service using the 'crossDomainScriptAccessEnabled' binding option. The site and service work great. But, I just noticed that if you are signed in to the website (meaning you have a cookie) and then you 'test' an API method by hitting ...

Is there a way to setup a Func with a generic object parameter?

I currently have a mapping setup to convert from one base class to another base class. I am mapping a customer class to a thrid party control. The values are similiar but there is enough differences that I can't reuse the thrid party control. _converters = new Dictionary<Type, Func<AnnotationBase, AnnotationMark>>(); _converters.Add( ty...

Can you store a generic dictionary in Properties.Settings in 4.0?

The new Dictionary<Tkey,TValue> in .net 4.0 is serializable, so... can I now somehow use this in the Settings.Settings or Settings.Designer.cs? ...

.NET4 error loading resources in assembly references of CSharpCodeProvider compiled assembly

I have updated an application to Target .Net 4.0. Part of this application uses CSharpCodeProvider at runtime to compile source code files to assemblies and use them within the application. The complier provider options are set to "CompilerVersion", "v4.0". When executing the compiled code which references a 4.0 external dll (added as re...

Visual Studio 2010 keeps changing my winforms control

I have an odd situation with a user control in VS 2010. The form designer keeps changing my entry and then telling me it does not exist! It compiles and runs the first time, and then if I change something unrelated, it gives me an error in the designer.cs file (Cannot resolve symbol SomeEntry). private SomeEntry someEntry; // ... this.s...

How to give NT AUTHORITY\IUSR access to shared folder content?

I find something related, but not same thing. http://stackoverflow.com/questions/1269706/the-error-login-failed-for-user-nt-authority-iusr-in-asp-net-and-sql-server-2 My issue is that the files are shared on the network, and I would like to debug from local IIS, I find that all static files seems to be access denied (401.3) I have use...

Entity Framework Code First: decimal precision

I'm experimenting with this code-first approach, but I'm find out now that a property of type System.Decimal gets mapped to a sql column of type decimal(18, 0). How do I set the precision of the database column? ...

What is the most efficient data structure to store a list of integers that need to be looked up a lot in .Net?

I need an efficient data structure to store a list of integers. The amount in the list could range from 1 to probably never more than 1000. The list will be queried about 20 times per request. What would be the most efficient collection type to store these in? UPDATE To give a little more insight, we'll take www.wikipediamaze.com (a li...

How to add your own extension in Visual Studio 2010 to the context menu of the html/aspx code editor?

I made my own extension for Microsoft Visual Studio 2010. Within my VSCT-file I defined a group for my command to add it to the context menu of the code-editor: <Groups> <Group guid="guidUCCmdSet" id="UCMenuGroup" priority="0x0600"> <Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_CODEWIN"/> </Group> </Groups> Thats work...

Workflow 4 Unhandled Exception Recovery

Is there a way to recover from an unhandled exception that doesn't involve cancelling, terminating, or aborting a Workflow? What I'd like to do is have the Workflow restart or simply log the exception if possible. My workflow is long running and hosted in a WorkflowApplication, which is in a Windows Service. As of right now, if unhandl...

Working and tested JSon serializers for .NET 4?

Entire question is in the title: Are there any working, and tested, JSon serializer implementations for .NET 4? I tried Json.NET on codeplex, but it is neither updated for .NET 4.0, nor does it handle culture differences (like comma/dot in floating point values). Are there any that works? ...

Getting all the properties of a IDynamicMetaObjectProvider class when GetDynamicMemberNames isn't implemented

Is it possible to find all the available fields/properties that currently exist on dynamic object? I want to do this for all objects that implement IDynamicMetaObjectProvider. Using GetDynamicMemberNames() isn't suitable as it doesn't have to be fully implemented by custom dynamic classes, it can just return an empty enumeration. I don...

How to split an array into a group of n elements each?

What is the best way to group an array into a list of array of n elements each in c# 4. E.g string[] testArray = { "s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8" }; should be split into if we take n=3. string[] A1 = {"s1", "s2", "s3"}; string[] A2 = {"s4", "s5", "s6"}; string[] A3 = {"s7", "s8"}; May be a simple way using LINQ? ...