.net

How to change location of app.config

I want to change the location where my application looks for the app.config file. I know that I can use ConfigurationManager.OpenExeConfiguration() to access an arbitrary config file - however, when the .Net Framework reads the config file (for ConnectionStrings or EventSources, for instance), it will look at the default location. I ...

How to omit XML element in C# XML generated from XSD?

Minoccurs is 0 in the XSD and nillable is true for an element. But if I don't set the element value, it takes it as null and the record is blanked out on the server. Is there a way to tell it to omit the element from the output XML when some conditions are satisfied but have it for other cases? <xs:element name='CLS_CD' minOccurs='0'...

IIS 7 impersonation and identities

I'm trying to get used to II7, having worked with IIS6 for quite some time. In IIS 6, I'd set <identity impersonate="true"/> in the web.config, and make sure that I applied the correct NTFS permissions to the IUSR_[MACHINENAME] account if a folder required more than read permissions. In IIS 7, I'm having trouble duplicating this setup ...

Debug .NET HttpWebRequest

Visual Studio 2010 .NET 3.5 Is there any tool that can trace the http request/response that send between my web application to the remote server? I use Wireshark or Fiddler, but both seem not so fit. Please advise, thanks. ...

Custom exception handling in WCF Service and Client

What you think about this approach: Fault helper: [Serializable] public class WcfHwServiceFault { private readonly Guid _guid; private readonly byte[] _data; private WcfHwServiceFault(Guid guid, byte[] data) { _guid = guid; _data = data; } public static WcfHwServiceFault Create(Exception ex) ...

Bezier curves algorithm - maybe Canonical Splines?

I've got a path that is made up of multiple points - i.e. 0,0 0,50 50,50 70,20 If I just draw this line on the screen it looks quite harsh as it puts a sharp angle at the joining of each point. Hence I was wondering what the bezier curves algorithm/method would look like which I could call that automatically change the sharp angles ...

Solve: XML Schema validation ignored when fragment-level conformance is enabled?

From my sojourn with XML and Schema validation, it seems that when fragment-level conformance is enabled for an XMLReader instance, the XML source stops being validated against any included Schemas. However I cannot verify this from the MSDN documentation as it doesn't seem to describe XSD Schema behaviour in light of conformance level...

How to host a terminal session (mstsc) in a WPF applicaiton?

There are some tools out there for managing multiple terminal (mstsc) sessions. How would I go about achieving something similar in WPF? ...

var keyword runtime or compile time?

var keyword gets the type at the runtime or compile time? or depends? ...

MySQL connector EF stored procedure

I have the following stored procedure: CREATE PROCEDURE GetSequenceNextValue(IN sequenceName VarChar(100)) BEGIN UPDATE Sequences Set currentValue = LAST_INSERT_ID(CurrentValue + 1) WHERE name = sequenceName SELECT LAST_INSERT_ID(); END But when I update my model, this procedure is not imported even into storage model. ...

How to wait for a file to be copied completely?

I have a thread which polls a folder for new files. The problem is that it sees a new file and starts working on it even before the file has been completely copied by another process. Because of this the poller gets file used by another process error. Is there a way to check the file is free to use or get notified? We can certainly use ...

What are my options to merge PDFs in a web site or web service environment?

I have multiple PDFs coming from a report generator and I want to merge them to a single document. The merging process must run in a web site or WCF web service environment (Framework 4.0, IIS 7.5). Is there a component, open source or commercial, to accomplish this? In my process I get the PDFs as streams. If I have the choice, I would...

Aspect Oriented Logging with Unity\T4\anything else

Hello, In my application we have a trace logger. We have log statements added at the beginning and end of most of the important methods tracing the method name and the parameter values. Now these trace statements are bloating the code and it is a bit of a pain to read through them. I am considering how can I separate this aspect of the...

Check if application is running or not

Hi, I am using innosetup to create installation for my windows application. Before starting installation i need to check whether application is already running or not. I have used the following code, which is not working properly. const WM_CLOSE = 16; Function InitializeSetup : Boolean; var winHwnd: longint; retVal : boolean; ...

Need help regarding AspNetForum

I want to include this forum as one module in my website..Now the website's got it's own DB with users table, login info and stuff..and this forum software too got just the same.. What I want is that when user logs into to the website, he logs in to the forum as well um..how do I like merge/relate the two DBs so a user doesn't need to l...

Generate report slideshow from .Net

I need to create a simple slide with text and pictures. This will be done from a .Net 4.0 application. I'm open to various formats. I could target PDF, XPS, or PowerPoint for example. My highest priority is that I can get up and running quickly. What API's can you recommend? Note, I am entirely unconcerned with document or vendor p...

How can i select some id with xx-xxx-xx-x format?

I need to change below data A320-ZL-522-01-1(2) A320-ZL-531-01-1(1) A320-ZL-531-01-1(2) A320-ZL-531-01-1(1) A320-ZL-531-01-1(2) to ZL-522-01-1 ZL-531-01-1 ZL-531-01-1 ZL-531-01-1 ZL-531-01-1 Can I do it with LINQ using RegEx? public class MatchCTallyToCross { public List<string> Get(string CustomerNumber) { IEngMan...

Evidence for sealed class performance benefit.

My team is wrestling with the sealed class debate internally and I would like to simplify the debate down to a matter of design and get the performance myth off the debate agenda. Can anyone post some code that demonstrates a performance boost introduced by declaring a class as sealed? At 20 million virtual method calls per second I can...

How to capture the standard output/error of a Process.start()?

How does one capture the standard output/error of a process started by a Process.start() to a string? ...

BackgroundWorker

Possible Duplicates: backgroundthread How do i add values to my list box while my background proccessing is going on? by list i mean a list Box.i am collecting the file names in a array list object and put the same in list box but not in the completed work of BackgroundWorker,i want to show the files in the list box immediat...