.net

How bad is it to store class and assembly names in the database?

In brief: Is it ever excusable to have assembly names and class names stored in the database? Does it break the layers of an application for the data layer to have explicit knowledge of the internals of the business layer? Full explanation: I have a boot strapper that runs "jobs" (classes that inherit from a common base) that exist in...

How's memory allocated for a static variable?

In the below program Class Main{ static string staticVariable = "Static Variable"; string instanceVariable = "Instance Variable"; public Main(){} } The instanceVariable will be stored insided the memory allocated for object instance. Where will the static variable go, Is it stored in the object instance itself or some where else? I...

Is it possible to integrate AJAX toolkit into MVC applications?

How do I integrate AJAX toolkit into MVC applications in .net? ...

What is the best .NET obfuscator on the market?

What is the best .net obfuscator on the market right now? I realize nothing is fool proof, but some products are obviously better than others. ...

Does .NET assembly size affect performance?

Hi, Does the size of a .net assembly affect performance at all? How about the number of assemblies in your windows forms/web forms project? ...

C#: Load roaming profile and execute program as user

In an application I need to execute other programs with another user's credentials. Currently I use System.Diagnostics.Process.Start to execute the program: public static Process Start( string fileName, string arguments, string userName, SecureString password, string domain ) However this function does not load the roam...

Help me with that CrossThread?

This code is executed by many way. When it's executed by the form button it works (the button start a thread and in the loop it call this method = it works). BUT it doesn't work when I have a call to that method from my BackgroundWorker in the form. With the following code: private void resizeThreadSafe(int width, int height) { if...

How do I create a custom WPF control like a cartoon bubble with constant corners

I need to create a rectangle bubble with rounded corners with text inside, like a cartoon speech bubble. I need the bubble to expand horizontally and vertically depending on the size of the text it contain. I would like the speech arrow and the radius of the rounded corners to remain constant. I could simply use a path to create my bub...

How to write your own .net obfuscator

Hi, I am very curious as to how people write their own obfuscator. How hard would it be to simply do the following: rename all public methods with GUID type names. Where would I start? How would I go about reading the .net dll assemby, pulling the public methods out and renaming them? ...

Why do automatic properties require both getters AND setters?

In C#, if I declare an auto-implemented property, why do I have to declare BOTH the get and set part? i.e. public string ThisWorks { get; set; } public string ThisDoesnt { get; } Isn't this just syntactic sugar - i.e. the compiler inserts a private field for the property? So why the problem? Curious. ...

C# Console/CLI Interpreter?

I wonder if there is something like a standalone Version of Visual Studios "Immediate Window"? Sometimes I just want to test some simple stuff, like "DateTime.Parse("blah")" to see if that works. But everytime i have to create a new console application, put in my code and test it. The Immediate Window sadly only works when I am debuggin...

How would I insert data into an Access table using vb.net?

I want to insert a new row into an Access database. I'm looking at doing something like: oConnection = new Connection("connectionstring") oTable = oCennection.table("Orders") oRow = oTable.NewRow oRow.field("OrderNo")=21 oRow.field("Customer") = "ABC001" oTable.insert Which seems to be a sensible way of doing things to me. However...

COM Registration without Version Identifier

Is it possible to register a COM interface independent of assembly version? Right now I get a registry key like MyIfaceName, Version=1.0.3259.17799, Culture=neutral, PublicKeyToken=1234567890abcdef But since the assembly has auto-versioning (1.0.*.*), every day I do a new build the COM-iface needs to be re-registered. How would I re...

Annoying duplication in derived classes.

In every form we derive from FormBaseControl, we have the following code. I'm sure there is a better way to type the controller object than this, but at the moment we have it included in every page. In the example below, base.Controller is of type BaseController, from which ExportController derives. I find duplication of this code in ...

What tools are available to determine which .NET assemblies have changed since the last build?

With a seriously big .NET site/solution (100's of assemblies), are there any tools available to recognise which assemblies have changed since the last build (using something more intelligent than file dates that will always change). I need to change our deployment process to a) increment the version of changed assemblies and b) generate...

Is there a Collection that works like a Dictionary without the values?

I need a collection that works just like a Dictionary/Hastable in a sense that it will only contain 1 instance of a given object at any time. A generic class would be preferable, but I'll take what I can get. Does this collection live somewhere in the framework? ...

How to Debug .NET Mobile Device Application using multiple instances of Device Emulator

I would like to Debug .NET Mobile Device Application using multiple instances of Device Emulator. If I right click the project and go to Debug -> Start new instance in Visual Studio 2008 when an instance is already running I get the error Unable to copy file "obj\Debug\MyMobileApp.exe" to "bin\Debug\MyMobileApp.exe". The proce...

How to access each byte in a bitmap image

Hi, Say I have a bitmap image, is it possible to iterate through all the individual bytes in the image? If yes, how? ...

how do you pull in the html from a URL?

I have one site that is displaying html content that needs to be displayed on another site (first site is front end to content management system). So site1 page = http://site1/pagecontent and on site 2 (http://site2/pagecontent) I need to be able to display the contents shown on site 1 page. I am using .Net C# (MVC), and do not want t...

NUnit with night build, how to get errors easily?

We have a lot of unit tests but they aren't run every night. I have setup some batch files that compile all the code from the SVN repository and I would like to run NUnit. This is not a big problem because I can call it from the batch file after the compilation BUT the output is stored in the network drive and I need to open it every mor...