.net

WCF KnownType from method name

Hi, I'm using KnowTypeAttribute using method name. The method is static and placed inside the DataContract class. When the method implementation is inside the method, everything is fine, but when i'm calling another method from another project (from the class static method) i got an exception saing "System.MissingMethodException: Method ...

How to send object through NamedPipe in .NET 3.5?

Hi, Can you tell me what's the best way to send objects through NamedPipes in .net 3.5? Thanks in advance ...

Bind to element's position relative to a parent in WPF

I need something to get the position of a sub-sub element relative to the container. TransformToAncestor does that. However, the element and subelements move, resize change, their layout, etc. I need a way to keep the position up-to-date. Like an event if anything happend that would affect my TransformToAncestor operation. Or an "Absolut...

Exception changing focus with the tab key in a .NET application

I have a very simple Windows application, with a few controls, a DataGridView and the Adobe PDF viewer control. The app works fine except when tabbing around to switch focus between controls, I regularly get the following exception. System.AccessViolationException was unhandled Message="Attempted to read or write protected memory. Thi...

Do LINQ queries have a lot of overhead?

Are simple LINQ queries on an IEnumerable<T> lightweight or heavyweight? How do they compare to writing for or foreach loops by hand? Is there a general guideline for when to prefer LINQ versus manual searching? For example: var lowNums = from n in numbers where n < 5 select n; Compared to: List<int> lowNums = new List<i...

Developing tools for Poser (Pro)

As a software engineer, I sometimes use Poser Pro to create artwork to insert in my applications. It's useful to provide visual reminders to the users of the applications. For example, an image of a man/woman when a person has provided a gender as additional feedback to the "select gender" combo box. Or a house when they need to enter an...

Recommended books for Windows desktop application performance

I'm building a desktop application that runs in a Windows environment using .net technology. It's important that this application run smoothly and consume as little of the user's system resources as possible, since the user is likely to keep it running throughout the work day. I'm looking for good, in-depth resources on how to constru...

Why am I getting this message on mono ? "warning FS0191: Could not determine highest installed framework version..." .NET"

I have installed Mono (version 2.4.2.1) on a Mac OS X (10.5.7) and i am trying to do some F# coding. The F# version i am using is 1.9.6.16. On the FSharp interpreter i am getting this strange message when i type some simple commands (like printfn): warning FS0191: Could not determine highest installed .NET framework version from Regist...

WPF TabItem problem of focus

I have a tabcontrol binded the an observable list. Eveything look to be perfect until I select a tab. Once selected, the tab doesn't lost its focus and the selected tab is not available. They are not any message in the Output Window. Here is a screen shot just before clicking the tab: And here is a screen shot after (with the problem...

IIS - Make Directory an Application from the CLI for .NET application

I have IIS installed on a server configured with asp.net 2.0 and a directory located at C:/Inetpub/wwwroot/application. I also got an automated process for zipping up an asp.net web application, scp'ing that .zip file to said server, blowing away the previous contents of the application/ directory, and unzipping the .zip file there, and...

Trust Level required for Membership Providers

Hello all, I am hosting an ASP.Net site with GoDaddy - It seems that the trust level for the application is Minimal, this seems to create issues with my using the standard SQLMembershipProvider. Can anyone help me to understand if this is a limitation of the SQLMembershipProvider, or the fact that I only have Minimal trust? To put it a...

How to map USB HID input to keyboard strokes?

I am a .NET developer, and I want to turn my USB HID device (Mouse, Dance Pad, Guitar or Drums, specially Drums) into a keyboard (with few keys, I know). Do I need to develop this from scratch? Is there any tool that does that? Is there any library that would help me? ...

Convert C# Library To MSTest Project

I have some class libraries with NUnit tests, and I want to convert the project to use the VS 2008 MsTest integration. (Right click add test etc.) Is there and easy way to convert or do I need to edit the csproj manually. Thanks ...

Using the Public Key of Signed Assembly as a Security Measure

I am writing a security measure with an application I'm writing where I have a securityDLL that is included and signed with an SNK. If this assembly is present, I check the Byte array that is returned when getting it's Public Key, and comparing that to my application. Is this adequate security to ensure that someone hasn't modified my a...

Is there a way to customize the Unit Test Wizard in Visual Studio Team System?

I am tired of Unit Test Wizard on Visual Studio, it helps a lot, for sure, but there are some things that I always have to change, like replacing explicit variable typing by "var". There is a way to customize it? ...

How can I step into Microsoft's .net framework source code?

I'd like to step into Microsoft's source code but cannot. I followed the instructions at http://referencesource.microsoft.com/serversetup.aspx In particular, I disabled "Enable Just My Code" and Enabled "Enabled .NET Framework source stepping". Finally, set the source symbol location to "http://referencesource.microsoft.com/symbols". ...

Why are PHP developers cheaper than .NET developers?

This is a two part question; firstly, does anyone out there have some insight as to why PHP contract developers would be available at a much lower rate than their .NET counterparts (around a 30% premium for the Microsoft guys)? I have some theories relating to ease of learning and cost of tools and servers but would like to get some feed...

is HMACSHA1 defined for messages of zero length?

I have an edge case. I'm building code that reads binary datafiles produced by a commercial, closed source tool. The information on the data format is specified in a document. For data integrity checks, the vendor's spec calls for an HMAC based on SHA1, using a key derived from a password as per RFC2898. Many programming environments h...

Interlocked and volatile

I have a variable which I am using to represent state. It can be read and written to from multiple threads. I am using Interlocked.Exchange and Interlocked.CompareExchange to change it. However I am reading it from multiple threads. I know that volatile can be used to make sure the variable is not cached locally but always reads direct...

What's the nvelocity/C# equivalent of "if x in array" ?

Hacking on a Nvelocity C#/.NET view template (.cs file), I'm really missing the Python keyword "in" (as in, "foo in list"). What is the built-in for checking list/array membership? This is what my Python brain wants to do: #set ( $ignore = ['a','b','c'] ) <ul> #foreach ( $f in $blah ) #if ( $f not in $ignore ) <li> $f </li> #en...