How do you log a event if the program process is halted or when the processing computer is down?
I'm using Microsoft Enterprise library to do all my logging but I'm not sure how to log the above situation.
...
Hi all..
Been reading up on various injection-type attacks, and it seems like the best way to get rid of these vulnurabilities is to encode all user input to remove / replace some characters with others (< > ; etc).
What's my best bet here? Are there any nice libraries out there to aid me with this? Or something that could help me spot...
What I'm trying to do is provide a form where a user can type or cut and past formatted text and be able to send it as an email (similar to outlook). This is required because it's closely resembles the current work flow and these emails aren't being saved anywhere besides people's inboxes. This is obviously a bandage on a bigger proble...
I've run into this apparently not uncommon problem --
I have a interface in Assembly A.
I am dynamically loading Assembly B, and trying to cast an object from it into my interface from Assembly A.
It's failing with an InvalidCastException.
I've come to understand why -- a class in Assembly A and a class in Assembly B, even with the s...
I have some DLLs that it would be much easier to use .net 3.5 internally (to take advantage of Linq, etc). I want to use these DLL with asp.net websites that are currently running asp.net 2.0.
Is this scenario possible? Are there any restrictions or gotchas (e.g. asp.net doesn't make any calls to methods which return .net 3.5 objects l...
I'm trying to construct a WCF client object using a run time URI string. This seems simple enough but I'm running out of thing to try that don't seem like "the wrong way to do it".
The original code is this:
IPrototype p = new prototype.PrototypeClient();
and I was sort of expecting it to work something like this.
string uri = GetM...
how can i convert from:
object[] myArray
to
Foo[] myCastArray
...
How do I tell a LINQ data context to ignore either specific properties, or all readonly properties, when binding a result set to an object?
I am working with some T-SQL statements that are difficult to express using LINQ, so I'm using the ExecuteQuery method of the data context to pass the straight T-SQL to the database.
If my class T ...
I am using the new .NET 3.0 DataContractSerializer. I have both Nullable<> and List<> objects I am going to serialize. Example:
[DataContract(Namespace = "")]
class Test
{
public static void Go()
{
Test test = new Test();
var dcs = new DataContractSerializer(typeof(Test));
dcs.WriteObject(new StreamWri...
My understanding is that Dictionary does not have boxing issues and faster in performance. Are there cases that the usage of Hashtable would be more advisable compared to Dictionary? Thanks
...
I've tentatively written this method:
public static Func<T> WeakCacheFor<T>( Func<T> provider ) where T: class
{
var cache = new WeakReference(null);
return () => {
var x = (T)cache.Target;
if( x == null )
{
x = provider();
cache.Target = x;
}
return x;
};
}
S...
Does anyone know of a solid free and/or open source business rule management system. The organization I work for is developing increasingly more complex (business-wise) applications and it would be really nice to have a rule based system for saving, maintaining and allowing inter-relation of those business rules over time.
Edit: Additio...
I'm creating a dynamic class in a dynamic assembly at runtime, and want to be able to Define methods for that class on demand.
Ex.
Build the Type X
Define Method GetA on Type X
Create Type X
Call GetA
use same type builder for Type X
Define new Method GetB on Type X
Recreate type X, that now has both GetA and GetB
if that is impossi...
I'm trying to create a script to compile an Windows Forms C# 2.0 project from the command line (I know, I know.. I'm reinventing the wheel.. again.. but if somebody knows the answer, I'd appreciate it).
The project is a standard Windows Forms project that has some resources and references a couple external assemblies. Here is a list of...
Socket.Dispose() is an inaccessible member. However, we can bypass this by doing the following:
((IDisposible)Socket).Dispose()
Two questions:
Why is this allowed?
How does this work internally?
...
Here are some typical answers(ranked in ascending order of corniness) I get from managers/bosses whenever I bring up the importance of having unit tests and code coverage as an integral part of the development cycle
"That is the job of QA, just focus on features and development"
"The application is not mission critical, if there are ...
The entity framework appears to use excessive amounts of memory when inserting new objects into a database.
for(int i = 0; i < numOwners; ++i)
{
var owner = Owner.CreateOwner();
db.AddToOwnerSet(owner);
for(int j = 0; j < numChildren; ++j)
{
var child = Child.CreateChild();
owner.Childs.Add(child);
...
Does the using statement really call the close method when used with a database connection object? The MSDN documentation says it ensures that the Dispose method is called but makes no mention of close. I see posts on Stack Overflow where people say that it does both. Does someone have a concrete answer one way or another on this from Mi...
(.NET 3.5 SP1, VS 2008, VB.NET, MSSQL Server 2008)
I'm writing a small web app to test the Khmer Unicode and Lao Unicode. I have a table that store text in Khmer Unicode with the following structure :
[t_id] [int] IDENTITY(1,1) NOT NULL
[t_chid] [int] NOT NULL
[t_vn] [int] NOT NULL
[t_v] [nvarchar](max) NOT NULL
I can use Linq to SQL...
Hi ,
I am just a beginner in cruise control.NET.My doubt is that is there any way by which cruise control.NET can detect changes in the local folder itself(for eg:C:/MYSource)rather than look for changes in the source control repository.I need to force the build all the time from the web dashboard to build.I want cruise control.NET ...