.net

Nhibernate, error performing isolated work

First question here I have a parent object with child object I'm using hilo generator and spring transaction manager the save operation give the error in the title. ...

How do I make a thread dump with MONO?

How can I show the threads (stacktraces) in a hanging application that run with MONO? I know that I can do it in .NET with the Managed Stack Explorer (MSE). Because the application hang only with MONO that I need to do it with MONO. Or there are any other ideas how I can find the place of hanging? ...

Caching problems when developing type converters and editors in the ide for vb.net, winforms.

Any time I make a change to a type converter or editor, I have to close down my visual basic 2008 express ide and restart it. If i don't restart, the following problems occur: (1) The designer shows what appear to be random errors. I solve this by running the app, so not a real problem there. (2) Serialization of design time propertie...

Strongly name three assemblies that reference each other

This is probably really easy, but I'm stumped (and I'm a noob with c#). I have 3 assemblies that reference each other (for example, registering for notification of a delegate method, or calling a public method), all of which compile fine until I try to sign them with a strong name. Then I can't compile any of them, since the other two ...

.NET webservice call pooling?

I am writing acceptance tests to validate a system and it's data access is all done through web service calls. Unfortunately, because I make so many calls, so quickly, I run into the following error System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted ...

EntLib Logging via email in Windows Service (not async?)

I'm writing a windows service and attempting to do some logging via enterprise library 4.0. Logs go to the event log and email. The event log entries get written fine but emails are only sent after I stop the service. So I could have 30 exceptions occur, log them and no emails would be sent until I shut it down. Then a few minutes later...

Workaround for String.Contains() in C# .NetCF 2.0?

There is a string method called Contains. It allows you to quickly search a string for another string. I need to use this in a .netcf 2.0 application but per MSDN it does not come available until the 3.5 framework. Can anyone offer a work around (C#)? TIA Noble ...

Best way to 'convert' a shared base ?

-edit- Jason makes a good point that i could add both types to a list of A. But i cant use A due to reflections. Thus i want to know a way to convert the base data from one derive to another. I know in C++ in certain cases i could simply do *(A*)this = (A)that. I am hoping there is something just as simple in C#. I seriously do have the...

'System.InvalidOperationException: Request format is invalid: multipart/form-data' error when posting image from iphone to .NET webservice.

I'm trying to post an image from an iphone app to a .Net webservice and I'm running into this error. I've already updated my web.config as per this kb article and I can successfully post to methods that take strings as params. My issue is attempting to post data with an image. I've tried posting this way and that way, but both ways I ...

Can I declare a variable of Type<T> without specifying T at compile time?

How do I Load the class "MyContent" dynamically ? I have 1 interface<T>, 1 abstract generic class<T> and 1 class. Check my code out: public interface IMyObjectInterface{ } public abstract MyAbstractObject : IMyObjectInterface{ } public class MyObject : MyAbstractObject{ } public interface IMyContentInterface<T> where T : MyAbstractObj...

How a System.Configuration.Install.Installer instance can get the destination folder?

When my ProjectInstaller : System.Configuration.Install.Installer is called by the Setup project the current path is c:\windows\system32. How can I get the path where the application is being installed without hard coding this to the project ? (the destination path is something like c:\program files\[manufacturer]\[service name]) ...

Using ASP .NET 3.5 Themes with Embedded Resources...

I'm curious if this is possible. Let me give you an idea of how we're using theming and why we want to use a single resource dll to fetch resources. We currently have an App_Themes directory with our main (and only at the moment) theme. Call it MainTheme. We're using a third party control suite (Telerik) and have several customized C...

How to parse a text file?

Basically I need someone to help me or show me the code that will allow me to read a name and a price from a file i have called c1.txt. This is what i already have. TextReader c1 = new StreamReader("c1.txt"); if (cse == "c1") { string compc1; compc1 = c1.ReadLine(); Console.WriteL...

Copy a class to another?

I have class A { public int a; public string b; } How can i copy A to another A? In C++ i know i could do *a1 = *a2;. Is there something similar in C#? I know i could write a generic solution using reflection but i hope something exist already. I'm considering changing A to a nullable struct. Step 2 i'll need to do class B ...

Customizing the VS 2008 Setup Project Uninstaller

Hi, I have a setup project for my .NET application, and both install/uninstall are working just fine, if they are left alone while they work. However, if someone cancels the uninstall while it is processing, the rollback doesn't seem to be handled correctly, and upon trying to uninstall again at a later time, the user is greeted with a...

Change assembly attribute values after the build in .Net

I want to change the assembly attribute like AssemblyTitleAttribute value to something else once the build is done. Is this possible? Its just that we have two types of builds one is base and the other is obfuscated, so we just want to add some changes to title / attribute values without rebiulding the assemblies. ...

.net 3.5 List<T> Equality and GetHashCode

I'm implementing IEquatable in a custom class that has a List<T> as a property, like so: public class Person { public string FirstName { get; set; } public string LastName { get; set; } public List<string> Dislikes; public bool Equals(Person p) { if (p == null) { return false; } ...

Assembly redirection in code instead of app.config

I'm using ironruby to execute a script that loads an assembly with a dependency that needs to be redirected from v2.0.0.0 to v3.5.0.0 in the app.config like this: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b...

vb.net code works on IE but not on chrome or Firefox

I have .net code that works on IE8 but wont work on google chrome or firefox. i have put this code for the user to press Enter instead of clicking the mouse everytime. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Try If Not IsPostBack Then //-- my code -- ...

Stateful eventing in C#

Are there any stateful eventing mechanisms in .net(c#) or any libraries that will help me maintain a state for the events fired By stateful I mean an event when fired is serialized to a persistent storage. If the system fails for some reason and then when it is bought back picks up the serialized state and then fires it again. I am a...