.net

How to install Windows service without extending Installer?

I am building a reusable framework for building scheduling services using the .NET Framework. My code is distributed as a library, which is then referenced by the user in a console application. In the main entry point of the application, the user is asked to transfer control to a static method in the library, which will commence job sche...

How to discard (reset) process.standardoutput in .NET?

Any ideas on how to discard or reset the contents in a Process.StandardOutput, so we can discard the message of the day and any other initial content of a process? ...

What is a good approach for a Data Access Layer?

Our software is a customized Human Resource Management System (HRMS) using ASP.NET with Oracle as the database and now we are actually moving to make it a product that supports multiple tenants with their own databases. Our options: Use NHibernate to support Multiple databases and use of OO. But we concern related to NHibernate learni...

When does a db transaction written in ADO.NET actually begin?

One of the key things in database-intensive applications is to keep the transactions as short as possible. Today I was wondering when this transaction would actually begin: using (SqlConnection sqlConnection = new SqlConnection(connectionString)) { sqlConnection.Open(); /*(1)*/ SqlTransaction sqlTransaction = sqlConnection...

Why WCF needs DTC for transaction flow ???

Hi, I wonder why WCF needs MSDTC configured and started on both client and server, when I use transaction flow. (with network access enabled) After all, transactions in WCF are managed though SOAP messages using WsAtomicTransaction... So why in the hell the two DTCs need to communicate with each other ? Thanks for your response. ...

.NET reflection question

Hi, The following code (packaged in a 'Console Application' Visual Studio project): using System; using System.Collections.Generic; using System.Text; using System.Reflection; namespace TestReflection { class Program { static void Main(string[] args) { bool found = false; foreach (Assemb...

How to get SVN directory size using sharpsvn?

i am reading svn contents using GetList method of svnClient class, i want to know how can i determine the full size of directory including sub directories, i can read the size using FileSize property of SvnListEventArgs. ...

Enum to Int. Int to Enum . Best way to do conversion?

public Enum Days { Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6, Sunday = 7 } Now I wanted to know how do I get the integer value of an enum and convert an integer value into enum Will int dayNo = (int) Days.Monday; change the value of dayNo to 1; and Will ...

What is the BCL equivalent of GetValueElseAdd in PowerCollections

In Wintellect's PowerCollections, there's a GetValueElseAdd which works like this: if ( collection.GetValueElseAdd( key, ref value)) { // just added, value unmodified } Or // factory method only gets called if the key is not present. if ( collection.GetValueElseAdd( key, out value, () => thingFactory.CreateNew())) { // just a...

How to UploadFile to web server without creating a file?

I have to upload dynamically created data file to web server. One way to do that is to create a temporary file dump data to that file, and then use WebClient.UploadFile to do work. But how to do that without creating a file? ...

Testing that serializable attributes are set

I'm writing a unit test to verify that the serializable attributes are set on my class. I thought I was on the right way, but for some reason I can't find the attribute types. Here is my class: [DataContract] public class User { [DataMember] public int Id { get; set; } } And a unit test for checking the attributes: [Test]...

How to produce an HTTP 403-equivalent WCF Message from an IErrorHandler?

I want to write an IErrorHandler implementation that will handle AuthenticationException instances (a proprietary type), and then in the implementation of ProvideFault provide a traditional Http Response with a status code of 403 as the fault message. So far I have my first best guess wired into a service, but WCF appears to be ignori...

Win Form app controls turn Black and app locks up when minimized too long

I have a Windows Form desktop CRUD application. The users are finding that if it sits too long minimized all the Controls turn to Black Filled Boxes and it becomes unresponsive. This is my first large app and I am having trouble even figuring out WHERE to start on this. Searching the Web for 'Black Filled Boxes' hasn't been real produ...

Linq to SQL: How to get values added thru InsertOnSubmit but before SubmitChanges?

Hi, Having trouble getting this. I need get the values that I have added to a table entity through the InsertOnSubmit method. However I have not yet invoked SubmitChanges on the table. So, I have this in a loop: mdmDC.tblMDMListItems.InsertOnSubmit(listItemsTable); But I'd like to query mdmDC.tblMDMListItems for some values entered so...

Visual Studio 2008 and Oracle 10g

At work we have just started developing in C#.NET using VS2008 and we need to connect to Oracle databases. The problem is that we are still using Oracle 10g servers and Oracle provide four install options: Install the Oracle 10g DAC with tools for VS2005 / VS2003 Install the Oracle 11g DAC with tools for VS2008 Install Oracle 10g DAC ...

Is there a concept or implementation similar to java RMI in dot net (C#) ?

Is there a concept or implementation of RMI like concept in .net? Can we program network programming in C#/VB just like RMI in java? Such as stub,skeleton,registry like concepts. ...

BizTalk low latency - response time issue calling C# to WCF-Published-Orchestration

Calling a WCF published orchestration from a C# program usually is sub-second response time. However, on some occasions, it can take 20-50- seconds between the call in the C# program and the first trace message from the orchestration. The C# that runs calls the WCF runs under HIS/HIP (Host Integration Services/CICS Host-Initiated Proce...

How to Develop a Public API Object Model In a WPF Desktop Application That Allows For Out-Of-Process Automation From Another .NET Desktop Application

We're developing a large desktop application using Windows Presentation Foundation. Currently, the application is for internal use but will eventually be sold as a commercial product. I'm currently using a variation of the M-V-VM design pattern to keep as much code out of the UI components (i.e. windows, user controls). I know at some po...

Is there anyway to reset webclient?

Im experiencing problem with webclient to parse some very sensitive webpage. Somehow, webclient failed to do some task, and i dont even know why, no exception, no error, just simple not working (this is not the problem from the site) I run webclient in a loop, however, only the first request was success, all the next requests are failed...

WebClient AsyncUpload progress percentage always returns 50%

i am using Webclient to upload data using Async call to a server, WebClient webClient = new WebClient(); webClient.UploadDataAsync(uri , "PUT", buffer, userToken); i've attached DatauploadProgress and DatauploadCompleted Events to appropriate callback functions // Upload Date Progress webClient.UploadProgressCh...