I am learning how to use NUnit. I have my main project in it's solution, and created a separate project in that same solution which will hold my unit tests, with it's own namespace. From that project I add a reference to the main project and add a
using MainProjectNamespace;
to the top of it.
When I go to NUnit, any tests I have t...
I have a POST action that looks like this:
public ActionResult Create([Bind(Include="userrole,credentials.emailAddress,credentials.password")]User u, string confirmPassword, bool agreeToTerms)
I'm using the default model binder and credentials is a property on my User object. Credentials has two fields (emailAddress & password). If I ...
I have a generic class, but I want my type to be forced to inherit from either one or the other interface. For example:
public class MyGeneric<T> where T : IInterface1, IInterface2 {}
The above will force T to inherti from both IInterface1 and IInterface2 but can I force T to inhert from IInterface1 OR IInterface2 (or both)?
...
Using extension syntax I'm trying to create a left-join using LINQ on two lists that I have. The following is from the Microsoft help but I've modified it to show that the pets list has no elements. What I'm ending up with is a list of 0 elements. I assume that this is because an inner-join is taking place. What I want to end up with is ...
Hi,
I would like to know how threads are handled on the server side using MarshalByRef objects.
Given my remoted MarshalByRef class:
public class MyRemotedClass : MarshalByRef
{
public int MyInt;
public string MyString;
}
Client code (single threaded):
MyRemotedClass m = GetSomehowMyRemotedClass();
m.MyInt = 5; // Write operat...
Best way to allow the User to define a Table’s Order?
We are using SQL Server 2005 and DevExpress controls.
We have a table that contains the following:
Process A
Process B
Process C
Report A
Report B
Report C
We want to allow the user to change the order to anything they want.
Here is one example:
Process C
Process A
Proce...
So I have been a .Net developer for the past decade and am thinking of learning either C or C++ (with a strong preference to C++).
Does anyone know a good place where a C# fanboi can get started learning C++ (or C)? With so many tutorial sites on the web, it hard to know where to start, and if there is one which might be more accomodat...
How to override or extend .net main classes. for example
public class String
{
public boolean contains(string str,boolean IgnoreCase){...}
public string replace(string str,string str2,boolean IgnoreCase){...}
}
after
string aa="this is a Sample";
if(aa.contains("sample",false))
{...}
is it possible?
...
I have a WinForms .NET app that, according to the Vista Task Manager with UAC enabled, runs with virtualization "Disabled" even though I do not recall adding a manifest with "asInvoker" to the app. VS.NET (this project has gone through all four versions of VS.NET) must have added the \Properties\app.manifest file I see in Solution Explor...
How can I detect that my .NET application has crashed, and then restart it?
...
Hi I am in the process of writing my first .net gui. I am wondering if there is some specific way I need to apply to my poco objects for them to be bindable to a usercontrol. I have a few objects but I seem to be unable to bind them to my usercontrol.
I read somewhere that they need to implement IBindable but I can't shake the feeling ...
I'm thinking of building a small web app using the MVC framework as a way to introduce myself to it. The idea of a project to get myself started is a small gambling monitoring piece of software that I can enter a a list of all my small bets I have along with other friends. Some of the things I hope to capture using this web app is:
- log...
Hi all,
I am to build a SOA gui framework, and I'd like to autodetect services, and service dependencies from client modules. I have code such as this so far, which works using attributes, placed on class modules:
[ServiceProvider(typeof(DemoService3))]
[ServiceConsumer(typeof(DemoService1))]
I am wondering how I can scan for these a...
I'm considering embedding IronPython as a scripting language for an application that I'm writing. So to try it out, I downloaded IronPython 2.0 and fired up the interactive interpreter. Just starting the thing up takes about 5 seconds on my Intel Quad Core with 6 Gigs of memory. I can hardly imagine how much of a delay this would be f...
Say I have a role entity and a site entity. Now there are many roles to one site, so on the Role class there is a Site property that represents that relationship. If I wanted the roles for a site I would do this:
Site.Roles.Load()
Problems is, since the Site property on the Role class isn't a collection but just a single entity, the...
uint x = uint.MaxValue - 100;
The above line causes visual studio to report "The operation overflows at compile time in checked mode"
I'm obviously missing something. Any ideas what?
...
What is the format (schema) of .NET PDB files? I'd like to parse the information out of these files so that I can display the correct lines of code (line numbers) in a debugging application.
...
I'm looking for common causes of Access Violation errors under .NET.
Things I have checked so far -
Call Dispose on all objects implementing IDisposable
Check for valid arguments in calls to COM objects
Explicitly remove all manually added event handlers
DO NOT explicity call GC.Collect/GC.WaitForPendingFinalizers
Add and Remove memor...
I'm looking for common causes of Buffer Overflow errors under .NET.
I know that buffer overflow is impossible under managed .NET code. However this exception is still possible in the scope of .NET application.
Things I thought of -
Valid arguments to COM object calls
Valid arguments to PInvoke/Win32 calls
What is the best method o...
Without pointing me to MSDN, could someone give a concise, clear explanation of the purpose of each of these and when to use them. (IntPtr, SafeHandle and HandleRef)
...