.net

How can I profile serialization overhead in my application

My application has a WCF service tier between the front-end and the database. Since we currently host in IIS6 we are using SOAP over HTTP. How can I find out how much real world time I am spending doing serialization activities in my application? ...

Constantly repeating timer in an asp.net ajax page

Today I had my first test with the ASP.NET AJAX Timer Control, in hope that it would allow me to constantly keep updating my site. At the moment, it just updates once; this does not match the behavior of the previous .NET timers. Was the AJAX Timer control only made to update an item once? Or do I need to use another framework? ...

Validator for type strings?

Anyone know if there is already a validator for "type" strings? I want to make sure that the type attributes in my custom config are one of the following: type="TopNamespace.SubNameSpace.ContainingClass, MyAssembly" type="TopNamespace.SubNameSpace.ContainingClass, MyAssembly, Version=1.3.0.0, Culture=neutral, PublicKeyToken=b17a5c5619...

Is there a way to log or intercept First Chance Exceptions

Short of using a profiler, is there any way inside a running program to detect first chance exceptions? Ideally, I would like to record more detailed state information that is not available once the catch block has taken over the final exception. ...

Why would a typebuilder spit out two .ctor methods?

I have a typebuilder that is generating two identical .ctors one that is has no method body and the other that has all the init code. I am defining a field from another type and a property to access the type and therefore need to init it in the .ctor Where should I start looking Code as follows Public Sub ctor(ByVal type As TypeBuild...

SQL custom functions in Enterprise Library

Is there a way to execute SQL custom functions with Enterpise Library? I've tried Database.ExecuteScalar() but for some reason it returns null. This is my function: Database db = DatabaseFactory.CreateDatabase("ConnectionString"); DbCommand cmd = db.GetStoredProcCommand("FunctionName"); db.AddInParameter(cmd, "Value1", DbType.String, P...

C# - Fill a combo box with a DataTable

I'm used to work with Java where large amounts of examples are available. For various reasons I had to switch to C# and trying to do the following in SharpDevelop: // Form has a menu containing a combobox added via SharpDevelop's GUI // --- Variables languages = new string[2]; languages[0] = "English"; languages[1] = "German"; DataSet ...

Change journal operations in .NET?

I'm looking for the .NET/C# way of performing Change Journal Operations (without importing unmanaged code). Any hints or RTFM-links? ...

Why does adding a project reference break my build ?

solution structure [Plain Winforms + VS 2008 Express Edition] CoffeeMakerInterface (NS CoffeeMaker) CoffeeMakerSoftware (NS CoffeeMakerSoftware) TestCoffeeMaker (NS TestCoffeeMaker) CoffeeMakerSoftware proj references CoffeeMakerInterface. TestCoffeeMaker proj references CoffeeMakerInterface and CoffeeMakerSoftware. Now the thing th...

How should I handle Session timeouts when using AJAX Web controls on an Aspx page?

The following is a question I asked on my blog a few months back but I still haven't got a proper answer to. Then a couple of days ago I was asked if I had the answer so I decided to copy the question in here where it will get a much more exposure by willing-and-able developers. Anyways, here goes... I have been working on an ASP.NET ...

How2 in Configuration Net 2.0: Add element to section defined in different assembly

How could I add a config element in config file in Net 2.0 that would be placed under existing structure that is defined in different assembly? In my case I have some core library that creates root section (and already some other settings) in config file (using company name for name of the root element, section). In other assembly I wan...

What is the best way to get IIS for XP Pro SP2 if you don't have the CD?

I have a work laptop that was purchased new, but it came without the CD. It has XP Pro, but it did not come with IIS installed. This looked to be a good approach: http://ezinearticles.com/?Guide---How-To-Install-IIS-on-Windows-XP-SP2-Without-CD&id=416853 However, I wanted to check here to see if there were alternative solutions tha...

C# to PHP base64 encode/decode.

So I have this c# application that needs to ping my web server thats running linux/php stack. I am having problems with the c# way of base 64 encoding bytes. my c# code is like: byte[] encbuff = System.Text.Encoding.UTF8.GetBytes("the string"); String enc = Convert.ToBase64String(encbuff); and php side: $data = $_REQUEST['in']; $raw...

Bring a window to the front in WPF

How can I bring my WPF application to the front of the desktop? So far I've tried: SwitchToThisWindow(new WindowInteropHelper(Application.Current.MainWindow).Handle, true); SetWindowPos(new WindowInteropHelper(Application.Current.MainWindow).Handle, IntPtr.Zero, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); SetForegroundWindow(new WindowInter...

Website version 2, keep in PHP or move to .Net?

I have a website built in PHP 4 with a framework made by hand by me. The code is 3 years old and I am limited (well it requires a lot of effort to make changes). I decided to do new version of this website. My knowledge has since increased, and now I know that a lot of frameworks exist and that IOC is there and ORM too... The problem is...

Returning a value of type Microsoft.XLANGs.BaseTypes.XLANGMessage

Hi there, Having a problem trying to create a function, as part of a BizTalk helper class that returns a value of type (Microsoft.XLANGs.BaseTypes.XLANGMessage). The function code is as follows: public XLANGMessage UpdateXML (XLANGMessage inputFile) { XmlDocument xDoc = new XmlDocument(); XLANGMessage outputFile; xDoc = (Syste...

Writing a Virtual Printer in .NET

I'm looking to create a virtual printer that passes data to my .NET application. I want to then create an installer that installs both the printer and the .NET application. It would we really nice to be able to write it all in C#, but I have a feeling that this will require a printer driver to be written is unmanaged code. Does anyone ...

.NET training suggestion for an average developer

Some devs in our office need training. They're working on .NET projects and just aren't picking it up very well. (Their backgrounds are in VB6. Yes. In 2008. Go figure.) I've been to a couple training courses in the past, and they've fortunately been very good. It seems like if you have a good instructor (early DevelopMentor .NE...

GraphicsUnit.Point, isn't converting well to PDF... GraphicsUnit.World is, but how can I convert it to Point?

Hello, I have some code in .Net to draw some text content using GDI+. I used GraphicsUnit.Point to size the text. It's working wonderfully on-screen, and even if Print it. I've been asked to make a system that generates a PDF, and I got ComponentOne's PDF control. It has got similar interface to GDI+. The problem is: Font sizes are no...

.net manifest query string

How can I parse the query string (GET / POST parameters) sent to an application's manifest in .NET ? From one application, I am calling MyApp.application which needs to install my .NET application (if not installed) and in any case it should call the application which should parse the GET parameters. Later edit: I have a .NET applicatio...