.net-3.5

Really tough one... Windows Service throws System.BadImageFormatException on server 2008, x64, .net 4 migrated from 3.5

I'm really hoping someone's seen this before, because I'm dying on this one. I have tried compiling the service exe as AnyCPU, x86, and x64 It works on my win 7 x64 box I'm installing with installutil, the .net 4 version When I start the service, I get an error. It says nothing, but does point to which modules are loaded. Those of ...

Add something like ShowDialog to a custom User Control?

When a user selects a button a custom user control is added to the form. This user control provides the ability to enter in some values. How do I wait for the user control to complete before changing the value on my main form? I was thinking of something like this: customControl ylc = new customControl(); ylc.Location = new Point(11,...

Can I use System.Core.dll/System.Collections.Generic.HashSet in powershell?

I'd like to use a HashSet in a powershell script. I think I've figured out how to instantiate generic collection objects by doing: [type] $strType = "string" $listClass = [System.Collections.Generic.List``1] $listObject = $base.MakeGenericType(@($t)) $myList = New-Object $setObject This works fine for lists and dictionaries, but when ...

.NET framework 3.5 vs. prior versions?

Does .NET framework 3.5 include all prior versions? ...

Why wss 3.0 dosen't display image properly?

Hi, I have my own custom webpart. Inside this webpart I would like to display transparent gif. Unfortunately it dosen't do it. I was tryign to use html img tag or asp.net image tag. Src property for the image is set properly because it displays image icon insted of "X". X would be proof of the wrong path under src. As I said it is alrig...

A free reporting Tool / Way for ASP.NET

Hi , I'm new to reporting world and I need some fairly simple report for printing User profile on Mail Pocket and some other things like that . I'm wondering is there any free way i could go to facilitate doing reporting in my ASP.NET Project ? Thank you ...

Reusing existing templates in custom WPF controls

I am creating a custom WPF control class which inherits from ComboBox. As I am just defining behavior, the exiting ComboBox templates are fine for my purposes and I don't want to created a whole set of templates to support different themes. Is there a way to specify that my control uses the existing ComboBox templates? ...

How to have the special entities like 
 	 in the xml document output while using LinqXml

Hi, I am trying to generate a xml document using LinqXml, which has the "\n" to be "& #10;" in the XElement value, no matter whatever settings I try with the XmlWriter, it still emits a "\n" in the final xml document. I did try the following, Extended the XmlWriter. Overrided the XmlWriterSettings changed the NewLine Handling. Both of t...

Lambda Help Grouping and Summing in C#, need a Func<IGrouping<int, anonymous type, int> or Expression<Func<IGrouping<int, anonymous type>, decimal>>

I'm having a bit of trouble doing an inline .GroupBy() and .Sum() action. I have a subset of data obtained via a let so it's return type is already anonymous. Hopefully there's enough code in this sample to show what I'm trying to achieve... from r in Repo.R join f in Repo.F on f.ID equals r.FFK let totalB = Repo.B .Join( ...

Can I find to what target .NET dll was built looking into the file?

I have a bit of mess with projects coming some on 4.0 some on 3.5 Is it possible to find out what version of .NET was the dll built looking into the file (not from code!) ? ...

VirtualPath in AspNetCompiler MSBuild Task - does it have to be equal to the final deployed Virtual Path?

This is VS 2008 and .Net 3.5. I use a custom deployment project script which is similar to the publish right-click menu, but which I have customised to do file renaming and various other bits and pieces. It works really well and has drastically simplified the release procedure. I was made aware of an issue on one of our live sites thi...

Getting the .Text value from a TextBox

I have a bunch of textboxes on my asp.net page, and on TextChanged event, I want to run a stored proc to return a Name, based on user input. If I have a block of code like: TextBox t = (TextBox)sender; string objTextBox = t.ID; how can I get the .Text value of objTextBox? ...

How to point out to a method in project to be executed inside a class library component

In the past I had quite some reusable code in my project which I would like to put inside a custom class library project so other projects can reuse it. There is only just one piece of code which needs configuration in code which is project dependent. How can I inject a method to be executed in my project inside a method of the class li...

How to convert Guid[] to String?

Something like String.Join(",", new string[] { "a", "b" });, but for Guid[] var guids = new Guid[] { Guid.Empty, Guid.Empty }; var str = /* Magic */ // str = 00000000-0000-0000-0000-000000000000,00000000-0000-0000-0000-000000000000 ...

Why do extension methods not work with namespace aliasing?

This may be an ignorant question, but I'm unsure why I can not use namespace aliasing and extension methods together. The following example works just fine: Program.cs using System; using ExtensionMethodTest.Domain; namespace ExtensionMethodTest { class Program { static void Main(string[] args) { v...

transform UT8 to UCS-2

Hi, I have recently learned that sql server 2005 does not support UTF8: http://stackoverflow.com/questions/3336992/utf8-problem-sql-server I believe it supports UCS-2 though and look for a way to transform UTF8 to UCS-2 without loss of information if possible. Is it? Any feedback would be very much welcome. Thanks! Christian PS: C#...

Sys.WebForms.PageRequest error

I currently have a page that is erroring out with the Generic code of 500. I am looking for a steps I havent tried or for someone to point me in a direction for a possible solution that I haven't thought yet. This error is generated when an ajax button is clicked. Steps I have taken Check IIS logs, found nothing Check Event Viewer, ...

Stopping a ListBox from reacting to keystrokes without breaking InputGestures for CommandBindings

I want to disable the possibility to navigate a ListBox with the keyboard. My first thought was to set up a PreviewKeyDown handler like so: private void ListBox_PreviewKeyDown(object sender, KeyEventArgs e) { e.Handled = // some logic here ... } Unfortunately this also stops my CommandBindings which are declared in my main window ...

Is there a way to use LINQ query syntax with .NET 3.0 projects?

Hi guys I have a project which can only be deployed on a server running .NET 3.0. I desperately want to use LINQ to simplify some excruciatingly tedious logic. Is there a simple way to accomplish this? I'll settle for any syntax. Thanks a lot ...

Overriding mouse over behaviour in WPF combo box

When the list is dropped down an the mouse hovers over an item in the drop-down list, the item becomes highlighted but the selected value shown in the text box does not change unless the item is clicked. I am looking for a way to modify the mouse over behavior in a control that inherits from ComboBox. I tried overriding function like OnM...