.net

VS2005 + cant select windows service as project type

Hello, i was just about to finish up my project and install it as a windows service. I have the installer, etc. - everything i need. When i went to choose Application Type, Windows service does not appear as an option. Here is the kicker. When I dev in VB.NET, i have that option. The project mentioned above is in c#. Also, if i try...

Visual Studio debugger tips & tricks for .NET

I've been working for years with VS's debugger, but every now and then I come across a feature I have never noticed before, and think "Damn! How could I have missed that? It's so useful!" [Disclaimer: These tips work in VS 2005 on a C# project, no guarantees for older incarnations of VS or other languages] Keep track of object instanc...

Where is my Object being disposed?

I have a strange issue: I am using SPContext.Current.Web in a .aspx page, but at the end, I get a "Trying to use an SPWeb object that has been closed or disposed and is no longer valid." error message. From what I see, SPContext.Current.Web is Disposed by someone, but I have no idea where. I just wonder: With Visual Studio 2005's Debugg...

Dynamic Table Data disappearing upon ImageButton Click

I have a form that searches all rows in a single table (TServices) that occurred between the date range and then populates a dynamic table below the form. Now I'm adding a delete ImageButton next to each listing in the table. Here's my C# code-behind for adding the ImageButtons to the table cell: ImageButton btnRemoveService =...

.NET inheritance with generic interfaces

Hallo i am currently playing around with castle projects ActiveRecord and the remoting facility. my current problem is that i need the find a way the implement the save sub from IBaseRepository in my address class and i dont know how. here is my current code, VS tells me on the line "implements IAddress" that i have to implement Sub Sa...

Identifying COM components in a .NET application

I've inherited a .NET application that pulls together about 100 dlls built by two teams or purchased from vendors. I would like to quickly identify whether a given dll is a .NET assembly or a COM component. I realize that I could just invoke ildasm on each dll individually and make a note if the dll does not have a valid CLR header, but ...

What could cause a .NET WinForms app to close suddently without a dialog?

Our WinForms application has been reported to occasionally just close on its own. It neither shows our own crash error submit dialog nor Windows' error submit dialog, it just closes and is gone, often when the person was afk and not doing anything with the application. It seems to be a semi-rare occurrence, maybe like 2-3 times a month...

How do I un-escape XML entities easily in .NET

Hi, I have some code which returns InnerXML for a XMLNode. The node can contain just some text (with HTML) or XML. For example: <XMLNode> Here is some &lt;strong&gt;HTML&lt;/strong&gt; <XMLNode> or <XMLNode> <XMLContent>Here is some content</XMLContnet> </XMLNode> if I get the InnerXML for <XmlNode> the HTML tags are ret...

Is it possible to load two versions of the .NET runtime in the same process?

There are two scenarios I need to clarify: An executable compiled with .NET 3.5 needs to use a library compiled with .NET 1.1 and the library must run on the 1.1 runtime. An executable compiled with .NET 1.1 needs to use a library compiled with .NET 3.5. I cannot find a reliable source stating that it is not possible to load two vers...

Sharing ASP.NET session cookies with a Java applet

I have a Java applet that runs inside a forms-authenticated aspx page. In the .NET 1.1 version of my site, the applet has access to the session cookie and is able to retrieve a file from the server, but in the .NET 2.0 version it fails to authenticate. I have seen a couple of forum posts elsewhere that state that 2.0 sets cookies to Htt...

What is the simplest way to call an HttpHandler file in .NET?

I have an HttpHandler on my webserver that takes a URL in the form of "https://servername/myhandler?op=get&amp;k=Internal&amp;m=jdahug1". I need to call this URL from my .NET app and capture whatever the output is. Does anyone know how I can do that? I want it to be simple so that I just get back a string with the output, and that I c...

Submit Login control button when I hit Enter

I have an ASP.NET web page with a Login control on it. When I hit Enter, the Login button doesn't fire; instead the page submits, doing nothing. The standard solution to this that I've found online is to enclose the Login control in a Panel, then set the Panel default button. But apparently that doesn't work so well if the page has a ...

DocumentViewer toolbar and context menu

How to hide the default toolbar and to disallow the default context menu of the DocumentViewer control? ...

How can you get a ComboBox child of a DataGridView to process all keys, including "."?

I have the same problem as described in the posts listed below. That is, certain keys don't work at all when I type them into my combobox until I first hit the spacebar. One of the keys is ".", but another is the letter "Q", and there are others: "$", "%". http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=659716&amp;SiteID=1 h...

What might cause ThreadAbortException when using HttpWebRequest.GetResponse()

I'm living in nightmares because of this situation, I have a HttpWebRequest.GetResponse that keeps on giving me a ThreadAbortException, that causes the whole app to go down. How can I avoid that, or at least handle it, would using Thread.ResetAbort() be useful in such a case? To explain more here is a rough code sample: HttpWebRequest...

IS it OK to use an int for the key in a KeyedCollection

Often times I need a collection of non-sequential objects with numeric identifiers. I like using the KeyedCollection for this, but I think there's a serious drawback. If you use an int for the key, you can no longer access members of the collection by their index (collection[index] is now really collection[key]). Is this a serious enough...

How to change cell's ComboBox style in DataGridViewComboBoxColumn

Cells in DataGridViewComboBoxColumn have ComboBoxStyle DropDownList. It means the user can only select values from the dropdown. The underlying control is ComboBox, so it can have style DropDown. How do I change the style of the underlying combo box in DataGridViewComboBoxColumn. Or, more general, can I have a column in DataGridView with...

How to stop worrying about using the best materials and just start learning .Net?

For the past few years whenever I learn something I tend to spend way too much time researching on the best materials for the subject than actually studying it. What should I do to get over this mentality? I am stuck. How to stop worrying about getting or using the BEST books, training videos and online materials on .net and just start l...

.NET components for real-time shipping quotes

When developing custom ecommerce solutions, which "off the shelf" .NET based shipping components have you had luck with? It absolutely must give real-time shipping quotes and be easily integrated into a ASP.NET website. Ideally I'd like it to support most of the common US domestic shipping companies (UPS, FedEx, USPS, etc.). Thank...

Diagnosing application hang in a production .NET desktop program

I have trouble. One of the users of an application I'm developing is occasionally, but regularly, experiencing an application hang. When this happens, we find an entry with a source of "Application Hang" in the machine's Event Log, with the informative message "Hanging application [my app], version [the right version], hang module hung...