.net

AddIn - get AppDomain from currently debugging process

hi! (quick and dirty) is it possible to get the current appdomain from a debugging process in an addin? currently i use the DebuggerEvents.OnEnterBreakMode-Event to get in the right place. i need access to HttpContext.Current of the debugged application. greetz mo ...

Why does Microsoft.Office.Interop.Outlook.Excecption exist?

Why did microsoft's API team recreate an Exception class in Microsoft.Office.Interop.Outlook that would conflict with the System Namespace's Exception class? Does it have to do with the unmanaged nature of interacting with the Office Suite? Why should it be used instead of System.Exception? ...

Do I need to force the GAC to reload an assembly? Is this possible?

I've added types to my .NET classes that I'm using for COM interop. To get it to work with my VB6 application, I unregistered the DLL and re-registered it (using regasm). I then uninstalled and reinstalled it to the GAC (using gacutil). The types are showing up in the VB6 object explorer, but when I run the application in the VB6 IDE,...

How do I replace a method implementation at runtime?

I'd like to have property getters and methods that I can decorate with my own custom attribute and based on the presence of that attribute replace the method bodies with a different implementation. Also, that different implementation will need to know the constructor arguments given to the custom attribute where it decorates the method....

.net Encrypting Database Tables

I am delivering a module for a website that will collect information from a user and make appropriate calculations. The client wants any data collected from the user to be encrypted. We are using SQL express 2005 as the database. Thanks in advance. ...

How can I translate this SQL statement to a Linq-to-SQL approach?

For example, imagine that I want to see if a user exists in my database: Select * from Users where inputID = Users.ID Then if that result brought > 0 items, then the user exists, correct? How can I do something like this using a pure Linq-to-SQL class? ...

Why does accessing a COM object from .NET, without going through the Interop class, sometimes work?

When you interface a COM object from .NET code, VS creates an interop DLL, with interop classes. Example: You have a foo.dll the implements a COM library Foo, that includes an implementation of the COM interface "IBar". You add a reference to foo.dll to a .NET project. in /bin, you'll see an Interop.FooLib.dll. In the Object Browser...

in which language .net framework has been written?

Possible Duplicate: What language is .NET Framework written in? in which language .net framework has been written? ...

Dependency injection with web services?

I've recently discovered a possible candidate for dependency injection in a .Net application I've designed. Due to a recent organizational policy, it is no longer possible to call smtp mail services from client machines on our network. So I'm going to have to refactor all the code in my application where it was previously calling the s...

.NET XML Pretty Printer?

Is there a method in the .NET Framework or a free Open Source library to pretty print XML? ...

Using a Linq-To-SQL class automagically generates the connection string for me; is there a way to manually set it?

I'm just beginning to use Linq-to-SQL and it's just wonderful to use. The problem is, this software is going to be run on a lot of machines and each machine will have a unique connection string. Is there a way for me to manually set the connection the Linq-to-SQL (.dbml) uses? The way I'm doing things now is creating the .dbml file, an...

How to easily salt a password in a C# windows form application?

How can I easily salt a password from a Textbox.Text? Are there some built in wizardry in the .NET framework? ...

ASP.NET 4.0 Rendering problems with the menu control after removing of controlRenderingCompatibilityVersion="3.5"

I am actually migrating websites to ASP.NET 4.0, having problems with the new rendering of menu controls. My websites make heavy use of nested menus. Hover effects are used and the layout is defined by a combination of themes and skins with linked CSS. If I remove the pages controlRenderingCompatibilityVersion attribute, they are no lon...

Automatically freeze wpf-objects built from templates

Is it right that wpf-objects that are freezable are freezed in any case automatically if they are generated through a DataTemplate, ControlTemplate or a style? ...

"Items collection cannot be modified when the DataSource property is set." Anyway around this?

I have a combobobox on my form, and I use the following code to populate the data from SQL Server: cbname.DataSource = DSAssetName.Tables(0) cbname.DisplayMember = "IDWLNAME" cbname.ValueMember = "FIDWID" I need the value specified in the value member for the reporting section of my app to work. This all works great a...

Opinions on commercial MVC controls

We are interested in the communities opinions on commercial MVC controls ie Telerik, Syncfusion. Which is fast, easy to use, stability, documentation, support and all that good stuff. We are about to start our second MVC project and are currently doing research into improving functionality and speed of development to 'standard' MVC. A...

WPF Grid SharedSizeGroup error

If you run this code and click on tab 2 and then back on tab 1 the application goes insane and starts bouncing the column widths back and forth. Any suggestions on how to fix this? <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" ...

Disabling Alt-F4 on a Win Forms NotifyIcon

I am using a NotifyIcon from Win Forms to make a systray icon for my WPF C# application. I have a bug where if the user right clicks the icon for the context menu, they can press Alt-F4 and the icon will disappear from the tray, but the Main WPF application is still running. This is especially a problem when they have "minimized to syst...

What are the fastest-performing options for a read-only, unordered collection of unique strings?

Disclaimer: I realize the totally obvious answer to this question is HashSet<string>. It is absurdly fast, it is unordered, and its values are unique. But I'm just wondering, because HashSet<T> is a mutable class, so it has Add, Remove, etc.; and so I am not sure if the underlying data structure that makes these operations possible make...

Perform lengthy initialization in Windows Service

What's the best way to do some lengthy initialization when a Windows service starts up (or resumes from being paused) without blocking the Service Control Manager? ...