C# is a programming language created by Microsoft in parallel with the .NET platform. Programming questions should be asked on Stack Overflow.

learn more… | top users | synonyms

11
votes
10answers
5k views

How do we avoid the 30-second time limit on starting windows services?

One of the components of my company's product is a Windows service, written in C#. It's dependent on .NET and on a few other libraries, none especially large. It works perfectly when started ...
7
votes
5answers
529 views

ASP.NET High CPU Bringing Servers to their Knees

Ok, our new build is having 100% cpu spikes on each server at random intervals. For long durations it make the site totally unresponsive - this will be at peak times as people in different countries ...
7
votes
2answers
2k views

Is Mono stable and fast enough for web production?

I am currently investigating for a new web application stack for my web server. C# looks great because it is a compiled language which seems to run quite well without too much CPU and does not ...
6
votes
11answers
24k views

Scripting - How to disconnect Remote Desktop sessions?

I am looking for a way to close all active Remote Desktop sessions on a computer (local computer). Windows includes a couple of commands (rwinsta, qwinsta, etc.) to look at the active sessions, but I ...
6
votes
2answers
3k views

DB auto failover in c# does not work when the principal server physically goes offline

I'm setting up DB auto failover in C# with SQL Server 2008 and I have a 'high safety with automatic failover mirror' using a witness setup and my connection string looks like "Server=tcp:DC01; ...
5
votes
4answers
2k views

Copy Folder/File without modifying attributes?

I asked this on stackoverflow... but I think I should be asking it here: Is it possible to copy a file or a folder from one location to another without modifying its attribute data? For example if I ...
5
votes
1answer
153 views

Crazy idea: Identify if system is idle when it's a black box

I need to be able to tell if a series of servers have anyone active on them, and if not then to automatically shut them down (turn off the VM). It's not a trivial task, because I have 1000+ server ...
4
votes
1answer
280 views

Backup database at certain intervals?

My client would like to have the database backed up several times per day, as well as the ability to backup the database manually. I've created a page to backup the database manually, it just calls a ...
3
votes
4answers
2k views

Deploy Registry Change

What is the best way to deploy a HKCU registry change for anyone who logs onto the machine. Someone mentioned to me Active Setup...but I am not sure.
3
votes
2answers
615 views

How do I recover a dropped table from SQL Server Express 2005?

Something disastrous happened to me. I accidentally dropped my important table from SQL Server 2005 Express DB. Is there any way to recover that table with all records? Can DB Log file help? I have a ...
3
votes
1answer
579 views

Disabling Password Complexity for OU and C# App creating AD accounts

I created a C# app that is creating a series of AD accounts from a database. The issue i am running into is the passwords i am gathering had no complexity requirements so when i am passing them into ...
3
votes
2answers
218 views

SQL Server Express 2008 R2 or SQL Server 2008 R2 Web?

We have swtiched from MySql to SqlServer, but I don't know what version of SqlServer to use in production ... We have a webapplication (C# / ASP.NET) SqlServer Express 2008 R2 ? SqlServer Web 2008 ...
3
votes
1answer
221 views

Run CLI command on a windows EC2 Instance using c#

i'm programming a system in .net that designed to run an execution file on a remote machine via cli command, in this case, Amazon EC2 windows instance. I've searched the AWS .net SDK and found no ...
3
votes
1answer
221 views

How can I get an OID for a certificate template?

I'm using C# (or VBScript) to issue a certificate from an Enterprise CA. According to this answer, I need to specify the OID instead of the certificate name, and place it in an unexpected portion of ...
3
votes
1answer
222 views

Will IIS finish pending requests on Stop-WebSite?

Lets' say my IIS8 hosted web site is up and running and happily serving requests. Now, from an elevated Powershell, I run: Stop-WebSite <MyWebSite> My assumption until recently was that IIS ...
3
votes
2answers
1k views

Options for real-time web notifications and updates using Comet/XMPP vs WebSocket technologies on a Microsoft stack?

I am scoping out the architectural options for a project that will render live updates (like Facebook) of user activities - logins, photos, etc. Two main UI components of this are an auto-updating ...
3
votes
1answer
1k views

Install Mono ASP.NET on debian

I've been trying to install mono ASP.NET onto my debian VPS and I am unable to do so. I know I need mono which can support .NET 4.0 now. I am unsure if I need XSP and mod_mono, or just mod_mono. ...
3
votes
1answer
2k views

Bypass RDP Client Warning

How do I bypass the security warning in the RDP Client everytime you launch it from a RDP shortcut? The message title reads: "The publisher of this remote connection cannot be identified. Do you ...
3
votes
8answers
9k views

Emails are being rejected by some email providers

I have this asp.net application that sends out emails. The SMTP server is iis6. The emails are being sent on behalf of our application users and they have different domain names. Most of the email ...
3
votes
1answer
872 views

Getting error when deploying webservice to iis 7.5

I've been ask by the programming department to test deploying one of their app. For all I know about the app, is that it's a webservice wcf code c# for a wpf app. They did tell me that they did try to ...
3
votes
1answer
93 views

live site and holding side by side until go live

I will shortly be going live with a new .net web application. It will be deployed to a load balanced environment over 5 servers. Before go live there is a holding site on all the 5 servers to which ...
2
votes
5answers
1k views

Portable SQL Server

I need to install SQL Server, however I have a BIG problem with it. I remember when I tried to install it I got error with MSXML and it was not installed because of MSXML and some other component. Is ...
2
votes
2answers
359 views

Deploying C# Windows Service in multiple servers

I've created a C# windows service and its ready to be deployed. I have 215 servers on which this windows service is to be installed. I have to login to each box and deploy the service. Is there an ...
2
votes
2answers
1k views

Cannot Delete SQL Server Database via Command Line Executable

When running a command line executable, one of the tasks is to drop a database. When this gets run, SQL Server tells me that 'DBName' does not exist or you do not have permission. The database is ...
2
votes
1answer
689 views

2 Received from header at IIS SMTP email send via C# application

I am using windows server 2008 r2 and IIS 7.5 normally. I am using IIS 6 smpt server to send emails. Right now when i send email via my C# application i am seeing 2 received from headers. What might ...
2
votes
3answers
924 views

How to scan network for intel vpro computers?

Ive seen an example in the docs of Intel AMT SDK but it takes so long to tell me that is there 1 intel vpro pc in my network and it doesnt tell me the name or ip address of that pc. Is there a way to ...
2
votes
3answers
1k views

SQL CE thread unsafe - alternatives?

I have discovered that SQL CE is not thread safe: SQL CE objects are not thread-safe and are not thread affinitive either. If an instance of SqlCeConnection or SqlCeTransaction is shared across ...
2
votes
1answer
735 views

The RPC server is unavailable from .NET over AWS

I am trying to access EC2 machines remotely to get some info using C#. I wrote code as below:- ConnectionOptions options = new ConnectionOptions { Username = serverspace.ServerIP + @"\xxxxxx", ...
2
votes
2answers
530 views

How to see all websites in IIS using appcmd list site

I want to see all the websites in IIS 7.5. I typed appcmd list site It lists only “Default Website”. It is typed from C:Windows\System32\inetsrv. Any idea why it does not list other sites that ...
2
votes
1answer
2k views

Deploying MVC 5.1 app on web server

I made ASP.NET application with MVC 5.1 technology and tried to deploy it on Winhost server. When I go to my web site, I get the following error message. Could not load file or assembly ...
2
votes
1answer
515 views

Remote rsyslog only writing logging data to /var/log/syslog and not custom logfiles

I'm having a problem setting up rsyslog to log remote logging data to a specific file. I have two Windows Server 2008 boxes that each have a C# application using NLog.Targets.Syslog which log their ...
2
votes
2answers
1k views

iis 7.5 website not reachable in lan

I'm running a Windows Server 2008 R2 with IIS 7.5 and want to deploy an old silverlight business application with membership provider and wcf data services (not ria) on it, so everyone in the LAN ...
2
votes
2answers
928 views

IIS get full error message for failed requests

I have IIS set-up and serving my webservice. Unfortunately if the webservice throws an exception, all I get is a blue box with the title failed request. What options do I have to actually see what ...
2
votes
1answer
414 views

Regular expression not working on Powershell

Background: I need to match a multiline pattern(?) in a C# source file. The regular expression will be manipulate by Powershell. I have tested and it works on RegexBuddy (with the Dot Matches ...
2
votes
3answers
1k views

How to send mails using a custom .NET application and Windows authentication to a distribution list that only allows authenticated senders?

This is basically a cross post from my StackOverflow question to see if I can get a server side perspective. I'm trying to send automated emails from a C# console application from machines to clients ...
2
votes
1answer
416 views

Distinguished name of Configuration in AD is tampered?

A user of our product came out with a problem which was caused by the DN of Configuration object in AD. We had a rather static lookup method to find Configuration object, thus it failed. Let's say ...
2
votes
1answer
106 views

Seeing a lot of requests into the web server - for random hostnames not my own

This seems like a phishing attack, and it's a disclosure vulnerability to send 404 response in this case. Unfortunately that's just what IIS does. I would rather these guys not even know my server ...
2
votes
1answer
1k views

The administrative limit for this request was exceeded

I have a command to wipe out our Active Directory (AD) structure and rebuild it for testing. The command will also be used in Prod to do the initial setup of the AD structure. On our dev sandbox AD ...
2
votes
1answer
552 views

Cygwin SFTP directory security

Here is what we are trying to accomplish: A client drops off a file on a Windows/Cygwin SFTP folder A Windows service scans the folder and processes the file The problem: The Windows service is ...
2
votes
0answers
562 views

MySQL on Amazon RDS connection handshake error reached max_connection_errors

We are using a C# web app on AWS connecting to a MySql RDS. Suddenly, connections start to fail with two different exceptions: First one (most repeated): Authentication to host 'xxx' for user 'xx' ...
2
votes
0answers
2k views

Access to message queuing system is denied MSMQ?

My problem is a little confusing. I have 2 servers (Windows Server 2008 R2) with MSMQ installed and I want to use Server B to consume a MessageQueue on Server A. When I try to Receive it always ...
2
votes
1answer
247 views

.NET App hanging on Windows 2012 on startup

We have a customer that has supplied us with a Window 2012 Hyper-V server that has a Window 2012 Multipoint guest os which we run our .NET-based (v3.5) software products on. Unfortunately there are a ...
2
votes
1answer
330 views

Test Exchange 2010 connectivity programmatically with C# [closed]

Other than a simple ping, I'm looking for ways to connect to Exchange just for monitoring purposes. Should I connect to a Web Service? WMI? I'm merely trying to test that the Exchange server is up ...
2
votes
0answers
237 views

How do I limit outgoing mail in IIS [closed]

I am going to use C# to write e-mails into the Pickup directory. Each e-mail will have a 3-5mb pdf attachment. There will be about 500-700 e-mails dropped into the pickup directory at one time. I ...
2
votes
1answer
273 views

Install Visual C# Express 2010 onto client machines - redistributable package needed

I would like to install Visual C# Express 2010 onto several machines on the Windows network at the school where I work. I can only find web and ISO installers, but I really need MSIs for both Visual ...
1
vote
2answers
2k views

Keep WCF live , no IIS recycle

I have a WCF application. I d like to keep this application live all the time. If there is a certain period of inactivity, does IIS app pool recycles? How do I keep it alive all the time? Should i ...
1
vote
5answers
5k views

How do I mirror a folder (copy only missing and changed files recursively) in windows?

I'm trying to find a fast way to recursively update a folder and all subfolders from another folder. Obviously, a full delete and Xcopy would work but that is very slow. After the update, the ...
1
vote
2answers
1k views

Sending lots of mails using SmtpClient (C#) takes very long after a while

I'm using this piece of code to send a mail: SmtpClient client = new SmtpClient(); client.Host = smtpServer; client.Send(mailMessage); If I trigger this code ten times/second, then after some ...
1
vote
1answer
86 views

Changing the user IIS runs over

I am trying to change the user IIS runs over. I read that IIS might run using IUSR_computer_name user but I am not sure if this rule applies to IIS 7.0 The question is, trying to map the whole ...
1
vote
3answers
406 views

Program to monitor new exe files in Windows (C/C++)

I am currently looking for a program or source in C / C++ that will allow me to monitor any new executable files and output the results to a text file Any help would be greatly appreciated