.net

software update

Hi. i want general idea about how to write the software update for an application? which technology is simple like VC++ or .Net?.. i just need the idea in brief. ...

.NET MVC Controller action not invoked by GET or POST from Flex app

A flex app running in a view of my .NET MVC app can load data fine from another route, but submitting data via either POST or GET never invokes the controller action. Interestingly, the only way I can get the action method to fire is by passing intentionally malformed post variables in the http request. Odd. Content type is application/...

Most Commonly used extensions and helper functions in ASP.NET C#

Hi guys, I am an ASP.NET C# web developer. The architecture followed is 3 layer The layers used are 1. UI 2. BLL (Sometimes Communicating with BLL is done using WebServices) 3. DAL Pretty basic stuff. What I would really like to have is a BLL.Common class in the BusinessLogics. Here I would like to use some useful extensions and help...

Error in Process.Start() -- The system cannot find the file specified

Hi, I am using the following code to fire the iexplore process. This is done in a simple console app. public static void StartIExplorer() { ProcessStartInfo info = new ProcessStartInfo("iexplore"); info.UseShellExecute = false; info.RedirectStandardInput = true; info.RedirectStand...

Running unit tests under Chess

When trying to run my unit test under Chess, it get the following error: Hosting rules specify that the test type 'Unit Test' cannot run in the host adapter 'Chess'. To run this test in 'Chess', change the hosting rules. To use the default test host for tests that cannot be run in the specified host adapter, change the te...

c# Reflection Problem

Hi everybody. I'm trying to use reflection for some reason and I got into this problem. class Service { public int ID {get; set;} . . . } class CustomService { public Service srv {get; set;} . . . } //main code Type type = Type.GetType(typeof(CustomService).ToString()); PropertyInfo pinf = type.GetProp...

how to LogOut in ASP membership

protected void Button2_Click(object sender, System.EventArgs e) //logout { if (System.Web.HttpContext.Current.User.Identity.IsAuthenticated) { System.Web.HttpContext.Current.Session.Abandon(); // it isn't logout >_< } } how to logout ? :P ...

Encrypting configuration information using protected configuration provider

When using a protected configuration provider to encrypt configuration information in a app config file, what encryption is used? What alogorithm and key is used to encrypt and decrypt the information? Update Ok, i've read the links provided by Sani Huttunen and read these here and here. So the RSAProtectedConfigurationProvider uses...

Why is there no ObservableKeyedCollection<TKey, TValue> in the .NET Framework?

The .NET Framework contains since version 3.0 the ObservableCollection<T>, but why isn´t there a ObservableKeyedCollection<TKey, TValue>. Okay i could implement my own collection by deriving from KeyedCollection<TKey,TValue> and implementing the INotifyCollectionChanged interface, but whouldn´t it be a good addition to the .NET Framewor...

hiding buttons in master page

Hi, I am working on an app where i am having some linkbuttons in master page. I want to display them depending upon the authorization given to them once they logs in. I have initially made all of them visible false and then i am checking the authorisation in the aspx.cs class of master page. I make the link button visible depend...

BindingList projection wrapper

Is there a simple way to create a BindingList wrapper (with projection), which would update as the original list updates? For example, let's say I have a mutable list of numbers, and I want to represent them as hex strings in a ComboBox. Using this wrapper I could do something like this: BindingList<int> numbers = data.GetNumbers(); co...

.NET class for holding and manipulating binary data

Is there a class in the .NET BCL that can store a block of binary data and that allows you to easily add and remove bytes to/from it? ...

Should one use DI on POCO classes when doing DDD?

Say I have a nice domain model, using (constructor) DI where needed. Now I want to be able to persist this model, so I start adding infrastructure(Entity Framework) to do this. What happens now is that the persistence framework should be able to initialize your types using your IoC container. Maybe this is possible, maybe not. Anyway, w...

Is there a performance improvement with native images?

I've tried to measure it with a small benchmark collection and my own tests, but the results stay the same or even get worse. I also couldn't find any benchmark data on the web to this question, so here it is: Is there really a performance improvement if I install native images of .NET assemblies? And if yes, in which areas and is it re...

.net, built in way to get directory name from path?

Given the following directory: string fullpath = "C:\MyDir1\MyDir2\MyDir3"; I would like to return "MyDir3" - this being the directory name (not full path, of a directory) , I know I can do this using string manipulation, but is there an easy (built in way) to achieve this using framework classes? Thanks ...

Protobuf-net - serializing .NET GUID - how to read this in C++??

Hi All. I have serialized an object using Protobuf-net , in my .NET application, with relative ease. I also get the .proto file that protobuf-net generated, using GetProto() command. In the .NET generated .proto file, my GUID fields get a type of "bcl.guid". Now I wish to compile the .proto file in C++ so I can deserialize the data. ...

How to give enum values that are having space

i have to create an enum that contains values that are having spaces public enum MyEnum { My cart, Selected items, Bill } This is giving error. Using concatenated words like MyCart or using underscore My_Cart is not an option. Please guide. Thanks in advance. ...

Using MemoryStream to save .docx file C#

I've some trouble to upload file from Memory Stream to database (it's visible in DB as 0x so i guess it doesn't get saved properly). I am not sure whether it's a problem with Stream being created or save to db from stream should be done differently. private void test { byte[] storage = new byte[500000]; using (MemoryStre...

StructureMap ObjectFactory.Reset memory leak?

Here's the simple test to reproduce the issue, this is the single class in the whole project and there are no other references: [TestFixture] public class ObjectFactoryTests { [Test] public void ResetMemoryLeak() { for (int i = 1; i < 1000; i++) { ObjectFactory.Reset(); if (i % 10 == 0...

Inbuilt Regex class or Parser.How to extract text between the tags from html file ?

I have html file in which there is table content and other information in my c#.net application. I want to parse the table contents for only some columns.Then should I use parser of html or Replace method of Regex in .net ? And if I use the parser then how to use parser? Will parser extract the inforamation which is between the tags? I...