.net-2.0

Running .NET 2.0 & 3.5 web sites in IIS 7

I heard there is a problem or a certain way you must setup IIS in order to run both .NET 2.0 and .NET 3.5 sites concurrently? We don't see a .NET 3.5 option in the dropdown when configuring the site framework. ...

HashTable .Net exception of null instance

I'm using .Net 2.0, and I've run into a strange error: I have a hashtable using string as keys and a class (named Market) as the value. The class contains 4 integers and 1 byte. One of the integers represents a counter which I need to increment. I have only one element in the hashtable. It's key is "Tomo". I do this: string strM =...

How do I reference an assembly once for all projects in a solution

I have several solutions, each containing multiple projects, that all need to reference a single assembly, say, lib.dll. This contains common classes and functionality which needs to be accessed between all the solutions; and I can't bring all the projects into one solution as my manager wants to be able to use different versions of li...

Correct InstallUtil Path To File Syntax?

I'm trying to install a Windows Service using a batch file, let's call it "installservice.bat". Inside the file I have the following commands: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe -i ".\MyService.exe" pause When I excute the batch file (running as administrator on Vista) I get this: Exception occurred whil...

Problem calling WCF service through https

Hello, I have recently implemented SSL on a WCF service. I deployed it on a IIS server, which is on another machine of the network (my developer machine doesn't have IIS, so i can't test locally). Whenever i try to call the WCF service, i'm having the error: "CommunicationException... failed... ask for cross-domain policy... which acc...

Refactoring help with Ifs

I've been working on this code for awhile and for some reason all the if's are driving me crazy along with a bunch of repeated code. Is there a nicer more cleaner way to do this? public Program(string[] args) { try { WriteToLogFile("Starting ImportTask"); if (args.Length == 0) { ...

How to connect .NET with sql database?

Hello, I currently have Visual Studio 2005 and SQL Server 2005. I have installed an empty database into SQL Server, but I don't have any idea how to use VS to connect with the database. What kind of project should I use (I'm going to use the database in a windows application) and exactly how will I be able to insert it to the project an...

Tracing is not working on a .NET 2.0 web service

I have a web service written with Visual Studio 2005. My web.config file contains this: <system.diagnostics> <trace autoflush="true" indentsize="4" /> </system.diagnostics> But any call to System.Diagnostics.Trace.WriteLine is ignored. When I step through my code, those lines are skipped over. Is there another way I should be t...

Similar classes with different signatures

I have two classes: Public Class Subscribing Private _subscribingObjects As IList(Of String) Public Sub Add(ByVal obj As SubscribeObject) '...code...' End Sub Public Sub Remove(ByVal index As Integer) '...code...' End Sub End Class Public Class Providing Private _providingObje...

Can I stop a program during execution any other way than by throwing an error?

Is there a command that will stop the execution of my program? I have a service that is processes an exchange account via telnet every 10 minutes. During one point of execution the application could possibly have a response from the telnet session when there are NO e-mails in the folder, which would look something like this: * 0 EXIST...

How to sort an array containing class objects by a property value of a class instance?

Possible Duplicate: How to sort an array of object by a specific field in C#? Given the following code: MyClass myClass; MyClassArray[] myClassArray = new MyClassArray[10]; for(int i; i < 10; i++;) { myClassArray[i] = new myClass(); myClassArray[i].Name = GenerateRandomName(); } The end result could for example look ...

How can I expose a .Net 2.0 Webservice to a Silverlight client?

I have a trivial .Net 2.0 SOAP web service. I want to access it from Silverlight application that is hosted on the same server, but different port. I know that for this to work I need to provide a clientaccesspolicy.xml or crossdomain.xml policy file (the service is available at http://example:8085/RemoteObject.rem?wsdl , so the policy f...

XPath with Yahoo API

I have been scratching my head trying to figure out how to use C#/XPath/SelectNodes to extract nodes from a Yahoo API XML result. I essentially have the same problem as stated under C# XmlDocument SelectNodes as well as under SelectNodes not working on stackoverflow feed The point I'm stuck on is understanding exactly what to use as t...

How do I use Reflection to set a Property with a type of List<CustomClass>

There is already a similar question but it didn't seem to ask about the situation that the question implies. The user asked about custom classes in a list but his list object is of type string. I have a class Foo that has a list of Bars: public class Foo : FooBase { public List<Bar> bars {get; set;} public Foo(...

WCF with .Net 2.0

We need to implement a WCF service on a machine that can only run .Net 2.0. The machine is a Windows XPe POS terminal, and we have not found a way to install .Net 3.0. We can't really format it with a new XPe image because there is a proprietary POS application and drivers installed. Is there any way to do implement a WCF service on ....

ASP.NET 2.0 web site gets ThreadAbortException

We're running a web service as a web site project. Clients make requests which return after a few seconds, but which spawn a thread that should run for hours. The thread makes web requests and writes to a database, and is throttled with Thread.Sleep calls. After running for about 20 minutes with several threads running, all the thread...

How should you diagnose the error SEHException - External component has thrown an exception.

Whenever a user reports an error such as 'System.Runtime.InteropServices.SEHException - External component has thrown an exception.' - is there anything that I as a programmer can do to determine the cause. Scenario : One user (using a program my company wrote) has reported this error. This may or may not have been a one off error. Th...

Using the Subversion revision for the ClickOnce publish revision?

I'd like to set the ClickOnce publish revision to the Subversion revision of the code's repository — e.g. 3.1.9.2453 for version 3.1.9, based on SVN r2453. Now, for the assembly version, I know I can use TortoiseSVN's SubWCRev.exe to generate AssemblyInfo classes that contain the build revision. However, it's not quite as simple with Cl...

REST services with .Net 2.0 framework & REST consumption in javascript..

Hi, as per wikipedia terms REST is REST can be considered the architectural style for the World Wide Web. The architectural style was developed in parallel to the HTTP/1.1 protocol, based on the existing design of HTTP/1.0 REST practices started long time ago along with HTTP evolution. If i understand the defenetions c...

Common Library and the System.Configuration namespace.

Here is the setup: We have a common library that I've developed that is used by all developers on any new applications or more than trivial changes to old applications. When we make a change, we up the minor version number (2.0 to 2.1) if the API is not broken, but if we break the API then we up the major version number...