.net

Reference for predefined exceptions in .NET

Does a reference exist with a catalog of predefined exceptions for the .NET framework along with examples of when is it appropriate to use each? ...

Does .NET have a BITS module?

I have been researching in to using Background Intelligent Transfer Service. Most articles I have seen says there is no official .NET port but they recommend using sharpBITS. I will use sharpBITS if I have to but I noticed that all of the articles are referencing .NET 1.1 and 2.0, they seem to have been written before 3.0 came out. Was B...

Programmatically Create / Delete Windows Media Services Publishing Point

I'm looking for a .NET wrapper to programmatically Create and Delete Windows Media Services publishing points through WMI. I can't be the only one to ever want to do this through .NET, so before I re-invent the wheel, anyone seen any code samples out there to do this? ...

Should I dump all WebForms/ASP.NET MVC and WinForms development and move to Silverlight?

There seems to be a strong movement towards Silverlight, even with Windows Phone 7 rumoured to have dev based around it. Is Silverlight a valid alternative for all web/thick client development? You can remove the concern around plug-in requirements. I'm more concerned about it being technically deficient or cumbersome as opposed to tr...

appSettings file attribute equivalent for applicationSettings

In a asp.net web.config file you can do <appSettings file="local.appSettings.config"> <add key="foo" value="bar" /> </appSettings> and it will look in local.appSettings.config for any overrides to the foo/bar setting. Is there an equivalent for applicationSettings? Something like this <applicationSettings file="local.application...

Deep copy entity with NHibernate

I am currently starting a new ASP.NET MVC Project at work where we need to generate a project cost estimate. We are using NHibernate, ASP.NET MVC 1.0 and StructureMap. The client wants to be able to fill all the information about the project, the information is in different pages and we need to persist in between each post back. The ...

How to put data into clipboard on a Windows Mobile device written in .NET?

I want to put some data in the clipboard using c# and the Compact Framework. I am using a Windows Mobile device. How to put data into clipboard on a Windows Mobile device written in C#? ...

how to load a pdf from server as an aspx page (or loading pdf files securely)?

I have a folder with pdfs, but I don't want them to be public (like just typing www.domain.com/pdfs/doc.pdf). I need them to have a security measure of some sorts (like www.domain.com/loadpdf.asmx?key=23452ADFASD12345 or using POST) How do I do this?, ive found out how to create a pdf, but not how to load one from server. thanks. ...

How do I lock access to a file when a user has it open?

I'm writing a C#.NET program which uses XmlSerializer to serialize and deserialize the project the current user is working on to and from an XML file. This is working fine, but I'm trying to figure out a way to prevent two users from opening the same file off a network drive and having one user overwrite the previous user's save. I essen...

Is it possible to debug the system .NET DLL's as unoptimized?

I'm trying to debug some code in the .NET Framework. Unfortunately, many of the variables are optimized away, and I can't reliably set the instruction pointer due to flow optimizations. Is it possible to force the runtime to NOT use the ngen'd versions of the .NET system DLL's, but instead use the MSIL, forcing optimization to 'off'? N...

What is the actual benefit of ADO.NET Entity Framework?

I was reading this article about ADO.NET Entity Framework and found it to be very interesting though in the first shot I could not decipher many things. I am reading the article again in order to fathom the real logic behind this. a) A question cropped in my mind is why we need an ORM framework (in general)? b) And among other ORM fra...

Finding the string excluding the html tags.

Can I get the string without the html tags which will be displayed on the webbrowser control ? Like I have String str = "html hello html" then I want to find the string like hello. How can I do that? ...

ASP.NET - Best practice for setting value of SqlDataSource Parameter from a QueryString value @ Page Load?

Let's say we have a value coming in through the URL of a page. Example: www.test.com/page.aspx?&Key=Val. Val is retrievable through Request.Querystring("Key"). Is there an accepted best practice for assigning a QueryString Value to a parameter of a SqlDataSource defined on an ASPX page? Options that I know of: Do not include paramete...

Charting a line graph enabling variable number of data series.

I have been trying to get the Silverlight charting toolkit to allow me to have a variable number of series based on the data. A single line graph is easy you have two data points in my case NumberOfDays is the X axis and CountOfItems is the value to be graphed. Now I want to be able to say Product 1, Day 1, 10 items Product 2, Day 1,...

C# ID3 library that supports custom fields

Currently i'm using TagLib Sharp as suggested in one of the posts @stackoverflow for reading id3-Tag out of mp3, flac, ogg and similar multimedia files .. now i just realized, that id3v2 (maybe even v1) supports custom tags but i can't find the implementation for reading/writing custom tags in TagLib Sharp. Does anybody know of a librar...

Setting up a scheduled task in .Net

I've read a few posts here on StackOverflow about task scheduling, but I'm not sure that I get it right. I'm coding (in VB.Net) a backup application, that I'd like to add as a scheduled task (in fact, I'd just like to let the user decide to run it every day at, for example, 3 AM). I've read posts suggesting to use a windows service for ...

ScriptManager does not honour LoadScriptsBeforeUI property when set to false

Hi, I am having some performance problems with IE 7, whereby the page pauses during rendering while scripts are loaded, this is at times taking up to 5 seconds and leaves the user with a blank screen while he/she waits. After a process of elimination I have deduced this is because of the scripts emitted by the asp.net ScriptManager cla...

why .net assemblies differ for different architectures?

I can build my C# project for x86 and for x64. Why? I thought it generates a special code which is not platform specific at all. ...

UITypeEditor and readonly reference type properties in .Net, WinForms

I thought I had type editors and converters nailed until I tried to persist a Readonly Reference type property after editing it in a UITypeEditor. In my UITypeEditor, because I'm working with a read only property, I'm careful to pass back the original value (after updating the relevant sub property). This change is reflected immediatel...

How to style different items differently when using data template in xaml?

I would like my elements generated from datatemplate to look differently depending on some properties in the model. For example I want to display the text in various colors or present different images or path drawing for each generatred element. I know how to do it in general, but I'm looking for a solution that would allow editing the v...