.net

How to implement Intuitive website URL using .NET plateform ?

Hi, I'm trying to implement a "restful" application using ASP .NET 3.5 but it seems that I need to use MVC .NET. Is that the only solution? For instance, I would like something like: /api/nab/(version)/(slug) I'll be happy to know how you manage to do that. ...

Sort the generic list and allow two names always to be on top and rest sorted

private List nodes = new List(); there is a label field inside ISilverNodeModel class of type string. suppose the nodes list is: Malcolm, Sym, Eric, Sandrea I want malcolm and Sandrea always on top and rest to be sorted. I am doing this but it sorts all : nodes.Sort((node1, node2) => node1.Label. ...

Why does my installed application fail to run?

I've got a .NET 3.5 Application that was working well. The installation was also working and the application functioned properly after installation. I've fixed a few bugs and rebuilt the setup but now I can't get the installed application to run. I'm completely removing the old install, re-installing and when I run it I get the: Data ...

WCF service with ConcurrencyMode.Multiple and InstanceContextMode.Single behavior and multithreading safety

I have a service configured with following attributes [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.Single)] public class UserService : IUserServiceContract {} Should I use in this scenario locking mechanism for methods implemented in the service? If yes, is this the proper im...

What concept is used in .net for creating mobile software?

I know in java we are using j2me for developing mobile software. What is the equivalent in .NET? What would be the best way to learn it? Can I also get book recommendations for a beginner? ...

Regular expression to match any empty line or any line starting with a specified character

Given the following input... ; ; comment ; another comment ; data data I am looking for a regular expression that can be used to strip the blank lines and return only the two lines containing the "data" (but leaving the line breaks intact). Thanks. ...

Why isn't there a "set" interface in the .NET framework?

I'm thinking specifically about the generic class HashSet<T>. It implements several interfaces, but none exposes the correct semantics of a set. Specifically, none supports an Add method returning bool. (ICollection<T> supports void Add, which can be used in a pinch.) Also unsupported by these interfaces are common set operations like un...

DotNetOpenAuth authentication

Does DotNetOpenAuth still redirect users to provider website i.e.( (OpenId) for authentication and authorisation from OAuth) ...

Nullable Type implementation without nullable feature of C#

How can we implement a nullable type in C# if we didn't have this feature in C#? ...

TFS 2008 server time

Is there a way getting the tfs server time, i didn't find any method in the API which give such functionality. i have try many ways but failed to find a solution. thanks in advance , EA ...

Using vs lambda.

Is it equivalent? public static void Using<T>(this T disposable, Action<T> action) where T:IDisposable { try { action(disposable); } finally { disposable.Dispose(); } } new SqlConnection("").Using(conn => { ...

How do I download a file in vb .net with a download timeout?

I want to download thousands of files from the web and save them locally. What is the most efficient way? It is important the failures timeout within 10 seconds. Is there a better way to stream one stream into another? Maybe a smaller buffer, like 1024 bytes at a time, is more efficient for large files? Dim w_req As System.Net.HttpW...

Excel xml spreadsheet - is it possible to embed images?

I'm trying to export data from a web app into excel, but there is a request to include the company's logo at the top of the spreadsheet. My normal method of creating the excel is to create a spreadsheet in excel and save it as an Xml Spreadsheet (Excel 2003). This allows me to build up the xml in code. However, when attempting to save t...

Solution rebuild fails using MSBuild in command line but Visual Studio rebuild works fine

I'd like to rebuild my solution using MSBuild in command line. So far I'm using this command C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe d:\WorkCopy\AppServer.sln /t:Rebuild But when I've changed or deleted a file the rebuild fails. I'm getting the following error code Ulohy\GetUlohy.cs(27,33): error CS0246: The type or namesp...

User interactive Drawings

Hello all I want to draw at my winforms application some CAD drawings. Also I will need some parts of the drawings from them be a user interactive (Interactive with the mouse) . Any idea what technology should i use for drawings here ? Thanks . ...

Expression of type 'System.Int32' cannot be used for return type 'System.Object'

I am trying to produce a simple scripting system that will be used to print labels. I have done this in the past with reflection with no problem, but I am now trying to do it with Lambda functions so that I can cache the functions for reuse. The code I have so far is as follows... public static string GetValue<T>(T source, string prope...

Unique List<T> in .NET 2

What is a (preferably generic) unique(IComparable/IEquitable) valued collection (à la List<T>; ideally a equivalent to HashSet<T> in .NET 3.5 without ordered items) of objects for .NET 2? ...

Entity Framework - Scoping context in a web app

Hi I have implemented a simple repository pattern for the Entity Framework in a web app. I have several repositories which all subclass a base which has some common methods in The base looked like this public class BaseRepository<TEntity> : IRepository<TEntity> { protected readonly RedirectsEntities Context; public BaseRepos...

How do I know if the machineKey section from my machine.config is being used?

Hi, I'm trying to generate a custom key for encrypting the web.config in a project, and use the same key on several machines. I've followed this example from Microsoft: http://support.microsoft.com/kb/312906 However, when I encrypt my web.config (and I'm using cassini, not IIS, on my machine) it doesn't seem to use the newly created ...

How can I get the group memberships for an AD user - including all groups in other domains?

I have tried the below LDAP search, but it only gives me the group membership for the domain the user is in. I need it to include also the memberships of the foreign security principals. public static List GetGroups() { List oGroups = new List(); string vLDAPPath = "GC://dc1.dom1.local/dc=dom1,dc=local"; string vFilterUser = s...