.net

Linq - What is the quickest way to find out deferred execution or not?

What is the quickest way to find out which .net framework linq methods (e.g .IEnumerable linq methods) are implemented using deferred execution vs. which are not implemented using deferred execution. While coding many times, I wonder if this one will be executed right way. The only way to find out is go to MSDN documentation to make su...

What privileges do I need to use the DSACryptoServiceProvider class on IIS ?

I just noticed that when I use DSACryptoServiceProvider class on IIS it triggers a CryptographicException saying it can't load a file. It doesn't specify the file. After hours I found that this exception is not triggered when the IIS Application Pool Identity is set to Local System which is the most privileged account available. This me...

How to hide the wait cursor while loading windows mobile program

I have an application written in C# and running on Windows Mobile 5. It currently takes several seconds to load all of the assemblies. During that time the wait cursor spins on top of the screen. I would like to show a splash screen with a progress bar instead. How can I prevent the cursor from being displayed? ...

Strings encoded ASCII and UTF8 have different lengths!

I'm reading a stream and am wondering why the UTF-8 encoded string is shorter than the ASCII one. ASCIIEncoding encoder = new ASCIIEncoding(); UTF8Encoding enc = new UTF8Encoding(); string response = encoder.GetString(message, 0, bytesRead); //4096 string responseUtf8 = enc.GetString(message, 0, bytesRead); //3955 ...

How to retrieve block-length of an IceCast-Stream?

IceCast is very similar to Shoutcast which gives you its data-block-length in the header via icy-metaint. The stream I work with (an IceCast-stream) doesn't seem to have such a value. How can I retrieve the length of a data-block? ...

.net substring not working

I'm getting an ArgumentOutOfRange error when using substring function in .NET. I'm new to .NET so probably doing something wrong. I have a txtField, which is a text field component in GUI. I'm using Microsoft Visual Basic 2010 Express txtField.Substring(txtField.Length-4,txtField.Length-1) If txt.Field contains only numberic values...

How to prevent firing of last event after page refresh?

Every time I refresh the browser, my button's event handler fires again. How do you prevent this? ...

entity framework linq - which should I learn, method-based on query-based?

Just starting getting into Entity Framework and Linq for EF. I'm not sure which of the two query methods I should concentrate on, method-based or query-based? Is there an obvious choice as to which one is easier to use, for both simple and more complex queries, hence should be the one I concentrate on? Assuming I'm using VS2010 does m...

InvalidCastException casting object to its own type

I'm currently completely baffled by the problem I'm having. I'm writing a plug-in for another application that provides a public .NET API. I've created a class named Room and I am using a PropertyGrid to allow users to see and edit the properties of the Room instances. A few properties are restricted to a set of standard values. Thus I a...

What does the revision in the CLR v4.0.30319 encode?

My understanding is that the revision of "50727" in the v2.0 of the CLR encodes the date of the release build: 2005-07-27. If this is true, what does the 30319 encode? Note: my information comes from a blog of a member of the CLR team. Note 2nd comment on this blog post: http://blogs.msdn.com/b/abhinaba/archive/2005/10/28/486189.aspx. ...

Routing issues? with asp.net mvc 2.....

Hey guys, Having some problems with an ASP.net mvc 2 project. I believe it's a routing issue? but i may be wrong... What happens is I have a method that accepts an HTTPPOST and this method/action will then process an xml file that was sent using post. Now the problem is... every time I try to do any logic with the posted file my clien...

How do I add 'Tags' to my simple BlogPost class library & repository?

Hi folks, Update Checking StackOverflow OData service it's exactly like Posts / PostTags / Tags ... How can I replicate that, please? So I've got a simple class called BlogPost - nothing special. Just a blog post. Now, I wish to add tagging for this class. Exactly like the tags for a StackOverflow question - 5 strings, space delimit...

Using diferrent version of binary in Umbraco 4.5

Hi all, I'm trying to integrate Umbraco 4.5 and Mailchimp .NET API wrapper. I'm running into problems because Umbraco uses CookComputing.XmlRpcV2.dll which is version 2.00 whereas Mailchimp API uses same binary but version 2.4 If I replace Umbraco binary with newer version, the admin area stops working (you can log in but all the cont...

Good/Upcoming .Net Projects looking for help?

Hi, I've been a professional .Net Developer (C#) for 4 years now and have recently been having some free time on my hands. I've been using this over the previous 3 months picking up Haskell and F# but am now looking to start working on an open source .Net project. The last oss I contributed to died a couple of years back. This time arou...

how to dump multiple levels LINQPAD

when i do a object.dump() i can get only 1 level. How do i do multiple levels. is ther any examples. ...

WPF Datagrid with variable number of columns AND change background color depending on value

Hi, I'm trying to make a grid that represent bookings over a month(excel style). For this I have used the WPF Datagrid and defined my column in C# code: for (int i = 0; i < noOfDaysInMonth; i++) { DataGridTextColumn tmpColumn = new DataGridTextColumn { Header = (i + 1).ToString(), Binding =...

How can to group lucene's results?

My application indexes discussion threads. Each entry in the discussion is indexed as a separate Lucene document with a common_id field which can be used to group search hits into one discussion. Currently when the search is performed, if a thread has 3 entries, then 3 separate hits are returned. Even though this is correct, from the us...

Castle DynamicProxy Interface Proxy Generation

I have a WindsorContainer. I have a ILazyComponentLoader (if it matters) and an Interface (ISomething) with an Interceptor attribute on in. [Interceptor(typeof(DynamicImplementationInterceptor)] public interface ISomething I want Windsor to use ProxyGenerator.CreateInterfaceProxyWithoutTarget when resolving the interface via contai...

Package Manager Console issues

I installed Asp.net MVC 3 beta which also installs NuPack, but when I open a project in Visual Studio 2010 Express, the Package Manager Console gives me this error message: System.TypeLoadException: Could not load type 'System.Management.Automation.Runspaces.InitialSessionState' from assembly 'System.Management.Automation, Version=1.0....

Any decent javascript code editor *control* for .net?

With syntax highlighting and intellisense if possible. Can be paid but better if free. What I need is a control/class/lib/dll that I can use in a Windows Forms project. I don't need a program. I'm using .net 4.0 with Visual Studio 2010. Working on C#. ...