.net

user controls in asp.net prefixing string to child controls causing problem to refer them in javascript

I have user control in which there are text boxes no i am using the AJAX to populate the child controls dynamically however asp.net appending some string to child controls causing problems to write the JavaScript code. Though i have tried getElementLike('key') which iterate elements and get the right one for me but this is really ineffi...

What are the different config files in a Windows Service .NET?

When I create a .NET Windows Service, there is an App.config file. When I compile the service, it creates a ServiceName.exe.config in the bin directory and there is also a ServiceName.vshosts.exe.config Q1) What is the significance of multiple config files? When I change a setting in the App.config it does not take effect until I unins...

Using EventLog objects can cause security holes?

While reading the Traning Guide for the 70-536 exam written by Tony Northup and friends, I came across the following: CAUTION - Avoid EventLog objects in partial trust environments Use of EventLog objects in a partial trust environment can cause serious security holes and should be avoided if at all possible He basically indi...

How to dispose the resource when it might be used by multiple clients?

I am implementing a pipeline pattern, the resource, say an image object, will go through the pipeline, and i have no idea how many clients are holding the resource, so what's the better way to dispose the resource? ...

What is a singleton in C#?

Pretty straight forward question. What is a Singleton and when should I use it? ...

Is AMQP production ready?

I'd like to use AMQP to join two services one written in C# and other written in python. I'm expecting quite large volume of messages per second. Is there any AMQP Broker that is production ready? Are the python & .net bindings good enough? ...

InvalidCastException in VSTO add-in

I'm experiencing a bit weird problem with VSTO Outlook add-in I'm developing. It works fine on a bunch of machines but in one it throws an InvalidCastException and cannot find the reason why. I've checked that all prerequisites are installed on this machine (the installer doest it by itself but I also checked that manually) and everythin...

SOAP Fault Error

Hi, When I try to make a SOAP call, I get the following Error. soap:ClientGeneral security error (WSSecurityEngine: No crypto property file supplied for decryption) Can anyone please explain what could have triggered it? Thank you, UsernameForCertificateAssertion assertion = new UsernameForCertificateAssertion(); ...

Is there a jQuery wrapper for .Net?

I've noticed that there are wrappers for a lot of javascript libraries and such, but I have yet to see anything significant for jQuery. Am I just not searching hard enough and there is one out there? Or is there some problem with jQuery that keeps someone from creating a wrapper? ...

Domain Driven Design - Parent child relation pattern - Specification pattern

Hi all, I was wondering which of the following is considered to be a best practice when dealing with parent child relationships. 1) The following example seems to be a common practice, but when creating an instance of a child, it will be in an invalid state as long as it is not added to the parent. Couldn't this lead to problems regard...

How to build a C# MVC app with a 32-bit assembly to run on x64 Server 2008

We have a MVC application that depends on a number of 3rd party products (e.g., Crystal, Topaz). The Topaz signature device only has 32-bit .dlls available. So I'm assume that I need to build and deploy the app on IIS 7 in an a 32-bit App Pool. If that assumption is correct, then do I need to build the MVC app with the VS2008 compil...

Read bytes array

In web service I have function that return bytes array. Now, I call it from VbScript and I need to catch result of this function. How I can catch result of this function in value that is gone be like a value that function return (bytes array)? ...

Can I make a report for a stored procedure with unknown amount of columns?

I have a stored procedure, that generates some columns dynamically. I want to use Crystal Reports as a reporting service and, in particular, I need to generate report from this stored proc data. It's a poll-result report and for each poll act there is a row with it's ID and answers to the questions(one column for each question with quest...

Fixing "The breakpoint will not currently be hit. No symbols have been loaded for this document."

C# desktop application on express edition. Worked then didn't work 5 seconds later. I tried the following. Ensure debug configuration, debug flag, and full debug info are set on all assemblies. Delete all bin and obj folders and all DLLs related to the project from my entire machine. Recreate projects causing the problem from scratch....

Is c# ref int foo implemented as C++ int **foo?

I was talking with a coworker about this yesterday and it got me thinking about .Net's pass by reference. // C# class Foo {} static void Test(ref Foo foo) { ... }; static void Main() { Foo f; Test(ref foo); } Has to be implemented with a double indirection because we're changing the value of the pointer. Because all referenc...

Receiving a 500 internal server error when I have a '%' symbol in the query string

I am trying to diagnose a problem that a client site has come across. Basically when you do an address search on their website you can specify a '%' symbol for wildcard searches. For example you can search for Be% to return Belfast etc. This queries the database and then redirects you to the results page, passing the search criteria i...

Designing a simple Save Dialog in Prism

I am writing an application using Microsoft's Prism framework and I'm having trouble working out the best way to approach a simple 'Save File' style dialog box. NB: I can't use the standard dialog as I'm not saving files to the file system so need to write something similar from scratch. So here are the main controls I have for my dialo...

Why doesn't attempting to add to a null value throw an InvalidOperationException?

int? x = null; x = x + 1; // Works, but x remains null I would expect the compiler to attempt to cast x as an int, but apparently it does not. Edit by 280Z28: Changed NullReferenceException to InvalidOperationException, which is what Nullable<T>.Value throws when HasValue is false. ...

Merging .net managed dlls

I have a managed dll "Sample.dll" that I use to build my dll "myDLL.dll". But I want to distribute 1 dll ("myDLL.dll") file only. How do i merge them? ...

JSON array of objects to .NET Object

I have a large object coming back and I only need a fraction of the data. I was looking at the example here. I essentially want to do the same thing except the problem is I would have an array of "error" objects. So, it would look like this { "short": { "original": "http://www.foo.com/", "short": "krehqk", ...