.net

How to simulate windows shutdown while debugging?

I have an issue with my application when windows shuts down - my app isn't exiting nicely, resulting in the End Task window being displayed. How can I use the debugger to see what's going on? e.g. is there a way to send the windows shutdown message(s) to my application so it thinks windows is shutting down, so i can see exactly how it b...

Java and .NET heap overhead

I have understanding how heap and garbage collector works: garbage collection happens in generations, memory allocation happens sequentially, during garbage collection free/unused space compacted by shifting data and forming continues block, etc. Is there any headers for allocated memory chunks are present and how big are they (I heard...

Checkbox Array in MVC Framework

Ok not sure what is going on with these checkboxes in the MVC Framework RC1 but here is what I got. I am creating checkboxes using a foreach loop on the view but when I try to access them using the Request.Form.Keys in the controller I get nothing back. My question is how is Request.Form.Keys populated? I know the checkbox inputs are on ...

Using something like user control to put in the <head> of aspx pages.

Basically I just want something like an include control that I can put into the head and also something that could be nested(optional). I want to put the links to the css and js files in there so I have them all in one place. NO MASTERPAGES - I am trying to(read have to) avoid them for this project. User controls work fine for this but ...

.net ToString() format documentation

I saw a code snippet the other day that converts a Boolean value to the corresponding "Yes"/"No" value: CDbl(True).ToString("Yes;Yes;No") The code works fine but I'm curious how it works and I haven't been able to find the answer in the MSDN documentation for ToString(). Can anybody shed some light on this? ...

Why does my application not close on logoff/shutdown (c#/.net winforms)?

My winforms app isn't shutting down nicely when I log off/shutdown. I have a main form, whose Closing event is fired correctly, but there must be something else keeping my application around. If I check Application.OpenForms there's just my one main form. The tricky bit, and where the problem probably lies, is that my application uses S...

How should I store public settings? (.NET)

I'm using the application-scoped settings to store settings that cannot change at run-time. I'm using the user-scoped settings to let individual users configure their preferences. But how should I store/control settings that are modifiable at run-time by an admin-level user that are application wide (i.e., they impact all of the PC's u...

Web service client (.NET 2008), exception handling?

I have a standard (?) web service client solution in .net 2008 = classes created by wsdl.exe tool after downloading the wsdl-file from web service I'm using. I then just call the method of this automatically created class that inherits System.Web.Services.Protocols.SoapHttpClientProtocol and its' invoke method. which I have tested a lot ...

Multiple simultaneous saves cause WCF/NHibernate "Row updated by another transaction"

I am working on a large application that manages complex 'events' with quite a bit of data. The application is broken into a client (C# mainly .NET 2.0 mainly), a WCF based server made to run on IIS (web services at this layer), and a data back end that is NHibernate based with an MS SQL Server database backend. We are encountering a b...

Linq to SQL catch OnChanged "event" for entity association change

Lets say I have a couple Linq to SQL classes, Person and Department. Person has a entity association to Department. I can catch a change to Person.Name using OnNameChanging and OnNameChanged in the partial class but the designer generated code doesn't seem to call OnDepartmentChanging or OnDepartmentChanged. How can I catch these kind...

Querying Child Collections in LINQ

I have a collection of objects called Gigs. Each Gig has an Acts collection. Using Linq I want to query my collection of gigs to get all gigs where with an act that has an id of 7 for example. act.id = 7; So I started writting... return from gig in qry where gig.Acts //not sure how to do this bit select gig; But I'm...

Retrieve file properties

When in Windows XP, if I open the properties window for the file and click the second tab, I will find a window where to add attributes or remove them. While developing things, I noticed there was actually something I wanted to know about the file. How to retrieve this data? It's a string with name 'DESCRIPTION'. The actual tab is sayi...

Using PowerShell with .NET 3.5 runtime/libraries

Is it possible to run PowerShell 1.0 (or 2.0 CTP) backed by the 3.5 runtime instead of 2.0? We're building a .NET 3.5 solution, and I'd still like to use PowerShell as our scripting engine for scheduled tasks, etc. I don't need LINQ syntax or anything, just the 3.5 libraries and runtime. FOLLOWUP: thank you for the reply about dynam...

Control which field is displayed in the textbox part of a databound WPF ComboBox

I have a ComboBox in WPF which is databound, and has data template which controls how each of the items is displayed. I have made it so that each item is displayed with two bits of text (for the Name and Path properties) and one image (for the Icon property). At the moment when I select an item from the ComboBox the textbox bit of the C...

XSD How To

Background: We have an application that has been in the works for over a year by a third party company and looks like we will be maintaining this in house from now on. For the most part i am very competent i can handle 99% of any issues that come up. In this project there is an XSD file acts as a pass through to a bunch of stored proc...

Disabling Windows CE Console on Handheld

Does anyone know how to disable the Windows CE Console on a Windows Mobile v5.0 handheld device? ...

What is the disadvantage in using asp.net MVC?

Is there any disadvantage you face it when you using asp.net MVC? EDIT If yes can you list some of those drawbacks, ...

Stored Procedure & LINQ, Dmbl File unable to interpret the result set

I have several Stored Procedures that when added to my dbml, it seems that behind the scenes LINQ can not interpret the result set and will simply map the result as an int. I then have to create the result class myself which is a pain but also I have to go and change the designer file every time I add to my dbml because it will re-load ...

updating system's time using .Net

I am trying to update my system time using the following: [StructLayout(LayoutKind.Sequential)] private struct SYSTEMTIME { public ushort wYear; public ushort wMonth; public ushort wDayOfWeek; public ushort wDay; public ushort wHour; public ...

File not found on RSACryptoServiceProvider, service account permissions?

Our web service wraps around a third party library that contains the following code. We are using an Active Directory service account in the IIS 6 app pool (no interactive login abilities). Our service fails with the error “The system cannot find the file specified”. We’ve traced the error to the “RSACryptoServiceProvider provider =...