.net

C# Attribute to trigger an event on invoking a method

Is there a way in C# or .NET in general to create an attribute on a method which triggers an event when a method is invoked? Ideally, I would be able to run custom actions before and after the invocation of the method. I mean something like this: [TriggersMyCustomAction()] public void DoSomeStuff() { } I am totally clueless how to do...

Is the Microsoft.VisualBasic namespace "true .NET" code?

My dev team is getting ready to start a new project. The shop has been a "VB shop" since the days of VB3, but the prevailing opinion now is that we're a ".NET shop" and since C# was created specifically for .NET, whereas VB.NET was a retrofit, we've decided to move forward writing C# only. The controversy revolves around the question of ...

What is the best tool for build automation for a one-man software shop?

I am building Windows apps for a few clients. I read Joel on Software and took the Joel Test and realized I don't quite measure up. One place I am lacking is automated builds. What should I use to have automated builds? I have Windows apps that use .NET 1.1, 2.0, and 3.5. Also, I need to be able to build my .vdproj to create MSI's. ...

Is it possible to point a local instance IIS to a shared windows file server as the home directory?

Hi everyone, I'm just beginning work with IIS, .NET, etc. so I apologize if any of this is unclear. I recently installed a local instance of IIS and it's up and running just fine. I'm wondering if it's possible to point IIS to a shared windows folder that exists on another server, and have that folder serve as the root directory for IIS...

Update a dll without stopping the service

I would like to update a dll for a server process without stopping the service. How do I do that? A bit like how asp.net automatically picks up new dlls placed in the bin folder. ...

.NET SOAP Extension is throwing NullReferenceException inside MethodInfo?

NOTE: Using .NET 2.0, and VS2005 as IDE Hello all, I'm working on logging webservice calls to our database, and finally got the SoapExtension configured and running using a very stripped-down implementation that was ported over from another project. I've set it up in the configuration file so it will run for all methods. When I call ...

Deserializing XML to Objects in C#

So I have xml that looks like this: <todo-list> <id type="integer">#{id}</id> <name>#{name}</name> <description>#{description}</description> <project-id type="integer">#{project_id}</project-id> <milestone-id type="integer">#{milestone_id}</milestone-id> <position type="integer">#{position}</position> <!-- if user can see...

.net webbrowser control

I am using the webbrowser control in visual studio. I think it is a wrapper around internet explorer. Anyway all is going well I am using it in edit mode however I can't get he document's keydown event to fire (in order to catch ctrl+v) anyone had similar problems with it? Anyone have a solution? ...

Why does Convert.ToDouble(string) round?

For example, Convert.ToDouble("0.1234567890123456789") = 0.123456789012346 What is the maximum number of significant figures? Couldn't find it in the docs. ...

How to create a simple proxy in C#?

I have downloaded Privoxy few weeks ago and for the fun I was curious to know how a simple version of it can be done. I understand that I need to configure the browser (client) to send request to the proxy. The proxy send the request to the web (let say it's a http proxy). The proxy will receive the answer... but how can the proxy send ...

How to edit EXIF data in .NET

I am writing a photo gallery/sharing website and want to (1) write EXIF data to the JPEGs stored on server, and (2) strip that EXIF data prior to writing to the output stream for display. Is anyone aware of a dotNet library -- preferably open source -- that allows the editing (the key here is that I need to write/erase the EXIF data, no...

What is the best way to sort an IList<T> in .Net 2.0?

I have an IList<T> that I need to sort, and I would rather not copy the list if possible. I've noticed that ArrayList has an Adapter static method that wraps the passed list without copying it, but this takes an IList and I have an IList<T>. Is it safe to cast from a System.Collections.Generic.IList<T> to a System.Collections.IList and...

Using aspx Rendering Engine to Generate Non-HTML

Is it possible to use the asp templating engine (With the partial code-behind class, dynamic <% ... %> blocks and such) to generate non HTML? I want to have a clean and maintainable way to generate code dynamically. (Specifically, I want to generate LaTeX code populated with values from a database.) Currently my LaTeX templates are res...

XSLT Transform Efficiency

I am a support engineer and our company's product allows XSLT transforms to customize outputs. I made a xsl transform for this purpose. It works well for source files of typical size (several 100k), but occasionally a really huge (10M) source file will come by. In such case, the output is not generated even if I let it grind several day...

Connecting Silverlight to the local computers COM port

I have been searching high and low for a way to get my silverlight application talking to the COM port on my local computer. Has anybody out there been able to get Silverlight to successfully connect to the COM port of you local computer? If so can you point me to the documentation. ...

UAC need for console application

I have a console application that require to use some code that need administrator level. I have read that I need to add a Manifest file myprogram.exe.manifest that look like that : <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <trustInfo xmlns="urn:sc...

Send Email in .NET, with email saved in user's Sent Items

Hi, I am attempting to send an email using VB.NET. There are two requirements The email be saved in their "Sent Items" folder in Outlook (their only email client). A PDF (generated on the fly) is attached to the email. I am currently creating a new MailMessage & sending via a SmtpClient, but I believe that this sends from the serve...

Is injecting DAO into entities a bad thing?

So like most new .NET developers you start of passing DataSets everywhere and although things do the job it doesn't seem right. The next progression is usually to create entity objects that extend a DAL base class so you have i.e. public class User : UserDAL { //User specific methods } public class UserDAL { //Bunch of user spe...

What are the steps to repair the .Net framework (2.0 / 3.5) on Windows XP?

I have 2.0 SP2 and 3.5 SP1 installed on a windows xp machine. What are the steps to repair those frameworks? ...

Software protection by encryption

Hello, For our software we use hardware dongles to protect the software. No protection is perfect but this commercial solution is affordable and keeps honest people honest (as mentioned in another thread). The advantage is the 128 bit key that is stored 'unreadable' on the hardware dongle. We want to remove this hardware dongle and st...