.net-3.5

Causes for web service memory leak

We have a web service that uses up more and more private bytes until that application stops responding. The managed heap (mostly Gen2) will show some 200-250 MB, while private bytes shows over 1GB. What are possible causes of a memory leak outside of the managed heap? I've already checked for the following: Prolific dynamic assembli...

What do I need to change to alllow my IIS7 ASP.Net 3.5 application to create an event source and log events to Windows EventLog?

ASP.Net 3.5 running under IIS 7 doesn't seem to allow this out of the box. if (!EventLog.SourceExists("MyAppLog")) EventLog.CreateEventSource("MyAppLog", "Application"); EventLog myLog = new EventLog(); myLog.Source = "MyAppLog"; myLog.WriteEntry("Message"); ...

Correct way to Handle Exceptions in UserControl

Hi all, I'm build an UserControl and I'm not sure how to handle exceptions, the Control itself is not very complicated, the User chose an image from disk so they can authorize it, I don't know exactly how the control will be used so if I use a MessageBox I might block the application, and if I just re-throw it I might crash it. thanks i...

Submit changes of only one entity

If I select many rows from one table with one instance of DataContext. And then do I some changes in properties in the rows, can I submit changes to database only for one of the selected rows? ...

Entity framework: One big model or a set of smaller models?

We been having some discussions on approaches to using the entity framework at work recently. We have a fairly large and complex n-tier web based application, which is due for a major overhaul. The question is: If we where to starting using the entity framework, would it be better to create one big model, or a set of smaller functional/...

What is causing ObjectDisposedException from SerialPort while debugging .NET winform?

Vista SP1 Visual Studio 2008 SP1 .NET 3.5 SP1 C# I have a winforms app I'm playing with that uses a SerialPort object as a private variable. When the application is compiled and executed, it works great. It also works running in debug mode wihtout any breakpoints. 90% of the time when I stop at a breakpoint and try to step through code ...

How to avoid FileNotFoundException if .NET 3.5 is not installed?

If you try to launch a .NET 3.5 application on a Windows computer which does not have this version of the .NET framework installed, you get a FileNotFoundException for some system assemblies (for example System.Core 3.5.0.0). Is it possible to catch this exception and tell the user to upgrade their .NET framework or is it thrown too ear...

Producer consumer pattern when many products

Hi, I have a producer-consumer pattern working for one product. What is the best implementation when the producer produce many products? For example a DataBaseEvent, GuiEvent and ControlEvent that the consumer shall consume. The code below shows the pattern for one product (a DataBaseEvent). Should each event type be enqueued on an own q...

Applying PixelShaders on offscreen Bitmaps

hi there, i'm currently experimenting using PixelShaders introduced with .net 3.5 sp1 to improve image processing performance. everything is much faster , but til yet i just had effects applied to some elements in my wpf forms, that i actually want to avoid. we have a bunch of image processing functionality and i'd like to replace some...

Where is the copy local option?

I'm trying to add dll references to an ASP.NET 3.5 project(Web Forms not MVC), and all of the references I'm adding keep showing up as auto updating. I right clicked on the dll in the bin folder to specify copy local, but the option isn't there. I went back to one of 2.0 projects, and I have plenty of dll's that aren't auto updating, b...

How to get the best performance from LINQ querying several rows in a table

my goal is to get lots of rows from a translation table. I use an ID to get a subset of the table (say 50 rows) then I use another ID to the rows I want from this subset. Using typed datasets I do the following to get the main dataset: funderTextsDS.tbl_funderTextsDataTable fd = (funderTextsDS.tbl_funderTextsDataTable)(new funderTexts...

How do you find only properties that have both a getter and setter?

C#, .NET 3.5 I am trying to get all of the properties of an object that have BOTH a getter and a setter for the instance. The code I thought should work is PropertyInfo[] infos = source.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.SetProperty | BindingFlags.GetProperty); However, the results in...

.NET 3.5 chart controls exception: Error executing child request for ChartImg.axd

Anyone getting this error when using the new free chart controls MS bought from Dundas? "Error executing child request for ChartImg.axd" On the MSDN forum they suggested it was my web.config: MSDN forum post So far that hasn't fixed the problem though. Any other ideas? ...

Using an interface to convert an object from one type to another?

Suppose I have two classes with the same interface: interface ISomeInterface { int foo{get; set;} int bar{get; set;} } class SomeClass : ISomeInterface {} class SomeOtherClass : ISomeInterface {} Suppose I have an instance of ISomeInterface that represents a SomeClass. Is there an easy way to copy that into a new instance ...

MFC built using /clr compiler option - CString/System::String conversion

I've got a fairly large MFC application that has just been migrated from VS6.0 to VS2008. It was a pretty painful process, but now I'd like to explore any managed-code options that may be available. I was able to successfully build the project using the /clr switch which seems to give me access to managed types. I'd like to know if con...

Which method performs better: .Any() vs .Count() > 0?

Hi folks, in the System.Linq namespace, we can now extend our IEnumerable's to have theAny() and Count() extension methods. I was told recently that if i want to check that a collection contains 1 or more items inside it, I should use the .Any() extension method instead of the .Count() > 0 extension method because the .Count() extensio...

Is there a way to have a click-free install of .NET 3.5 SP1?

Basically I want to have our installer also install the .NET framework and any other pre-reqs as neccessary will minimal user interaction, so ideally, just run, accept license agreement and everything else is taken care of automatically. Is this possible? Using WiX most likely with a bootstrapper or some sort. ...

System.Speech.Synthesis installing alternate language voices

The .net framework 3.5 (or vista) provides me with an English voice (David I think) to use with the Speech.Synthesis api. I need a french voice to use with a french dictation practice app I am building for my kids to use to improve their french spelling. The api allows me to change culture when creating a voice, but the default English v...

Generate .Net objects from known XSD

I have some XSD-s that define my objects hierarchy. for example math.xsd, base.xsd while math.xsd is depends on base.xsd. I need to generate classes from those xsd-s. I've already read about those two tools: CodeXS tool and XSD.exe. the problem with the xsd.exe is that I didn't succeed generating classes from two xsd-s that depends on...

Migrate VB.NET 2.0 Winform to 3.5 WPF

Is it possible to migrate a VB.NET Winform solution to a 3.5 WPF solution. If so, any suggestions how to do it? Thanks in advance! JFV ...