.net

Unit Tests in Visual Studio 2010

Hi, i am trying to create a Unit test for a WinForm in a Visual Studio 2010 project. I add a new "Coded UI Test" to my project, open up the code file, then right click and select "Generate Code for Coded UI Test" -> "Use Coded UI Test builder". I then start my application up, select "Record" on the UI Map control. I run my tests (in this...

Code Generators for .Net

Possible Duplicate: Code generator (.net) I'm looking to do some side projects but don't have the time to hand code everything. What code generators has anyone used? Currently, I am looking at Iron Speed, but can't really afford to buy it. So I'm looking for a product under $300.00. Any suggestions? Jim ...

Resizing a rectangular array

Does a smarter way than the following exist to resize a rectangular array? double[,] temp = new double[newSize, originalSecondDimension]; Array.Copy(original, temp, original.Length); I was concerned about duplicating a huge array and the memory necessary to do it. What does the Array.Resize() do internally? Thanks, Alberto ...

.Net web architecture literature

Hi, Can somebody please advise a very advanced book on the architecture of the web application development, preferably in .Net I'm interested in patterns and designs, code security and re-usability I have studied a variety of books, but they all seem to be for beginner/intermediate levels. ...

WCF Web Services - Multiple Hop impersonation on the same server

Hi Folks I have 3 web services, all located on the same server. My Client calls Service A, which impersonates the client to call Service B, and all is well. Now, I want to impersonate the caller of service B (which is my username) to call Service C. When I use the same technique as before (AllowedImpersonationLevel = Impersonate, u...

Wikipedia embedded in WinForms App Tutorial

Can anyone post a tutorial here on how to show a Wikipedia article in a .NET WinForms application (C# or VB)? If the article can be placed in a string it suffices, there`s no need to put it on any control. I found some information on Wikipedia's API. After reading it, I added the reference to web service but can`t find a way to make thi...

Functionality in a Data Access Layer formed by a dbml

I got a Data Access Layer that's being formed by one DBML in which i just include all object I need. Is it necessary to write more functionality in this dbml or can I just use the dbml as my DAL? I ask this because I am currently writing functionality to, for example, get all Articles from a Table in the Business Logic Layer. So I'm kind...

Cannot implicitly convert type 'string' to 'System.Web.UI.WebControls.Unit'

hi, I ma getting error like Cannot implicitly convert type 'string' to 'System.Web.UI.WebControls.Unit' in the following code. How to fix this. protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { RadTab tab = new RadTab(); tab.Text = string.Format("New Page {0}", 1); RadTabStri...

get look up a string given a func<T,object> param

given this code namespace GridTests { public class Grid<T> { IEnumerable<T> DataSource { get; set; } IList<Column> Columns = new List<Column>(); class Column { public string DisplayText { get; set; } Func<T, object> Rowdata { get; set; } } } } I need to be ab...

MSIL code problem

Hi all, I am trying to modificate an assembly (mine) just by ildassembling it and by modifying the MSIL code. I just want to pop a MessageBox. Here is my code : .module extern Fusion.dll .module extern kernel32.dll .module extern advapi32.dll .module extern aspnet_state.exe .module extern webengine.dll .module extern aspnet_wp.e...

Error - Cannot find static resource in a WPF application

I'm learning WPF and started with this MSDN tutorial. I was just following the tutorial. When I finished the code as per the tutorial and try to run I get an exception in a XAML page which says "'Provide value on 'System.Windows.StaticResourceExtension' threw an exception.' Line number '27' and line position '55'." . And inner exception...

Can Win32_NetworkAdapterConfiguration.EnableStatic() be used to set more than one IP address?

I ran into this problem in a Visual Basic program that uses WMI but could confirm it in PowerShell. Apparently the EnableStatic() method can only be used to set one IP address, despite taking two parameters IP address(es) and subnetmask(s) that are arrays. I.e. $a=get-wmiobject win32_networkadapterconfiguration -computername myserver ...

Printing using full page (bypassing hardmargins/printing full bleed/borderless)

Is it possible to override printer hardmargins and use all of the page when printing a document programmatically with .NET? ...

How do I check if a file is in use?

Possible Duplicate: C#: Is there a way to check if a file is in use? I'm using the System.IO.File class to delete a file, but of course this causes an exception if it's being used. I don't just want to catch the exception and forget about it (that would be using an exception as a flow construct); I'd like to know how to check ...

String Format not working

I am trying to display a number, stored in a dataset as a string, as a phone number. I have a label that Binds to a value but doesn't display the format that I passed as an arg: <asp:Label ID="lbl005108002" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "phone number", "{0:(###) ###-####}") %>'></asp:Label> As a test I t...

Regex to repeat a capture across a CDL?

I have some data in this form: @"Managers Alice, Bob, Charlie Supervisors Don, Edward, Francis" I need a flat output like this: @"Managers Alice Managers Bob Managers Charlie Supervisors Don Supervisors Edward Supervisors Francis" The actual "job title" above could be any single word, there's no discrete list to work from. Replaci...

Display .Net assembly properties including public key in windows explorer

Hi, Is there an easy way to get properties of a .NET assembly including its public key token and culture info using windows explorer on my windows 7 PC. Currently I use Reflector to get this info, but surely there should be an easier way that I am not aware of. ...

Determine Excel Version/Culture via Microsoft.Office.Interop.Excel

How can I achieve that in .NET/C#? ...

Lucene.net create+lock errors in ASP.NET

-Edit- Important: I updated the code to not use obsoluete functions. Now only the NoSuchDirectoryException issue remains Edit: NOTE i can bypass the NoSuchDirectoryException by creating the folder in a winform app and copy it. However i still have a LockObtainFailedException issue if i dont shut down properly. I have an issue with (Luc...

NewWindow3 event on extended WebBrowser

I've got an extended WebBrowser control which handles the NewWindow3 event. Originally I wanted this because it exposes the Url property. What I want to happen in this NewWindow event is to cancel opening a new IE instance (so I set E.Cancel = True). Then, I want to create a new form, a new web browser control and navigate to E.Url Thi...