.net

Consume a SOAP web service without relying on the app.config

I'm building a .NET component that will call an external web service. I used the "Add Service Reference" dialog to add the web service to my component, which generates the code needed to consume the service and adds the settings to the app.config file. I'm testing the component by adding a reference to its DLL from a Console applicatio...

.NET - what version of the framework am I currently running in (from C#)

Using C#, what is the best way to ask the .NET Runtime which version you are running under? ...

Automapper - Using DynamicMap() and ignore null source value

I'm using Mapper.DynamicMap() inside a generic method and would like to, without using .CreateMap(), ignore some any source values that are null. Is this even possible? ...

Trying to understand how to abstract my data access layer

I'm writing an application that is used to catalog files, and attribute those files with meta data. A photo album program would be a good comparison to what I'm trying to do. I'm trying to abstract the interface between my program and the file system which stores the files, and the database which stores the meta data for the files. This...

Automating IP address assignments with .Net (C#)?

I need to automate IP Address assignments using .Net. Is there something already out there or can someone point me in the right direction. I know I can use WMI to do this, but some of the resources were for vbscript. I am hoping to use .Net Update: I need to assign multiple static IPs to a single NIC ...

how do you control the level of a trace listener in the config file

I'm trying to learn the built-in features of tracing. I can't figure out how to use the config to set the level (information, warn, error) that gets written to my listen. I have the default app.config with it . In my code, I use Trace.TraceInformation() and Trace.TraceError. All of the messages are written to my text file. I want to b...

Build .NET-Applications always for lowest possible framework-version?

I'm new in the .NET-world. I just built my first application with .NET-versionn 4.0 and am wondering if its a wise choice to lower the target-framework as much as possible (to 3.0 maybe) if it still works then. Whats best-practice when it comes to choosing the appropriate .NET-version? ...

RadTreeView Telerik 2007 in IE8 issue workaround?

I know - 2007 is outdated - but I can't switch to the newer controls at the moment. I've figured out that the TreeView is not showing properly in IE8 because of an internal function: RadTreeView.AlignImage=function(_4e){ _4e.align="absmiddle"; _4e.style.display="inline"; if(!document.all||window.opera){ if(_4e.nextSibling&&_4e.nextSibl...

LightSwitch beta 1: "CreateRuntimeExtensionAssembliesManifest" task failed unexpectedly

Using LightSwitch Beta 1, every time I build my project I get this error on the ServerGenerated project: The "CreateRuntimeExtensionAssembliesManifest" task failed unexpectedly. System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.LightSwitch.BuildTasks.Extensions.CreateRuntimeExtensionAssemb...

How do I convert hex string into signed integer?

I'm getting a hex string that needs to be converted to a signed 8-bit integer. Currently I'm converting using Int16/Int32, which will obviously not give me a negative value for an 8-bit integer. If I get the value 255 in Hex, how do I convert that to -1 in decimal? I assume I want to use an sbyte, but I'm not sure how to get that valu...

Native XML Databases with .NET

Are there any native XML Databases (That are free and preferably open-source) that work well with .NET ...

Cruise Control .Net not showing Nant build errors

We are running Cruise Control 1.5.7256.1 and using it to do builds using Nant and Nantcontrib. The builds are failing and succeeding correctly, but when they fail the related error messages are being shown on the CCNet Build Report page. See image below The build errors can be seen on the View Build Log page, but they aren't making it...

Trouble downloading a file in C#

I am trying to download a file from a C# application. I have tried two different methods, but both yield the same response: "The remote server returned an error: (401) Unauthorized." I am pretty sure this is a credentials issue (because of the 401). If I navigate to the url from a browser, and enter the very same credentials provided,...

XNA Window Resize Invokes LoadContent

Hi, Anytime I resize my XNA Window to the smallest possible resolution (0 pixels high) the program starts invoking LoadContent again which causes my app to crash (since I only want it to load content once). What can I do, is there a way I can stop the user from resizing my window too much (such as setMinimumSize in Java). Or is there an...

How to require FileUpload with actual upload, not just selecting a file

I have a FileUpload control along with a required field validator. It throws an error if the user doesn't click the Browse button to select a file (which is correct). However, if the user clicks the Browse button, but doesn't click the Upload button, ASP.NET's required validator doesn't throw an error. Any ideas how to fix? ...

Selenium 2.0 IE Xpath Performance

I'm attempting to use selenium-dotnet-2.0a5 to iterate through many tables, and have to use xpath. e.g; var tableRows = _table.FindElements(By.TagName("tr")); foreach (var row in tableRows) { row.FindElements(By.XPath("td|th")); //iterate through tablecells and get text of each } Average times to iterate through about 50 ro...

A String manipulation Question for .NET

How can i remove just first comma + space from below if its there else do nothing. string comments = ", 38, "; ...

MultiThreading WinForms WebBrowser Control

I'm using a WinForms WebBrowser control and am noticing that when the page I'm on forces a refresh from it's end and the control starts to re-render the page, it binds up the entire C# GUI that the control is in. Is there any way to get the browser control to run on a thread other than the GUI thread so that it updates the pages in a se...

Windbg with SOS, stopping on the correct exception

I have a windows service that is, intermittently, throwing an exception that sometimes kills its SQLConnection, and other times kills the service completely. It is running live on a customer's site. I have planned to use Windbg + SOS on it to get a crash dump, so that I can debug this at my own leisure. On my first attempt, however, th...

What libraries are out there in Java/J2EE and .NET for Coldfusion?

I have always been doing web applications in coldfusion, and not long ago, I needed to generate bar codes for a particular web app, so I searched and one of the results was: http://ricardo.parente.us/2008/09/printing-barcode-from-coldfusion/ In this solution, coldfusion utilizes Java's barbecue library to generate barcodes In coldfusi...