.net

.NET Windows Service - multiple services in one project

Currently, I have a project with a Windows Service. I also created another "Setup Project" which installs the Windows Service. My question is this: Can I add another Windows Service to the same project? (This way, I can use 1 installer, and share some code between the services more easily.) If I can, does that mean when one service e...

How to manage custom settings for a IIS6 hosted WCF service?

I have an wcf service that is hosted in II6. The service uses the server's file system to persist information. Now the persistence directory is hard coded to be F:\PM. How can I use a configuration file to store this directory? How can I access this file with a form application so as to modify it? ...

How to implement SSO (Single Sign On) for a WinForms app and SQL Server

We have a WinForms application that uses SQL server to store its data. To authenticate the application users, we are using SQL Server to do the authentication. The user must have a username/password that exists on the database server to be able to log in. So far so good. Now one of our customers wants us to implement single sign on. T...

When do we do GetHashCode() for a Dictionary?

I have used Dictionary(TKey, TValue) for many purposes. But I haven't encountered any scenario to implement GetHashCode() which I believe is because my keys were of primary types like int and string. I am curious to know the scenarios (real world examples) when one should use a custom object for key and thus implement methods GetHashCode...

Can I cite a Compiled Query as the Data Source to a Compiled Query?

Best to describe this in code... I have this public class A<T> { public static class Queries { public static Func<DataContext, int, T>Get = CompiledQuery.Compile<DataContext, int, T>( (DataContextdb, int i) => (from t in db.GetTable<T>() ...

ASP.NET Site Intermittently loads wrong framework version

I have an asp.net site that is using version 1.1 of the .NET framework. Occasionally, the site will begin crashing with an object null error and bring up an error screen that reports the .NET version as 2.0. If I recycle the site app pool, then the site will come back up and run normally until it crashes again a week or two later. If I m...

CardSpace and Delphi 2007/WIN32

Very simple problem. I have a Delphi application and I want to restrict access to this by requiring users to log on using CardSpace. Basically, I need to extract the ID, name and address information from the cardspace card. The use of CardSpace is a requirement from a customer and I just want to know if: Can CardSpace be easily used f...

How does the process of hashing work in Dictionary<TKey, TValue>

How does the process of hashing work in Dictionary? I read that using dictionary provides faster look up. But did not understand how? How does the hashing and mapping to an index happen? Couldn't find any good reference. EDIT: How is the actual memory location where the object is stored obtained from the result of the hashing function?...

Can't get ListBox and UpdateTarget to work

Here are the relevant parts of the XAML file: xmlns:local="clr-namespace:BindingTest" <ListBox x:Name="myList" ItemsSource="{Binding Source={x:Static local:MyClass.Dic}, Path=Keys, Mode=OneWay, UpdateSourceTrigger=Explicit}"> </ListBox>...

.Net Membership in nTier App

Lets say I have an ASP.Net MVC App and this app (UI) references a Business Logic Layer (BLL) and the BLL references my Data Access Layer (DAL). I am utilizing a Custom Membership and Role provider for Authorization. I am trying to determine what layers need to reference my Membership provider. In MVC you can perform Authorization ch...

How do I set the publisher when generating a code signing certificate through Microsoft Certificate Services 2003

I am attempting to sign a ClickOnce manifest using a certificate generated from Certificate Services 2003 (by going to http://cert-server/certsrv, and requesting a code-signing cert from the browser). When I install the application through ClickOnce, the Publisher of the application shows up as my personal name, rather than the name of ...

StackOverflowException

With the StackOverflowException are the conditions to be thrown hardcoded or dependent on the machine the code is running on? I am almost certain the latter but have failed in my searches and don't ask enough questions here. ...

Yacc/Jay grammar file for Javascript?

I'm trying to find a grammar file for Javascript for Yacc (preferably for Jay, but since Jay is a Yacc clone I should be fine, since I need to implement it on .NET). ...

How can I have an application stack multiple processes into the same application domain?

So here's an example of what I'm wanting to do: Run test.exe, new Windows process is created, new CLR Application Domain is created, new CLR process is created. Run test.exe, new Windows process is created, realizes CLR Application Domain exists, restarts CLR process in the first CLR Application Domain and closes with Windows process. 2...

translate mainframe data packet to an XML packet in .net

is there a way to translate mainframe data packet Format(Flat Files,CVS) to an XML/NIEM Format in .net? or any suggestions would be appreciated Thanks ...

How to call generic method with a given Type object?

I want to call my generic method with a given type object. void Foo(Type t) { MyGenericMethod<t>(); } obviously doesn't work. How can I make it work? ...

Simple way to handle time in C#?

My current approach is something like DateTime startHour = new DateTime(1900,1,1,12,25,43); DateTime endHour = new DateTime(1900,1,1,13,45,32); // I need to, say, know if a complete DateTime instance // is later than startHour plus 15 minutes DateTime now = DateTime.Now(); startHour = startHour.addMinutes(15); if (now.CompareTo(new...

Execute unit tests serially (rather than in parallel)

I am attempting to unit test a WCF host management engine that I have written. The engine basically creates ServiceHost instances on the fly based on configuration. This allows us to dynamically reconfigure which services are available without having to bring all of them down and restart them whenever a new service is added or an old one...

List only files and Last Modify Date of a FTP server with C#

I'm trying to parse the result of the Ftp.ListDirectoryDetails command, I want just the FileName and the last modification date Not Directories. The command returns this: "01-21-09 06:16PM rattandom" "01-21-09 08:01PM 9900 myfile.txt" Does somebody know the way to parse it? I was reading and if the se...

C# .net framework- border on only one side of the form

I am an inexperienced programmer , completely new to programming for windows . I am writing a little program that I always wanted . Its being written using C# using .net framework. atleast thats what I think I am doing. All the talk about framework and .nets , windows forms , and win32 api has all got me really confused.. :( anyways ...