.net

WCF Problem With Remote use of net.pipe Binding

I'm having an issue with a WCF application that I've written. When both the client and the server are on the smae machine it runs fine, however when I try and run it with the cleint and server on two separate machine (as it is supposed to run) I get the following in exception: System.ServiceModel.EndpointNotFoundException: There was no...

What is an object graph and how do I serialize one

Hi I've been reading lately about serialization. I've read that when I use XmlSerialization I cannot serialize object graphs. What is an object graph and why I cannot serialize it simply? Kind Regards PK ...

How to make a log file with a max size?

I'm logging to a file using FileStream.Write(). When the file reaches a maximum size, I want to delete a load of the logs from the start of the file. What's the best way of doing this? The best idea I've got so far is to create a second file. Write everything I want to keep from the original file into it. Then delete the original file, ...

Is there a way to get a property value of an object using PropertyPath class?

I want to get a value of a nested property of an object (something like Person.FullName.FirstName). I saw that in .Net there is a class named PropertyPath, which WPF uses for a similar purpose in Binding. Is there a way to reuse WPF's mechanism, or should I write one on my own. ...

Turn off Debug Logging in Quartz .Net

I am using Quartz .Net for scheduling some custom tasks in our application. Everything works fine except that it logs about twenty debug entries in one second. I dont know how to turn off the debug logging. Any help would be really appreciated as I have been trying to lookup in the net with no luck. The debug entries look like the belo...

app.config

Hello, for an easiness of my application I would need to have "runtime" element of app.config in separate file. Tried something like <runtime file="runtime.conf" /> and also <runtime configFile="runtime.conf" /> and in runtime.conf I have: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> ..........

Is it possible to get through a Basic authentication proxy using WsHttpBinding?

I am having a problem getting through an authenticating proxy using Basic authentication with WSHttpBinding. Similar code for BasicHttpBinding works. I am guessing that my problem something to do with the fact that I can't set the Security mode of the WSHttpBinding to TransportCredentialOnly.. I can't use BasicHttpBinding because o...

What is the (best) way to handle dates before Christ in C#/.NET?

Is there any built-in support for that? And if not, is there any consensus about handling such dates? Links to owncoded solutions, or fragments of it, are very welcome. ...

Best-Practices: action enum usage for events.

Hello there, I find my self hard to design action enums for events. f.ex making calculation processor. so I should have enum like this ? : public enum CalculatorCoreActions { ProcessStarted, ProcessFinished, ProcessFailure, ProcessFailed, SubstractionStarded, SubstractionFinished, SubstractionFailure, ...

MSbuild Publish to a specific directory using batch file

Follwing is the batch file for doing a publish to a publish directory @echo off start /b C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe /target:publish /p:SolutionDir="C:\cc\ttr\code\Com.IT.sln" /p:PublishDir="C:\cc\ttr\code\deploy\" /p:Configuration=Debug It is not publishing it. ANy idea why? ...

Password Encryption / Database Layer AES or App Layer AES

I need to encrypt / decrypt passwords for a new application. The spec requires me to use AES; can anyone suggest a good reason to either Do all my encryption in the database layer using CLR functions or Doing it at the .Net app layer ? a mixture of db and server Am going to be validation passwords; the app is n-tiered using Telerik O...

Create and drop a database defined using Visual Studio Team System 2008 Database Edition

How do I create and drop a database defined using Visual Studio Team System Database Edition from inside a unit test? (I guess that makes it more of a integration test...) I want to be able to create the database either for each test or for a suite of tests and then drop the database after each test or suite of tests. Is there an API I...

Stop a .net console app from being closed

Is there any way to stop a .NET console app from being closed? I've got an app that follows this pattern: while (true) { string x = Console.ReadLine(); StartLongRunningTaskOnSeparateThread(x); } The problem is that it's possible to close the console window (and therefore cut off the long running task). Is there an equivilent o...

Hosting VisualStudio on a Winform and start it minimized

Hello, I'm trying to embed visual studio as a user control (to enable the user editing a generated source file). Basically most details can be found in a nice CodeProject entry Hosting EXE Applications in a WinForm project. What bothers me is that after launching VS as a new process it takes some time before it settles down on the form....

Difference between ISupportInitialize (BeginInit/EndInit) and SuspendLayout/ResumeLayout

Hello All! Could someone please explain what the difference is between using the ISupportInitialize interface methods (BeginInit/EndInit) and using SuspendLayout/ResumeLayout? Is ISupportInitialize ONLY used during construction/"initial" initialization... or can it be used later when you want to add new child controls to an existing pa...

Mapping NHibernate Many-to-Many

Hey all, I am trying to map a legacy database here and I'm running into a problem. In my schema I have a concept of Modules and a concept of Variables. Each Module consists of one or more Variables and each of these Variables has properties specific to that Module. A Varable sits on a Relation. Based on the classes below what is the b...

ASP.NET check on thread status on long running thread?

I have a situation where user requests to do a long running process. I planing to start it on another thread in code-behind and return message to user "processing". Then every couple of seconds or so I will poll(via asynch call) the thread for its status. When thread is done I want to show success message. Question, how do I poll a ...

Publishing a website using msbuild

Hello, I would like to publish a website using msbuild. Since I have a website and not a web application project, how can I go about this since I do not have the .csproj file and msbuild expects a project file as input or you can execute it in a folder with a project file. My solution file contains multiple websites that do not have .cs...

Create COM Surrogate server (exe) in C#

I know how to create a COM DLL (a Class Library) in C#. Is it possible to create a COM Surrogate EXE using C#? This would be a standalone server capable of launching and hosting COM objects, which would then be accessible to COM clients. ...

extjs for application (with embedded http server as well).

Hi, Is there a framework which allows easy adding of ExtJS to a normal .Net application. This way I only have to create a GUI once, which is then accessible through an embedded webserver. This is great since I then can remote access the server/service/application as well as fiddle with it locally. My dreamsolution would be: - The fram...