.net

BadImageFormatException when using native DLLs from ASP.NET

Hi Iam referencing in my ASP.NET application a managed C++ project which makes use of a native dll named "libmmd.dll". If I run the ASP.NET application with visual studio I get an BadImageFormatException which tells me "The module was expected to contain an assembly manifest" (translated from german). What is the preferred way to includ...

Running sum with Rx

Hi, There must be somebody out there who solved that already. Imagine I have a class that raises periodically an event about the change of a value (e.g. PropertyChanged) That value is nothing else than amount of money. Now, I would like to make use of Rx so that I get the sum of the increasement of that last 10mins. e.g. BufferWithTime...

Query a Dictionary of Dictionaries?

Hello, Please can you advise me on how to query a Dictionary of Dictionaries, and/or a Dictionary of List? private Dictionary<string, Dictionary<DateTime, double>> masterDict= new Dictionary<string, Dictionary<DateTime, double>>(); Private Dictionary<string, List<DateTime>> masterList= new Dictionary<string, List<DateTime>>(); I know...

Naming convention for interface implementator's object

What is the most commonly used convention (in C# and VB) to name object, when I want to emphesize that it is an instance of class that implements some interface. Like here: //is iDisp correct name? protected void Dispose(IDisposable iDisp) { iDisp.Dispose(); Console.WriteLine("Disposed"); } ...

Can anyone suggest a video player to watch tutorials?

Hi, I hope no one will scream that it is not a programming question. Do you know any video player that I can use to watch video-tutorials with the possibility of adding notes or bookmarks on the sequences? Thanks, ...

data loss when file is transfer from server to client using stream in c#

server side stream.BeginWrite(clientData, 0, clientData.Length, new AsyncCallback(CompleteWrite), stream); client side int tot = s.Read(clientData, 0, clientData.Length); I have used TCPClient,TCPlistener classes clientData is a byte array.Size of ClientData is 2682 in server side.I have used NetworkStream class to write d...

Portable way of determining font properties (mono and standard .net)

Does anyone know a way to determine if a font is monospace and the width and height of a single character (only relevant if it is monospace). The important requirement is that it works with mono and microsoft implementations of .net . Thanks ...

How to set maxArrayLength in .Net service?

in client i do it in app.config : <basicHttpBinding ... <binding ... <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="50000" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> ...

Printing Windows Form

I have inherited some code to print the contents of a form however the image produced on paper seems to have some sort of shadow/blurriness as if its tried to do anti-alasing but not done so very well and the letters are pixelated on the edges. Does anyone know a way of improving the final quality? System.Drawing.Printing.PrintDocument...

Windows CE: roadmap for full screen .net application with video chat capabilities

I have to develop application that should launch as soon as windows CE is started up. User should see the "OS-starting" screen and then the application form without observing desktop & other apps icons. Application should provide some functions + function to start video chat via the local network (no Internet is required). Please, give ...

log4net - how to log a summary just before the logging system shutdown

I want to log some summary lines on domain shutdown, however log4net hooks the AppDomain.CurrentDomain.ProcessExit first and will shutdown the logging before I have a chance to output my message. (And the message is never logged) So my question is: 1. Is there a way to hook ProcessExit before log4net without playing too much with initia...

How to do inter-process communication between two instances of the same application?

I was thinking of using WCF, but then the endpoints would collide. What are the other options? The endpoints will collide because the second instance will be created from the same executable file. ...

How to override PASTE operations in ScintillaNet?

I am using the Scintilla control from ScintillaNet, and I need to have some control over the paste operations (in order to be able to check some things and/or update the text to be pasted). I've tried to create a subclass of the Scintilla control and override the WndProc method. Then, I intercept the WM_PASTE message (0x0302), no luck. ...

Using Global.asax to catch missing PDFs

I'm trying to use the Global.asax file in the root application of the website to catch requests for pdf files in the root that don't exist any more. I've configured iis to send pdf requests to asp.net. The whole thing works perfectly on development. It also works on the live system with missing .aspx pages, but not .pdf. Instead an "Erro...

Using Microsoft Reports (.rdlc) in a 3-Tier app

Hi, I'm new to reporting so need some good information/resources to help me get some reports set up in our 3-tier app. We currently have: UI (ASP.Net MVC 2 at present but also winforms in future), Business Logic and DAL (Entity Framework - Code-Only ie no edmx) The BL has "manager" objects for selecting and manipulating entities. Now...

Using a single DataSource on Multiple .NET Forms

My program has two forms which get data from the same data source. After binding controls to tables and fields on both forms, I noticed each form has it's own apparently duplicate DataSet. Is it standard practice for each form to have its own DataSet even though they use the same ConnectionString and connect to the same database at the...

Version control, deployment and continuous testing in a single-person devteam (.NET platform)

I am the only developer in my company, and as such I control everything from deployment to bugfix to new features. My tool of choice is VS2010 and I code primarily in ASP.NET for new features and Classic ASP (sigh) for the bugfixes. I only have VS2010 Pro and I do not have access to any of the MS Team software. Now we are setting up a n...

C# Cookies based on login information...

I have 2 login controls on a web application one on default and one on default2 (the naming convention will be updated after I get it working). What I am doing is setting a cookie on each login that will send a connectionstring name from the login controls authenticate method. It is sending a string that is hard coded to a base class c...

How to dynamically provide T .. class ObjectXMLSerializer<T> where T : class

Ok so the class I want to use is declared with: public static class ObjectXMLSerializer<T> where T : class I have many objects that I want to serialize, but I do not know their "class" object myclass = new MyNamespace.MyClass() as object; How do I do the following... ? ObjectXMLSerializer< ? >.Save(myclass,"output.xml"); I can't...

How can you prevent Silverlight Client Http request from caching respones?

I am using a HttpWebRequest created from WebRequestCreator.ClientHttp.Create() to fetch data from a webservice. And everything seemed to be working fine until I found out the calls where being cached. I was pretty sure that the ClientHttp did not include caching, but after a bit of searching I found this little note: Client HTTP Pro...