.net

Using Someone else's COM Interop DLL

Hi, I'm trying to use an API that my client has a license to. I was given a COM Interop DLL. I can write all of the code I need, but when I go to run it, I receive the following error: Retrieving the COM class factory for component with CLSID {73C527F2-C6C0-4F4B-92F7-1448EC342FC5} failed due to the following error: 80040154. Any idea...

Executing QTP automations from a .NET class, without starting an instance of QTP

Does anyone have experience building a .NET test execution harness that can execute the logic in existing QuickTest Professional VBScript automation scripts, but without starting an instance of QTP? We are in the process of transitioning to Visual Studio 2010 and the related test management tools, but we can't (justifiably) throw away o...

IIS7 - 500 Error Code

On a Windows Server 2008/IIS 7.5 environment, when I browse to a ASP.NET web site, I get the following error in the IIS log file: 2010-06-28 22:18:46 192.168.50.43 GET /TimeSheet - 443 - 192.168.50.41 Mozilla/4.0+ (compatible;+MSIE+8.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729...

Is it possible to master C# and .NET Framework to a point that nothing is new?

I'm started to learn C# and .NET framework in this month. My question is pretty simple: can someone master C# and the .NET framework to a point that there's nothing new to learn? Please, post how much time have you been programming in C# and .NET if you consider yourself at this point. Once I read an article that entitled: teach yourse...

RegEx Help.. something wrong in my pattern...

I'm looking to match this pattern: ((##.##.##)) Any series of Numbers/Decimals, surrounded by "((" and "))", and preceded by one whitespace There can't be any characters in the middle except digits and periods. Right now I have "\s(\(){2}[\d\.]+(\)){2}" but i'm not getting any matches... ...

Thread.Abort doesn't seem to throw a ThreadAbortException because of AcceptSocket

I am calling ChannelServer.ListeningThread.Abort on the following thread, however nothing seems to happen. I would like to be more specific, but I can't think of anything more. There seems to be no ThreadAbortException that is thrown, and this exception should be thrown regardless of the blocking listener (it works perfectly on threads t...

Entity Framework - Entity Mapping problem

I have two tables: Address and Contact which are joined on contactID (in Contact). Both of these tables have entities in my Entity data model (EF 4.0) and I do not wan't to modify them. I do want to create a new entity that contains information from both entities. What I did so far: In CSDL: <EntityContainer...> <EntitySet Name="...

AppFabric vs Unity vs Memcached or possibly any other multi server caching mechanisms

Hi, I am currently in the process of investigating the various different caching mechanisms out there whether they be free or at some cost (minimal preferably). The situation. Currently we have to load-balanced servers that host our web application with a third server being an SQL server. This site is a eShop, and it gets hit quite reg...

Custom Attributes and Type Checking

As I havent seen an answer to this question in my Google and site searches I thought I would pose it the great minds on this site. As C# does not support generic attributes (which does make sense), I was wondering if there is a way to restrict the type of an argument/property to the attribute based on the type it is decorating. Example:...

Side menu in window form in .net

How do I create side menu in .net windows application? Is there any possible way to implement this using MDI or should I use some kind of splitter control? Or if you may know to do it with devexpress control, it would be nice too. ...

EF4 "Code Only" - How to set default value for POCO's

In Entity Framework 4, Code Only (CTP3), how do you set a default value for a property in the POCO's EntityConfiguration class? public class Person { public int Id { get; set; } public string Name { get; set; } public DateTime CreatedOn { get; set; } } public class PersonConfiguration : EntityConfiguration<Person> { public PersonCo...

Adding huge number of items to a Listview

I have a listview, which is used as an index to a simple search application. Each item of the index is a word, and clicking on the item will add that item to the search textbox. The user can first click on any of the words she/he prefers to and them to the search textbox and then click search, to search in the documents. The problem is t...

Is stacktrace information available in .NET release mode build?

If I choose release mode to build a dll, is the stacktrace information still available? If so, then what information is unavailable in release mode? ...

msdn: What is "Thread Safety"?

In many MSDN documents, this is written under the Thread Safety heading; "Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe." for example; here can someone explain it please in a rather simple way? Thank you :) ...

Static content caching

We are using IIS7 and dotnet 3.5 in our company to build different web applications used by our internal as well as external customers. It has been recommended that we start using static content caching to cache image and html files. My understanding is that in web.config file we can set the cachecontrolmaxage to specify the number of d...

What is the difference between pInvoke and COM Interop?

Let us say that I am accessing a third-party library, for which the documentation states that I can use pInvoke or create an interop library and use COM. What is the difference between these two techniques, and why might I choose one over the other? ...

How to get the current cursor from a WinForm WebBrowser control?

I'm having problems with getting the current cursor from the WinForm WebBrowser control. It's always returning the Default cursor. Mouse cursor changes depeding on what element it currently is on. If it's over a link then the Cursor changes to "Hand"; if on a TextBox then it becaomes an "IBeam". So, I want to somehow get that informatio...

Changing the Header value in Grid View

Using VS2005 I am using Gridview in my web page, when i load the web page, the table header also displaying in the GridView. So i want to give my different header name in datagridview. So how to change the setting in datagridview. ...

How to Print any document in a SELECTED printer

I would like to print any document such as pdf,word,excel or text files in a selected printer using .net .I have got success to do such printing in the default printer .The only issue now is to print in the selected printer. Here is the code for the printing. public bool Print(string FilePath) { if (File.Exists(FilePath)) {...

File upload HTTP PUT in C#

I am writing a desktop app in C# for upload large sized files on a webserver using HTTP PUT. I have tried libcurl .net but it seems the bindings seem pretty difficult to use. Is there a better and easier way? PS: My server is nginx. I believe HTTP PUT is the best way but if there is a better alternative available on nginx, I can use th...