.net

Asp.net MVC 2, spark engine and strongly Typed Html Helpers

Will I get the advantage of the new Strongly Typed Html Helpers with asp.net MVC 2 if were to use the spark engine for rendering? ...

In C# are the terms "Primitive" and "Literal" interchangeable?

A discussion earlier today led me to question whether or not my understanding of primtives and literals is correct. My understanding is that a literal type is specifically a type which can have a value assigned using a notation that both human and compiler can understand without specific type declarations: var firstName = "John"; // ...

ServerProtocolViolation error

I am hitting up a server with the following code and am encountering a ServerProtocolViolation error: // Prepare the webpage HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url + queryString); // execute the request HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Does anyone know how to work around this...

Any way to check if an assembly is a framework assembly, in .Net, other than checking the name for 'System' ?

The title says it all. Since, it's possible for anyone to name an assembly starting with 'System', checking for 'System' is not a satisfactory solution. Alternatively, if that's not possible, how about checking the modules in an assembly? ...

How to make a System.Configuration.Install.Installer to get a variable from the Setup project?

I have 2 projects in my solution A Windows service Its Setup project I need that my ProjectInstaller : System.Configuration.Install.Installer's method called OnAfterInstall to get the ProductName from the Setup Project. How do I do that? ...

Problem with automatic start of windows service

I have developed a windows service using visual studio 2008 and .net fw 3.5.1 I set the StartType of the service installer to Automatic. When I install the service in a Windows Server 2003 the service appears with the StartType set to Automatic. So far so good, but... when the server is restarted the service doesn't. What might be happen...

the specified module could not be found 0x8007007E

Inside the constructor of a Form when I am stepping through my code, a method declared in the very same form is called. Before I can step inside the method, I get a System.IO.FileNotFoundException with message "The specified module could not be found. (Exception from HRESULT: 0x8007007E)". The member method I try to enter is declared u...

WPF: The correct way to make a standard menu

I've just started out fiddling with WPF in Expression Blend and now I'm trying to design a "normal Windows GUI" interface with a menu at the very top and some other stuff which takes up the rest of the window. Which panel do I use to make the menu always stay at the very top, take up only as much height as it needs to fit the menu items...

Is there a buffer size attached to stdout?

I am trying to find some information on data limits related to stdout on Windows. I can't seem to find the information on MSDN. Is there a limit to how much data can be written to stdout? If so, what happens if the limit is reached? Is the data lost? If stdout is redirected (for example, by launching the process from .Net and using the...

How to update the layout whenever a control changes height in Winforms?

I have a custom LayoutEngine and it handles the layout correctly. However I want the layout to update (be called again) if any control changes height. Is this possible? If so how and where should I do this? Inside the control, or the layout engine? Preferably I wouldn't want this code to be duplicated wherever I have this layout used. ...

How do I update a table with LINQ-to-SQL without having to delete all the existing records?

Lets say I have a simple table that only contains two columns: MailingListUser - PK ID (int) - FK UserID (int) I have a method called UpdateMailList(IEnumerable<int> userIDs). How do I, in LINQ, make inserts for the userIDs that are present in the passed in parameter but don't exist in the db, delete the ones that are in the...

Entity Framework - Missing column(s)?

http://screencast.com/t/ODkwZDQx I have a simple 3 table model built from my DB. Company has 0 or more ProductsSold. Company has 0 or 1 AutoNegotiationDetails. As you see from the diagram, this is what is modeled. However, in the ProductsSold Mapping Details you can see that the CompanyId Value/Property is missing. Nor can I add i...

Unity Dependance Injection of a WCF service via web.config

I have a project that I am experimenting with DI in. I am using Unity and things seem to work well for normal assemblies and the injections. I am trying to further break dependencies with WCF services. The WCF service that I want to inject is created at runtime currently without using DI and I don't use the VS .net generated proxies: ...

Querying Nested Dictionaries using LINQ

I'm developing a POS system and I need to check whether the database tables on each terminal are out of sync. I maintain a Dictionary of terminal information, each of which has Dictionary containing table ids with a CRC for each table. Below is simplified description of what I've got so far (i'm using VB.NET but I've stripped out a lot...

How do garbage collection and background threads interact in .NET?

Let's say I create an object, and that object starts a thread, and gives one of its private instance methods to ThreadStart. Later, all references to that object are gone. What happens? Is the object is never garbage collected because the thread holds a reference to it through the this pointer? On the other hand, if I use a static method...

Dependency Walker on .NET applications: FlsAlloc

I have tried to profile several .NET executables in dependency walker and always get something like this: GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsAlloc") called from "MSCOREE.DLL" at address 0x79006079 and returned 0xFFBADD11. I tried making a new windows forms project VS2005 and did nothing but build it. Dependency walker still...

Executing IRake from .NET

I am using IronRuby in my .NET application. How can I call irake task_name from within the .NET C# code? OR How can I call irake task_name from the pre-build events? ...

Visual Trick in XAML for Sivlerlight

I am trying to create a control which is basically showing a list of pictures in Silverlight, but I want the list to rotate in a sort of 2.5D way. You can think of it as the picture in the middle is YOU, and the others are your friends on social networking site. Here is a sketch of what I mean: As you click the green arrows, the pic...

How do I determine a mapped drive's actual path?

How do I determine a mapped drive's actual path? So if I have a mapped drive on a machine called "Z" how can I using .NET determine the machine and path for the mapped folder? The code can assume it's running on the machine with the mapped drive. I looked at Path, Directory, FileInfo objects, but can't seem to find anything. I also l...

Symphonia .NET component generator not registering

I'm using the Symphonia EDI Designer, and trying to generate .NET assemblies, but the button that lets me create .NET assemblies doesn't show up. What do I need to do? ...