.net

Can you SSL one page in an a .NET application?

Can you have one page in a .NET application that is https but the rest be http? For instance, just the login page? Does this take extra setup in the application or is it just as simple as an IIS setting? ...

C# app - How to move all resources out of the main assembly

For my C# apps I need to have default/neutral resources placed in a sattelight assembly, such that the output of a build looks like: MyApp.exe -AND- MyApp.resources.dll <- containing default/neutral resources How can I accomplish this using VS2008 and .NET runtime 2.0 or greater? Secondary question: How to keep the resources in the exe, ...

Running Legacy, Non-Reentrant Code on a Background Thread in .NET

I'm in needed of a thread worker in my .NET application - .NET has several classes such as thread pools etc., but I can't find anything that runs on a single thread, which is a requirement in my case. So I've had a go a writing one myself, but these things are notoriously tricky, I'm sure I've got something wrong. Can anyone improve it ...

WPF - Static Linking of DLLs

I have a WPF app that I want to send to others so they can use it. I have several 3rd party dlls that it uses. For ease of installation I would like to have one exe that just runs. Is there a way with WPF apps (and C#.NET in general) to say "Link in the DLL files"? (I am using visual Studio 2008 SP1.) ...

Efficent use of OnPaint

I am programming in Visual Studio .Net and using C#. I am creating my own control that draws a wave based on values I get from an analog to digital converter (ADC). I take the incoming points and convert them into X and Y points to properly draw the graph in my control. I have a loop inside my OnPaint method that goes through all the ...

Linq, Map List to CheckboxList

If I have a List(Of Guid) can I map those Guid's with a single Linq expression to a CheckboxList of values? ...

Missing Project Templates in Visual Studio (after reinstall)

I uninstalled VS2008 Pro and installed VS2008 Team Suite. Now I missing all the Windows Project types. Console, WinForm, and WPF. These projects are missing for C# and VB.NET. I choose Full install. I still have templates for Silverlight and MBUnit (I assume from Silverlight SDK and Gallio installs) Before I do a simple uninstall / re...

Single RegEx to parse this log format?

Hello, I am trying to wrap my head around the feasability of parsing a log file with a single RegEx in .NET What is making it difficult is the log file has items that can (but don't always) span multiple lines and that each log file may actually contain multiple 'logs'. Example format: log: event 1 event 2 additional in...

How do I convert an ascii character 254 in c# to something else?

I am pulling data from a database that uses ascii character 254 as a delimiter. I want to replace that with a new line. I tried this: rec = rec.Replace(char(254), Environment.NewLine); This isn't working though. ...

Rhino mocks naming expectations

My object under test has two dependency objects of the same type. Sometimes when a test has a failed expectation, it's not clear which dependency object set that expectation. Is there some way to give the dependency objects names that will appear in the error messages so that I can tell them apart? Here's an example: MockReposi...

Nested complex-type elements never get populated when calling AXIS-based web service from .NET

I've been trying for a couple of days now to get a .NET client working fully with a Web Server provided by my Coldfusion-based web app. I'm not a .NET developer, per se, but I happen to have a copy of VS 2003, which seems like it should do the trick. I can use a simple multiplier() method in my web service that takes two numbers and ret...

How do I turn a .NET System.String into a string usable by VBScript?

I'm trying to call a .NET component using interop from a classic ASP page (VBScript). If a .NET function returns a "System.String", is there a way for me to use that as a VBScript string? Is there something I need to do to convert it? ...

Running SQL Azure as a Cluster Node

Seeing as to how I can't find anything at all about it on the interwebs, I suspect that the answer is no, but I figured I'd ask... Does anyone know (for certain) if you can run SQL Azure as a node in a cluster of servers? Essentially, we've invested in a SQL server and are looking at adding another node to the cluster. However, it would...

Sql Server Reporting Services (SSRS) or Microsoft .net 3.5 Chart Controls

Under what circumstances would you use SSRS rather than Chart Controls? I'm trying to determine if it makes sense to use reporting services to produce charts for a .net project, but I'm not sure about the learning curve, potential benefits, potential drawbacks. The only benefit I can immediately see is the ability to setup reports to b...

Is there .NET component which can convert XLS to password protected PDFs?

Hello, Is there .NET component which can convert XLS to password protected PDFs? Thank you in advance. ...

How to make a Type known in one AppDomain, but unknown in another?

Dear ladies and sirs. My question is simple. For unit test purposes, I need a statically compiled type deriving from the Exception type, which is known in one AppDomain, but unknown in another. A straightforward solution would be: To create a subfolder under the directory of the application executable. Place there an assembly with so...

Do I have a memory leak in my WPF Navigation?

I'm looking through a WPF application looking for a memory leak (using ANTS Memory Profiler 5.1) and I keep seeing some pages and controls taking up memory when they shouldn't be. So I go to the Object Retention Graph and to see what is keeping them around, and I keep seeing this for every page: The thing is, I have KeepAlive set to ...

Can't draw on Internet Explorer

I have the following code which draws a square on the main window of another process: private void DrawOnWindow(string processname) { IntPtr winhandle = GetWindowHandle(processname); Graphics grph = Graphics.FromHwnd(winhandle); grph.DrawRectangle(Pens.Red, 10, 10, 100, 100); } private IntPtr GetWindowHandle(string windowNa...

Exception subclass for Bad Object State?

I'm a moderate fan of using Exception subtypes to help describe the problem that caused the exception. For instance, let's say that I'm writing a method that does not allow int values greater than 100 to be passed in as arguments. I'll often start the method with a condition to guard against this, and throw an exception if it occurs. I'l...

Help Linqifying collection to Dictionary

I'm refactoring this code and was trying to think of a simple linq expression to populate this Dictionary. IEnumerable<IHeaderRecord> headers = PopulateHeaders(); var headerLocationLookup = new Dictionary<string, IHeaderRecord>(); foreach (var header in headers) { //destination locations can repeat, if they do, dictionary should only ...