.net

How do I use Reg-Free COM for a vb6 dll reference in a .net project?

I've been trying to solve this issue for a long time, and nothing seems to work. I have a COM DLL written in vb6. I add a reference to this DLL in .net, with the 'isolated' and 'copy local' properties set to true on the reference. Apparently this is supposed to enable reg-free com. But it doesn't work. If I try on another computer, or ...

How do I add intellisense to my application?

We have a proprietary macro language in one of our products, edited through our Windows software. I would like to add intellisense, but I have no idea how to go about this (at least not without completely reinventing the wheel). Is there any sample code or 3rd party package that can at least get me started? It doesn't have to be free. T...

How do I log unhandled exceptions in ASP.NET MVC?

Here's what I'm trying to do in my Global.asax.vb: Public Class MvcApplication Inherits System.Web.HttpApplication Shared Sub RegisterRoutes(ByVal routes As RouteCollection) routes.IgnoreRoute("{resource}.axd/{*pathInfo}") routes.MapRoute( _ "Error", _ "error.html", _ New With...

.NET BitmapSource is locking file

I am using this C# code to access an image file in order to read metadata from it. BitmapSource img = BitmapFrame.Create(uri); Unfortunately the image file specified by uri becomes locked until the program ends. How do I prevent the image from being locked? ...

Import certificate with private key programmatically

I'm trying to use the HttpListener class in a C# application to have a mini webserver serve content over SSL. In order to do this I need to use the httpcfg tool. I have a .pfx file with my public and private key pair. If I import this key pair manually using mmc into the local machine store, everything works fine. However, if I impor...

What will be the way to go with classes in ASP.NET ??

In my asp.net web app. I have three classes (inside app_code folder) under namespace WPP which are as follows: 1. wpp_Common 2. wpp_SQL 3. wpp_Admin All these classes contains different functions which I am using in my application to accomplish different tasks. Such as, wpp_common contains a function which make my URL's SEO'd, and wpp...

When dealing with a single page, ViewState is a better choice than QueryString for maintaining state. Why?

I am reading the article: Nine Options for Managing Persistent User State in Your ASP.NET Application by Steven A. Smith (Doesn't he host a show on ESPN?) In the article, Steven makes the following statement: "When dealing with a single ASP.NET page, ViewState is a better choice than QueryString for maintaining state" Unfortunately, h...

Make Properties/Functions Bold in Intellisense

Is there any way to Highlight Properties/Functions on your custom classes in intellisense? It's used lots in the Framework and it really helps show main features of a class. I've tried looking for an attribute because I know the obsolete attribute influences the display, but no luck. EDIT The original question is flawed because of my m...

How to automatically upgrade deployed database for end-users

I've read a fair number of questions on how to upgrade a database for developer and such, and I'm leaning towards using migratordotnet or something similar, however it seems the the upgrades need to be run with something like MSBuild or NAnt. These are not things I should expect an end-user to have installed. Ideally the process should...

C# - Combobox performance

Hello! Since I'm just learning C# with .NET, (I have more experience with the XNA framework), I might not use it just the right way. My problem is from my view very strange. I have made a form with a TabControl inside of it, using the designer. In one of those tab pages I have a ListBox and a ComboBox. The ComboBox has a static number ...

how to create random folder names 12 characters long in .NET

I would like to create random folder names on my website to store images and their thumbnails, but instead of using the full version of a generated guid, i was thinking about using just part of it, maybe just the first 8 characters and possibly base64 encode it. i am worried about possible collisions though. Can someone point me in the...

JVM/CLR Source-compatible Language Options

I have an open source Java database migration tool (http://www.liquibase.org) which I am considering porting to .Net. The majority of the tool (at least from a complexity side) is around logic like "if you are adding a primary key and the database is Oracle use this SQL. If database is MySQL use this SQL. If the primary key is named ...

.NET Logging Class with Fluent Configuration

Is there a .NET logging class that does not rely on XML configuration files? I thought is was possible with log4net but can't find any info. ...

Writing to a textBox using two threads

Hello, I have some unsolved issue with threads. It's my first time doing it. I know how to use one thread to write in a textBox, but I have no idea how to use two of them to do the job. Anyone have a clue what do I have to do to be able to use two threads to write to the same textBox, but not in the same time. Thank you. ...

Using ,NET Generic List ToArray in a COM Called Wrapper causes access violation, am I missing something?

I'm having a problem when trying to pass an array back to a COM caller. Basically, I have a generic List of classes, that I want to return to the COM caller, you can't use generics in COM, so it's got to be strongly typed. I figured just returning a .ToArray() on the List would give me what I need. When I use it in VB6, it works perfe...

Windows RegKey - Default Browser Application Path

What RegKey can you get the default browser application's path from? Best way to get to it from C#/.NET? ...

submit forms in .NET

I have a .NET page that has a submit button. I am using client side validation to validate the form element. var register = $('#<%= Register.ClientId %>'); register.click(function(){ validation.init(); return false; }); Now, the return false on top prevents the form from being submitted to the server on click. In any other l...

Determine Where Activation Is Going When A Form Is Deactivated

Does anyone know of a way to determine which window is going to receive focus when a form is deactivated? ...

Outlook alias and System.Net.Mail

Is it possible to resolve a users Outlook Alias to a valid SMTP email address using System.Net.Mail? I know it can be done with Outlook automation but I am trying not to use it as Outlook 2007 has spam filter protection that require user interaction. ...

Linq-ToEntities DataSource Assignment Hangs in Winforms

I have a very typical linq-to-entities data binding in WinForms: myGrid.DataSource = myEntities.entity When it reaches that line of code it simply hangs. Similar assignment a different entity work fine elsewhere in the code. The database contains no more than 50 lines of data in all entities (it's a new project) so it's not waiting on...