.net

Looking for a framework for logging arbitrary objects in heavily distributed and parallelized system in .NET

(Note: I have seen several questions regarding .NET logging frameworks, but haven't seen any which resembles our requirements. So please don't close this one as a duplicate.) We will need a logging framework for a highly distributed and parallel .NET application with the following features: It must be thread-safe, as log messages wi...

Error when publishing .NET c# application

It has been two days and I haven't been able to make this application work in the hosting computer. This application is in a subdirectory and is written in C# the other application is C#. It work just fine down here in my development computer. I have been trying the following. 1.I made the changes to the web.config so it doesn't confli...

Ignoring a field during .NET JSON serialization; similar to [XmlIgnore]?

I have a POCO class that is being sent to the browser as a JSON string in .NET 3.5 sp1. I am just using the default JSON serialization and I have some fields that I want to ignore. I want to put an attribute similar to [System.Xml.Serialization.XmlIgnore] on them so that they are not serialized. ...

IronRuby - .NET 4.0 - Question Marks and Exclamations at the End of Method Names

Just curious how is the .NET 4.0 CLR world going to call methods ending in question marks and exclamations? What will the syntax look like calling from C# or VB.NET? ...

How to implement the Display/ValueMember in my own control.

Hi, I created the custom winforms data control which has the "DisplayMember & ValueMember" properties (the functionality should be same as in standard winforms controls). But the problem is common and can be used in webforms. Now, I'm trying get values via Reflection and DataRow/DataRowView. Should be supported more ways how to get/set...

speeding up sending large batch of emails in c# .net

hello, We send out emails to around 10k client and right now the process takes around 45 min or so. The application runs on the server and just sends out the whole batch. I'm wondering if introducing threads and splitting up the list would speed up the process. If so, how many threads are optimal? EDIT: actually it is one message t...

textbox properties

Hi, I have set the MaxLength property of a textbox in my windows forms application to 10 I am populating the textbox by reading from a file. However if a read string which is more than 10 characters the textbox still gets populated. But when I manually try to enter a string it works fine (that is, it does not allow more than 10 charact...

Why is Dispose being called?

In my application, I'm seeing that at times the Dispose method on my main form gets called for apparently no reason. I'm not closing the app through the UI, I'm not sending a close windows message or calling Close() anywhere, however the Dispose method still gets called. Here is the call stack: Bitter.Shell.exe!Bitter.Shell.MainForm.Dis...

In xml doc, can I insert a reference to a method group? How?

In C#, I can attach documentation for properties, methods, events, and so on, directly in the code using XML Documentation Comments. I know how to insert a reference to a particular method: <see cref="MethodName(TypeForArg1, TypeForArg2..)"/> Is there a way to insert a reference to a method group? Where I've got multiple overloads...

ServiceHost's conflict on address when unit tested

I have a small WCF hosting engine that I am writing that will dynamically create ServiceHosts based on the .config file. The general idea is to allow us to remove existing services, as well as add new services, at runtime without having to bring all of our services offline. I ran into a problem unit testing that indicates this may not b...

How can I keep my WPF UI responsive while communicating with server on an other thread?

I have a wcf client that before doing some complicated interactions with the wcf service does a simple check for the service to be alive. As the time-out for a failed connection is one minute, I want to implement this check asynchronously. This is what I have: //Method on the main UI thread public void DoSomeComplicatedInteraction() { ...

How to determine the increment steps for a Progressbar in .NET?

Hello, It seems trivial, but I cant find a clean algorithm to this. I can calculate my total rows to 2186. Then I thought I do a 2186 / 100 = 21 (which would be my modNr) Then I thought I would increment the currentRowNr++ inside Backgroundworker.reportprocess() And do a if(currentRowNr % modNr == 0) increment progressbar. The progre...

How to zip specified folders with Command Line

Could you people tell me how to zip specified files into same Zip file. Let me tell how my folders are filled : A task scheduler have backups of my databases and save them into a file daily. It creates 4 database backup daily which means there will be 4 more files daily. So I need to zip newly created backups into same zip file (of cou...

WPF: MVVM & Editing Hierarchical Data

I'm still trying to wrap my head around MVVM. Let's say I have a Model that looks something like this: public class Company { public IList<Division> Divisions { get;set;} } public class Division { public string Name { get;set;} public IList<Department> Departments { get;set} } public class Department { pub...

Attributes or Properties

I want to add some functionality to every module/plugin written such as: Author, Company, Date, etc that represents where it's coming from and who wrote it. Then the programmer could have multiple plugins in a single DLL. How should I implement support for these so I can access them in the main application UI? Generally 1 plugin...

How do you format XAML in Expression Blend?

Does anyone know how to "format xaml" in Expression Blend similar to the option "Format Document" in Visual Studio? ...

How do you instruct NUnit to load an assembly's dll.config file from a specific directory?

If an assembly contains an app.config file, ConfigurationManager will load it as long as it is in the same directory as the NUnit project that is executing through NUnit-Gui. To illustrate consider the following folder structure. + TestFolder testProject.nunit + AssemblyAFolder assemblyA.dll assemblyA.dll.config + A...

Supress 3rd party library console output?

I need to call a 3rd party library that happens to spew a bunch of stuff to the console. The code simply like this... int MyMethod(int a) { int b = ThirdPartyLibrary.Transform(a); // spews unwanted console output return b; } Is there an easy way to supress the unwanted console output from ThirdPartyLibrary? For performance re...

Error 11 Error 2002: The EntityContainer 'SomeEntitieContainerName' for the conceptual model specified as part of this MSL does not exist in MetadataWorkspace.

I'm getting this error when I try to compile my webapplication. I have only an *.edmx named BancorlineDB.edmx that has a "Entity Container Name" setted to "BancorLineEntidades". ...

C# HTTP programming

Hello there, i want to build a piece of software that will process some html forms, the software will be a kind of bot that will process some forms on my website automatically. Is there anyone who can give me some basic steps how to do this job...Any tutorials, samples, books or whatever can help me. Can some of you post an working c...