.net-3.5

I need an app.config file to be used by an assembly at assembly initialization

How do I ensure that an app.config file gets read on assembly initialization, for .Net 3.5-4 ? It's a class library assembly. VS2008 provides a menu to add an app.config file, but it's ignored so far. I need to use the app.config to provide information for logging from the assembly. Thanks in advance! ...

Removing the "d" object from ASP.Net web service json output

I have some javascript code that processes json output from asp.net web services built with framework 2.0. Now I need to support data returned from framework 3.5 web services. My javascript code assumes a list of objects as return value, which works fine in 2.0. However In framework 3.5, the list is wrapped in a "d" object. Is there an...

Is there a built-in way to compare IEnumerable<T> (by their elements)?

I would like to compare lists of elements of a given type, to see which list is "bigger". new BuiltInComparer<IEnumerable<int>>().Compare( new[] {3,2,3}, new[] {1,2,3}) ...would return 1 new BuiltInComparer<IEnumerable<int>>().Compare( new[] {1,2,3}, new[] {1,2,4}) ...would return -1 etc Is there any such built i...

How Do I get the current instance from an AppDomain?

Hi, I use the default appdomain (AD) which I use to create new appdomains (AD1) when required for running plugins in isolation. When creating the new domain I also wire up the AppDomainUnload event to allow me to call clean up code etc. The issue I seem to have is: 1) Create AD1 from AD 2) Run code in AD1 3) Call AD.Unload(AD1) The ...

SPUtility.TransferToSuccessPage - is there a possiblity to add new line inside message?

Hi, I'm using in WSS 3.0 SPUtility.TransferToSuccessPage method. Do anybody know is there a way to add new line in output message? Can you tell me how? Best Regards T.S. ...

availability of Win32_MountPoint and Win32_Volume on Windows XP?

From the MSDN articles I've found -- http://msdn.microsoft.com/en-us/library/aa394515(v=VS.85).aspx -- Win32_Volume and Win32_MountPoint aren't available on Windows XP. However, I'm developing a C# app on Windows XP (64bit), and I can get to those WMI classes just fine. Users of my app will be on Windows XP sp2 with .Net 3.5 sp1. Goo...

Receive XML via POST with ASP.NET

I have to set up an XML "web service" that receives a POST where the 'Content-type header will specify “text/xml”.' What is the simplest way to get the XML into an XDocument for access by VB.NET's axis queries? I don't believe the web service is guaranteed to follow any protocol (e.g. SOAP, etc); just specific tags and sub-tags for var...

Is it possible in .NET 3.5 to specify an enum type?

I have a enumerator which map to a bunch of int example enum MyEnum { Open = 1, Closed = 2, Exit = 4 } I find though that when I want to assign this to an integer, I have to cast it first. int myEnumNumber = **(int)** MyEnum.Open; Is it possible to specify the type of an enum so that it is implicit that there is a integer assigne...

Best Control for date input and validation in ASP.NET 3.5

Is there any other good control for date field input apart from CalanderExtender of AJAX Control Toolkit? ...

.NET compact framework backward compatibility 3.5 and 2.0

Do I need to install .NET 2.0 on the device, where .NET 3.5 is installed? So far my application works on .NET 2.0 (which potentially should be faster) but the long term plan is to port it to .NET 3.5. I need to order devices and the OEM needs to know which version of .NET should be added to the Windows CE image (version 5.0). Shall I a...

WCF Service Memory Leaks

Dear Devs I have a very small wcf service hosted in a console app. [ServiceContract] public interface IService1 { [OperationContract] void DoService(); } [ServiceBehavior(InstanceContextMode=InstanceContextMode.PerCall)] public class Service1 : IService1 { public void DoService() { } } and its being called as ...

Field validators in asp.net

Is it possible to have "Required Field Validator" controls to validate more than one field (example I have 12 textboxes that are required. I want to try an avoid having 12 RFV controls. If a validation does get triggered, is there a way to display a customized message ("textA is empty" or "textB is empty") etc.? ...

Is there a way to make this C# method shorter and more readable with the help of Linq?

The following works, but I figured - since it is all based on IEnumerable, Linq can come handy here is well. By the way, is there an equivalent to Directory.GetFiles() which would return an IEnumerable instead of the array? If it exists, then would it make the code run any faster? The last part of the question is inspired by Python langu...

Trying all permutations

For my program, I am trying to assist the user, and reduce his or her work load. There are four input numbers. There is also an indeterminate amount of numbers they can be applied too. For example, they four input numbers could be {4,7,3,2} and the numbers they can be applied to are {4,9,23} The result should be: 4 (input) was applied...

What would be the best .NET 2.0 type to represent .NET 3.5 HashSet<T>?

I'm writing myself a class library to manage Active Directory. I have an interface: Public Interface ISourceAnnuaire(Of T as {IGroupe, ITop, IUniteOrganisation, IUtilisateur}) Readonly Property Changements As Dictionary(Of T, HashSet(Of String)) End Interface This Changements property is used to save in memory the changes that oc...

Application security issues to consider

I am working on the design of a high security application (involving financial information, personal information etc). I need to identify what security measures (application level) will be implemented. The application will involve sending data to and from a database, user login, import export to csv, txt files, and print function. What ...

Creating a Non-Databound Report in Winforms

I am using Visual Studio 2008 and all the components that come with it as well as Infragisitics for Winforms. I need to design a label that will print to a label printer. None of the controls are databound and will most likely be set in code eg/Label.Text = "My Heading"; as there will be minimal information on the label. One piece of...

Forcing an app to run single core only?

I have this strange issue with some third party DLL's. The third party provider references some open source DLL's that have a memory exception whenever I try to use a certain method. This issue does not appear when the app is run on a single core machine, but obviously we cannot assume a user will have that. Is there a way to force an ...

How to block the possibility to add the same record to a SPList?

Hi, Is there a possibility to block chance to add the same data to SPList? I know that two records always are different regarding the ID field. I would like to validate other custom fields added previously by me, and don't allow of adding same field's value. Can anybody tell me how to implement this? I can guess that event receivers cou...

Troubleshooting .NET "Fatal Execution Engine Error"

Summary: I periodically get a .NET Fatal Execution Engine Error on an application which I cannot seem to debug. The dialog that comes up only offers to close the program or send information about the error to Microsoft. I've tried looking at the more detailed information but I don't know how to make use of it. Error: The error is visi...