.net

Is it possible to automate a ClickOnce deployment ?

I work on a project consisting of a server and a client application deployed via ClickOnce. The client is installed the first time an user clicks a http://...file.application link, and the interaction with the user during installation are minimal (just the standard ClickOnce install/don't install dialog box). One of our client wants to...

How can catched exception be null (not NullReferenceException)?

Hey I have run into a rather weird little problem. In the following code I can not understand how e can be null; try { //Some Code here } catch (Exception e) { //Here e is null } As far as I know, throw null will be converted to throw new NullReferenceException(). The problem seems to be related to multithreading, as removi...

Secure Password Hashing

I need to store a hash of a single password in a .Net WinForms application. What's the most secure way to do this? In particular: Salt, HMAC, or both? How much salt? How many iterations? What encoding? (The password is plain ASCII) I assume that the algorithm should be either SHA512 or HMACSHA512. ...

Clarification about generic types

Given the code block below (source: http://www.asp.net/learn/mvc/tutorial-31-cs.aspx)... I receive this error: Using the generic type 'System.Collections.Generic.List' requires '1' type arguments I can pacify this by simply modifying my declaration to read as: var groups = new List<string>(); Is this just a case of invalid syntax in the...

Array class not rendering into datagrid

The following application is not rendering the information that I am getting back from a web service into the datagrid. I know I am being able to connect to the webservice because I am getting the count for the class array. I am being able to get a Response.Write but when I try to pull all the information from the array class I haven't ...

How to transliterate Cyrillic to Latin text

I have a method which turns any Latin text (e.g. English, French, German, Polish) into its slug form, e.g. "Alpha Bravo Charlie" => "alpha-bravo-charlie" But it can't work for Cyrillic text (e.g. Russian), so what I'm wanting to do is transliterate the Cyrillic text to Latin characters, then slugify that. Does anyone have a way to do ...

NullReferenceException mystery

...

C# Dictionary: Each Key Has An Identical Value - Can I Remove the Redundancy?

Consider the following code, where each key has an identical value: IDictionary<string, string> quarterbackDictionary = new Dictionary<string, string>(); quarterbackDictionary.Add("Manning", "Manning"); quarterbackDictionary.Add("Brady", "Brady"); quarterbackDictionary.Add("Rivers", "Rivers"); My question: Can I remove the redu...

C# (.NET 3.5) Is there any way to get this function name?

I have a function that wraps a call to one of my socket types. If there is an error, I want to be able to print a warning and retry. In the warning, I want to have the method name. However, it was declared as a lambda. Is this even possible? How I call the function (assume in function called myMain): SafeSocketCommand(() => this.mySock...

Adding AllowPartiallyTrustedCallers with MSBuild

I am using CC.Net with MSBuild tasks to build an application that is composed of a number of solutions and projects. We are using the AssemblyInfo MSBuild Community task to update version info in AssemblyInfo.cs. Unfortunately the AllowPartiallyTrustedCallers attribute doesn't get in and the AssemblyInfo task tells me that the AllowParti...

Does .NET FTPWebRequest Support both Implicit (FTPS) and explicit (FTPES)?

I am being asked to support implicit and explicit FTPS (also known as FTPES). We are currently using the .NET FTPWebRequest. Does the FTPWebRequest support both types of FTPES, and what is the difference. Thanks ...

How to get the associated icon from a network share file

I am using Icon.ExtractAssociatedIcon to get the icon of a file , that a user selects, in an openfiledialog. THe problem is if the user selects an icon from a network share then the filename property of the openfiledialog is in UNC format and this causes an exception in ExtractAssocaitedIcon So my question is given a file specified as \...

How to write this linq query?

I have a first query that returns a set of entities: var resultSet = ....query....ToList(); which would return A, B, C, D, E The entities inside this set are organized into chains because they have a reference (prevEntityId) pointing to the same type of entity, i.e.: A -> B -> D C -> E I would like to write a second query so that ...

looking for an idea for a .net web app with video chat

Hello all, I'm looking for an idea for a final project in .net. I thought about building an IM AJAX app with .net but am kind of getting the feeling that the only way to do the video/audio chat is with flash and action script... I have 4 month to do the project and the idea that in that time i will have the ability to learn a new lang...

Enterpise Library 4.1

I'm using enterprise library 4.1 and i wish to create different log files for different event types. eg. Error.log for Error events, Warning.log for Warning events, how can accomplish this ? thx ...

.NET Project Architecture

Hi, I have sort of a philosophical question, which also need to consider the performance impact. We are designing a new system with many sub-services that are not related to each other, yet, some may use each other (We are using unity to avoid any decoupling). My main question is: Should we break them into separate DLL's, where each ...

How do I reject a change in an editable Xceed Wpf DataGrid cell?

I have an Xceed DataGridControl on a WPF Window with a few columns that are data bound to a DataTable. The UpdateSourceTrigger on the grid control is set to CellContentChanged so that the binding source updates as soon as a cell's content changes. <Window x:Class="Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/prese...

AppDomains and configSections

We are using CSLA (a rather ancient version) in our .NET 3.5 applications, and we make use of it's NetRun application loading for some of our users. For those not familiar with NetRun, NetRun.exe is basically an application "runner" that is installed on user computers (e.g. to c:\Program Files\NetRun\NetRun.exe). The user simply starts...

Why cannot C# generics derive from one of the generic type parameters like they can in C++ templates?

Why cannot C# generics derive from one of the generic type parameters like they can in C++ templates? I mean I know it impossible because CLR does not support this, but why? I am aware of the profound differences between C++ templates and C# generics - the former are compile time entities and must be resolved during the compilation, whi...

Is there a general concrete implementation of a KeyedCollection?

The System.Collections.ObjectModel.KeyedCollection class is a very useful alternative to System.Collections.Generic.Dictionary, especially when the key data is part of the object being stored or you want to be able to enumerate the items in order. Unfortunately, the class is abstract, and I am unable to find a general concrete implementa...