.net

WPF slow to start on x64 in .NET Framework 4.0

I've noticed that if I build my WPF application for Any CPU/x64, it takes MUCH longer to start (on the order of about 20 seconds) or to load new controls than it does if started on x86 (in release & debug modes, inside or outside of VS). This occurs with even the simplest WPF apps. The problem is discussed in this MSDN thread, but no ans...

Where are Silverlight assemblies stored when a xap file is run?

We currently have a XAP file which contains Foo.dll, and another XAP file (with a completely different name) which contains an updated version Foo.dll (but the same version number). When we run the second XAP file, it looks as though the Silverlight runtime on the client, is picking up the old version of Foo.dll from the first XAP file....

.NET Class Loader - What is it?

I can't find any good documentation on what the concept of a Class Loader is in the .NET Framework? What is it? Where can it be found? Does anyone know? ...

Targetting x86 vs AnyCPU when building for 64 bit window OSes

I have an existing C# application written for .NET 2.0 and targetting AnyCPU at the moment. It currently references some third party .NET DLLs which I don't have the source for (and I'm not sure if they were built for x86, x64 or AnyCPU). If I want to run my application specifically on a 64 bit Windows OS, which platform should I target...

How to catch exception in the main thread if the exception occurs in the secondary thread?

How to catch exception in the main thread if the exception occurs in the secondary thread? The code snippet for the scenario is given below: private void button1_Click(object sender, EventArgs e) { try { Thread th1 = new Thread(new ThreadStart(Test)); th1.Start(); } catch (Exception) {...

validating the mobile numbers

I need a regular expression to validate the mobile number up to 9 digits, if the telephone number starts with 8 otherwise 10 digits needs to be entered. The numbers must start either with 9 or 8 with above criteria. ...

.net: How to execute a stored procedure with a nullable parameter in c#?

How to execute a stored procedure with a nullable parameter in c#? EDIT: Actually, I've written below code. As you can see, status parameter is a nullable value type. Is it correct? or not? public void LoadAll(DataTable tb, int? status=null) { try { using (SqlConnection connection = new SqlConnection()...

Problem sending email with IIS6 and PickupDirectoryFromIis

I'm looking after a legacy .NET console application that sends out email on a Windows Server 2003 box; we've just migrated it to a new server, and now attempts to send emails are erroring. The code in question is: SmtpClient smtpClient = new SmtpClient(this.SmtpServer); smtpClient.UseDefaultCredentials = true; smtpClient.DeliveryMeth...

How to publish internal data to the internet - as simple as possible

We have a .net 2-tier application where a desktop program is talking to a database. We support MS SQL Server 2000, 2005, 2008 and Oracle 9, 10 and 11. The application is sold, not as shrink-wrap, but pretty close. It is quite important for us that the installation and configuration is as easy as possible as installation instructions are...

C# .Net Serial DataReceived Event response too slow for high-rate data.

Hi, I have set up a SerialDataReceivedEventHandler, with a forms based program in VS2008 express. My serial port is set up as follows: 115200, 8N1 Dtr and Rts enabled ReceivedBytesThreshold = 1 I have a device I am interfacing with over a BlueTooth, USB to Serial. Hyper terminal receives the data just fine at any data rate. The data ...

One-click web site backup with asp.net

Hi, I want to backup my web site regularly but instead of backup my files via ftp program I want a one-click solution which will copy all my files and zip them and allow to download. Can this be done with asp.net at same web site or I have to write a .net app for this purpose? ...

WPF Image / Rendering Event

I am using an Image control to display documents: <Image x:Name="cImage" SnapsToDevicePixels="True" ... /> Because it takes about half a second to display the image on the screen I first display a preview with: RenderOptions.SetBitmapScalingMode(cImage, BitmapScalingMode.NearestNeighbor); cImage.Source=...; Then I set a timer to ch...

wcf service not showing Publish option Why?

Hi all, I written one WCF service after that i am trying to Publish(after Build) this service. But solution not showing Publish Option and also not creating any .svc file in the solution why? Thanks in advance. Regards, Rajesh ...

.NET (System.Net.Email) - Issues when sending email out

Experts, I'm having issue when sending emails out. Currently, I have a feedback form that supposed to send an email to the support email. For whatever reason, I never received any email from the app and the funny thing is when I changed the support email to my gmail, hotmail, or Yahoo account, I received it. The support email is active ...

Using IKVM to convert a JAR (Flying Saucer - xhtmlrenderer)

I wanted to use the Flying Saucer Java API in .NET so I tried to use IKVM to convert the Flying Saucer library: ikvmc core-renderer.jar For some reason, IKVMC gave me an exe core-renderer.exe so I renamed it to core-renderer.dll, added to my assemblies and hacked away using java.io; using java.lang; using com.lowagie.text; using org....

Synclock a section of code while waiting for ShowDialog to return

I'm having trouble working out how to lock my application out of a section of code while it waits for a response from an external program I've used Synclock on a section of code with the Me object in the expression. In this Synclock I call an overridden ShowDialog method of a dialog box, which has a timeout parameter, but does return th...

Replace text in code with counting numbers

Due to testing and time measuring I have to write some kind of log into an existing C# Winforms project. I want to minimize change to the application, so I'm limiting my question to replacing text by counting numbers: I want to pass a line: Log.WriteLine(position) many times in the code and then replace "position" with numbers start...

How can I manipulate a VB6 Collection in .NET?

Hello all, I am currently in the process of designing an interface for .NET software that would be consumed by COM objects - specifically, VB6. While I have found a number of pages by Microsoft detailing how to make an COM-interoperable interface, I am currently tripping over the use of Collections in design time: I would like to be ab...

validating mobile no

validate the mobile number up to 9 digits, if the telephone number starts with 8 otherwise 10 digits needs to be entered. ...

What block is not being tested in my test method? (VS08 Test Framework)

I have the following code: private void SetControlNumbers() { string controlString = ""; int numberLength = PersonNummer.Length; switch (numberLength) { case (10) : controlString = PersonNummer.Substring(6, 4); break; case (11) : ...