I'm working on an extension method that's only applicable to reference types. I think, however, it's currently boxing and unboxing the the value. How can I avoid this?
namespace System
{
public static class SystemExtensions
{
public static TResult GetOrDefaultIfNull<T, TResult>(this T obj, Func<T, TResult> getValue, TR...
Hi,
I need to make a webform communicate with a winform and back to the webform. The reason for this is it exists a webform software already made, and now it's needed the behavior of a .net component only available for winforms. We've tried going with Process.Start and shell.execute but with this approach the software hangs or it takes ...
I have a custom developed control I am using that somebody else wrote. For some reason, when the control was written, they did not write an event handler for the "mouseDown" event so when I mouseDown on the control, no event is fired. What I am basically trying to do is capture which mouse button (left or right) is pressed when the con...
I recently created a WCF service that works fine when tested from Visual Studio 2008. but when I deploy the project to IIS and I try to access the .svc file from IIS, I get this error :
"Server Error in '/' Application.The resource cannot be found. "
I've been having this issue for the past 4 days .
in the Handler Mappings of IIS Ma...
I am using a combination of the Enterprise library and the original Fill method of ADO. This is because I need to open and close the command connection myself as I am capture the event Info Message
Here is my code so far
// Set Up Command
SqlDatabase db = new SqlDatabase(ConfigurationManager.ConnectionStrings[Connecti...
Installing reference assembly folders in 32 bit is straightforward:
1 Copy your files in ProgramFiles\MyApp
2 Add a registry key HKLM\Software\Microsoft.NETFramework\AssemblyFolders*MyApp* pointing to ProgramFiles\ MyApp
But things fall apart in 64 bit.
First, the msi installs into program files (x86) instead of program files.
Secon...
The .net CLI is standardized as both ECMA-335 and ISO/IEC 23271:2006 - is it 100% the same standard, or are there differences between these two?
Also, is the standard available as a book? Makes it easier to read :)
...
I have a set of unit tests, each with a bunch of methods, each of which produces output in the TestResults folder. At the moment, all the test files are jumbled up in this folder, but I'd like to bring some order to the chaos.
Ideally, I'd like to have a folder for each test method.
I know I can go round adding code to each test to mak...
In my .net application I want to restrict reflection to certain assemblies. I mean I want that my a particular assembly can be reflected by only some predefined assemblies not by any other than that. How can i do that?
Edit:
This tool completely shuts down .NET disassembly and decompilation of an assembly. I want to allow some predefin...
There are several scripting environments available for .NET applications (e.g.this post).
My question is, what are the pros/cons of using each of them?
Examples include (but not limited to)
PowerShell
IronPython
Lua
JavaScript
I am trying to decide which scripting tool to use in scientific applications to allow expert users to inte...
I have a Winform App that uses a 3rd Party Library of Controls, DevExpress. I also created a bunch of Controls myself, extending those controls. Everything has been working fine when all of a sudden I opened VS today and on the Design Page all my extended controls were missing. I then tried rebuilding to no avail. Then I tried Cleani...
I have a .NET app which works in 32 and 64 bit.
I would like to write one single installer that installs to c:\program files, not c:\program files(x86) regardless of the platform.
From this link:
http://msdn.microsoft.com/en-us/library/w1behyzx(v=VS.90).aspx
it doesn't look possible. Is it the case?
...
Hi,
I'm trying to develop a small application that test how many requests per second can my service support but I think I'm doing something wrong. The service is in an early development stage, but I'd like to have this test handy in order to check in time to time I'm not doing something that decrease the performance. The problem is that...
Is it possible to use this Role Provider AspNetWindowsTokenRoleProvider with ASP.NET FORMS Authentication (via this MembershipProvider System.Web.Security.ActiveDirectoryMembershipProvider)?
It seems to only work with <authentication mode="Windows">, is it possible to use it with FORMS?
background -- The objective here is to provide an...
How might I use a stored procedure from NHibernate but at the same time keep the solution database-agnostic and the codebase clean of switch statements with a case for each Dialect?
I expect to create a Named Query per database implementation containing the content of the database-specific sql implementation of the procedure. My dile...
I'm using the new .NET 3.5 System.DirectoryServices.AccountManagement API.
In my code, I need to determine the current System.DirectoryServices.AccountManagement.UserPrincipal.
My naive approach was to do this:
using AccountManagement = System.DirectoryServices.AccountManagement;
...
// Determine current UserPrincipal.
// (On my mac...
After I inserted the configuration below in my Web.Config
<authentication mode="Forms">
<forms name="appNameAuth"
path="/" loginUrl="login.aspx" protection="All" timeout="30">
<credentials passwordFormat="Clear">
<user name="user" password="password" />
</credentials>
</forms>
</authentication>
<authorization>
<de...
I have a WCF service that takes text a customer enters and passes it to a windows service. I am using jQuery to send the text to the WCF service (in json). Before passing the data I call $.trim() on the text. Today i received text with a null character in it that looked like this:
00-15-5D-0A-0B-01\0
If I go back and test, and send...
Hello,
I'd like to develop a desktop application (on Windows, and preferably on .NET) that accepts bluetooth connections from mobile devices, that would then send commands to this application.
I've never worked with bluetooth before. I've looked for open-source examples of such applications, but I had no luck. I've actually found on Mi...
Is there a way to see the messages that RIA services/clients send?
...