.net

Native Windows application for checking system requirements and starting .NET application?

I need Windows executable that checks basic system requirements (e.g. if .NET is installed) and either starts .NET application or gives instructions to user what's missing. I know I could use an installer to check prerequisites but client would like to avoid this. Do you know about tool that could help me with this? ...

(Free) optimization programs for .Net-programs

What are the good (free) optimization programmers, .Net programmers need to have to optimize their programs? ...

Adding Rich Text to an AcroField in iTextSharp

I need to add some formatted text to a PDF form field using iTextSharp and I can't seem to figure it out. This is how I'm currently setting the fields, but certain portions of the inserted text will need to be bold or have other formatting. stamper.AcroFields.SetField("fieldName", "fieldValue") stamper.FormFlattening = True I've seen ...

Merging two objects containing properties into one object

If I have two objects, foo and bar, delared using object initializer syntax... object foo = new { one = "1", two = "2" }; object bar = new { three = "3", four = "4" }; Is it possible to combine these into a single object, which would look like this... object foo = new { one = "1", two = "2", three = "3", four = "4" }; ...

Check if relative URI exists

I want to check if a URI returns a valid result. Example: String path = String.Format("{0}/agreements/{1}.gif", PicRoot, languageTwoLetterCode); WebRequest request = WebRequest.Create(new Uri(path, UriKind.Relative)); ... This throws a notsuportedexception. So I figure I should be providing the absolute URI. All examples I can find us...

.NET C# executable is not reading config dynamically

In my app.config i got something like: <appSettings configSource="AppSettings.config"/> I would have expected the application to read the settings dynamically from AppSettings.config but i doesn't... Am i wrong here? ...

Querying two different entity types using PredicateBuilder

I am desperately trying to use LinqKits PredicateBuilder to allow the user to enter a search term into a text box and return records from two database tables/entitysets but I'm struggling to get anywhere. The (simplified) database structure is as follows: Person Alias ------ ------ A_I...

UAC Testing with Website Generated Email

We would like to use Selenium to test email content generated from our website. We could mock a mail server, but how would we assert the content of the emails? We're using nUnit/Selenium/C#. Does anyone have a good approach to accomplishing this? Thanks in advance! ...

Class layout to serialize to this format

My XML looks like this: <cars year="2009"> <engineType name="blah"> <part type="metal"></part> </engineType> <makes> <make name="honda" id="1"> <models> <model name="accord" id="2"/> </models> </make> </makes> </cars> How do I create a class that when deserialized, will produ...

How do I refer to the containing type in a method on a runtime built type ?

I would like to include a Copy method on a runtime built type that takes it's own type as a parameter - i'm sure i'm missing something obvious but i don't see how to do this TypeBuilder recordTypeBuilder = moduleBuilder.DefineType("_" + tableSpec.Name + "Record", TypeAttributes.Sealed,); recordTypeBuilder.DefineMethod( "CopyFrom...

Arraylist in Visual Basic .net

Can I get an example of how to make something like a Vector or an ArrayList in Visual Basic .NET? ...

Entity Framework 4.0 Dependencies

From what limited info we have about EF 4.0, does anyone know if we would be able to use EF 4.0 in our IIS 6.0 (Windows Server 2003) using .NET 3.5? I imagine EF 4.0 to siginify .NET 4.0 framework. It'll probably take a year for us to upgrade our production servers to .NET 4.0 some I'm wondering is if we play the waiting game or not f...

SOAP WSE .Net issue with Action header

We have a SOAP Web Service we wrote that accepts work fine testing without a WSE policy set on the class using the Policy Attribute on the class that implements the WS "<Policy("ServicePolicy")> _" once we put the policy in place and the WS is posted to, the service returns back a SoapFault saying (without ever getting into our code, ...

Creating a new user on Live Communications Server 2005

I'm writing a user provisioning Windows fat client application and am running into problems when I try to create an account for the user on LCS. My code looks like this: /// <summary> /// Creates a user account on the Live Communications Server. /// </summary> /// <param name="Alias">The person's address in the form ...

How do I dump the .NET process so that Visual Studio 2008 will load it as a managed dump?

I'm trying to create a minidump of the managed process, which would be loadable into Visual Studio 2008. I'm using following code to create a minidump: ... MINIDUMP_TYPE dumpType = static_cast< MINIDUMP_TYPE >( MiniDumpWithFullMemory | MiniDumpWithDataSegs | MiniDumpWithHandleData | MiniDumpWithProcessThreadData | MiniDumpWithPriv...

Enumerate an IDictionary.Keys collection which is an ICollection<T>

I hope i don't get slammed for asking something so basic. I could Google for the answer, but I want to hear something that's not from a textbook. I'm writing a unit test to verify that my IDictionary Keys are sequential. Since the Keys property is an ICollection<T>, I want to enumerate over the collection and print the Key values to t...

ASP.NET - Add Reference of GAC is not possible ?

I am new to ASP.NET having some basic doubts. 1) The public assemblies are deployed in GAC.Even when i go for "Add Reference ", I can not point to c:\windows\assembly ( i hope it is not possible) .Still i need to refer the assembly from ..\Bin folder of the source project ( custom assembly).Is there any consideration behind it? 2...

Can't find PInvoke DLL error in Windows Mobile

I am having a lot of trouble getting a basic scenario to work on windows mobile 5.0 emulator. I have a winforms app that eventually calls into native code. Deployment works fine and all the native DLLs are copied in the same folder as the winforms .exe. I also verified this is the case with Remote File Viewer tool. However when I lau...

Which do you prefer for interfaces: T[], IEnumerable<T>, IList<T>, or other?

Ok, I'm hoping the community at large will aid us in solving a workplace debate that has been ongoing for a while. This has to do with defining interfaces that either accept or return lists of some type. There are several ways of doing this: public interface Foo { Bar[] Bars { get; } IEnumerable<Bar> Bars { get; } ICollection<Bar> ...

How can I create a simple 2D NURBS using XAML?

I need to create a spline with two endpoints and 'n' control points. As far as I am aware, a Bezier curve allows for only one control point, and a Bezier spline allows for two control points. However, I need to be able to add as many control points as I see fit, not limited to one or two. Here is an example of what I want to achieve, wi...