.net

Are there any performance considerations from referencing a 5MB .Net assembly?

Today a co-worker mentioned he had issues with a large "enterprisey frameworky" project that when compiled was 5mb in size. The concern was that to use a even a small piece of functionality of the assembly you had to reference the entire thing and that is bad for some reason. I'm wondering if there are any performance or other disadvan...

Json.NET - How to serialize a class using custom resolver

I want to serialize this class: public class CarDisplay { public string Name { get; set; } public string Brand { get; set; } public string Year { get; set; } public PictureDisplay[] Pictures { get; set; } } public class PictureDisplay { public int Id { get; set; } public string SecretKey { get; set; } publ...

Stopping a third party assembly from accessing resources

We have a third party library referenced in our project, but without access to the source I don't really know what it's doing under the hood and there's too much code to check it out with Reflector. Is there any easy way to completely sandbox it so it can't access the file system, network, registry etc.? I'm trying to get up to speed w...

Does MVC 2.0 model binding work with Ajax requests?

i'm just sending a normal POST request using Ajax.BeginForm... i output the form elements using the .TextBoxFor and .HiddenFor etc... all as i should... and when it's posted via ajax to my action method, the object in the action method (named "Comment") is not populated with the values! Am i missing something? here is the relevant part ...

How and when shell I use: Magick.Init and Magick.Term methods?

It seems that Magick.Net doesn't have a really documentation. I see in the home page example the use of Magick.Init and Magick.Term methods: static void Main(string[] args) { MagickNet.Magick.Init(); MagicNet.Image img = new MagicNet.Image("file.jpg"); img.Resize(System.Drawing.Size(100,100)); img.Write("newFile.png"); ...

Running UI components in a service silently

I have a component, which silently retrieves some data from web using .NET WebBrowser component. It is written so that it will not show any dialog boxes, or any other interactive UI components, but since it is a form component, I need to create a form and STA thread to host it. I'm then starting it using Form.ShowDialog() This works per...

looking for sugestions on how to get started with embeded xp

In the past I have worked with the microchip PIC family, but I would like to broaden my horizons by working with XP embedded systems, and I am looking for suggestions on where to start. ...

how to hold the invalid value for NumericUpDown after it loses focus?

.NET 2.0 is used in my project. In my project there is an UserControl which includes a NumericUpDown ctrl, and its valid value range is from 10 to 100, so if user inputs 200 in NumericUpDown ctrl, then its value will changed to 100 automatically after the focus changed to other ctrl, it looks a little bit curious for customer, because...

System.Net.WebClient request gets 403 Forbidden but browsers do not with Apache servers

An odd one, I'm trying to read the <Head> section of a lot of different websites out there, and one particular type of server, Apache, sometimes gives the code 403 forbidden. Not all apache servers do this, so it may be a config setting or a particular version of the server. When I then check the url with a web browser (Firefox, for exa...

Guid.NewGuid().GetHashCode() for DB

Would this be reliable for using as an ID for data storage(SQL Server)? I would use a guid but I prefer a numeric value. ...

Silverlight and WCF: NotFound error!

Hi there, I have WCF method like so: public string GetSomething(MyObject obj) { return "Something"; } When I call this from my silverlight app I get an error: System.Net.WebException: The remote server returned an error: NotFound..... I call the method from my silverlight app like so: mProxy.GetSomething...

Web Reference Code generator template.

I Have an internal SOAP Web service that is being called from an external REST service in .NET it works fine however I am simply passing through the SOAP objects of the REST Layer but the automatic generation of the WebReference Code in Visual Studio adds the 'field' to the end of every attribute. basically it makes my XML look all nas...

Remove readonly of Folder from c#

How can i programatically remove the readonly attribute of folder from c# code ? ...

.Net Application to capture image from pda camera

I need a .net application to interact with pda's camera so that with save button (in my application) i can save in sql server, with zoom button(in my application) i can zoom the image. ...

.net c # : Creating a Async Process.

Hi , I am creating a Console Application, in that I need to Call a Method, that will do a list of JOBS. But I want that Method does not have any impact on Main Application, It will just do it's jobs.. that's all. ...

Mismatch in object size returned by sos.dll and in-memory process size.

Hello, I have used the following sos command to enumerate all instances of a particular type in a running asp application (hosted on windows xp 4 GB machine). .foreach (obj { !dumpheap -type ::my type:: -short ::start of address space:: ::end of address space:: }) { !objsize ${obj} }. This enumerates all objects of the given type in ...

Taking screenshot of a webpage programmatically

I want to take sceenshot of a webpage programmatically given the URL as input. And here is what I have till now: // The size of the browser window when we want to take the screenshot (and the size of the resulting bitmap) Bitmap bitmap = new Bitmap(1024, 768); Rectangle bitmapRect = new Rectangle(0, 0, 1024, 768...

System.Diaganostics.Process.Id Isn't the Same Process Id Shown in Task Manger. Why?

I'm using c#'s System.Diagnostic.Process object. One of its properties is Id. The Id this produces is not the same as the PID, shown in Windows Task Manager. Why is this? You see, once this process is started. It launches two other unmanaged processes, for which I can't explicitly get IDs for by object property references. I have to sea...

How to make thread-safe calls to windows forms controls.

Yes, I have read about the MSDN article: How to: Make Thread-Safe Calls to Windows Forms Controls It said I should use async delegate to make the call. But why does the async delegate make the call safe? I only know the how-to but not the reason. Could someone shed some light on me? Many thanks. ...

How do you control a .NET checkbox from AutoHotKey?

I have a .NET application that contains a checkbox (System.Windows.Forms.Checkbox). This component (WindowsForms10.BUTTON.app.0.378734a1) is not directly controllable in AutoHotKEy using "Control,Check", or "ControlGet,Checked". Is there a way of controlling this component using CallDLL, or some kind of CLR hosting within AutoHotKey? ...