.net

Visual Studio 2008 network drive trust and .NET 4.0

I'm using Visual Studio 2008 on a PC that also has .NET 4.0 installed to work on code that has to be kept on a network drive. Question is, since .NET 4.0 overrides .NET 3.5 security settings, how the heck do I get VS2008 to trust the network drive? ...

Need Help.. Picture uploader function for windows mobile 6 net cf 3.5

all runs perfect now big thx ... i post the code for all that have the same problem, the iso encoding was the problem .. but how i said big thx .. heres the code for all with the same prob: Public Function uploadPic(ByVal pic As Byte(), ByVal filename As String, ByVal user As String) Dim encoding As String = "iso-8859-2" ...

How to get distinct values from two List<string>?

Hello Experts, I have two list. List<string> a = new List<string>(); List<string> b = new List<string>(); a.Add("a"); a.Add("b"); a.Add("c"); b.Add("a"); b.Add("c"); I want Distinct value into a new list. Thanks in advance ...

Unregister Lease throws InvalidOperationException

I have a application that uses plugins. I load the plugins in another appdomain. I use the RemoteHandle class from http://www.pocketsilicon.com/post/Things-That-Make-My-Life-Hell-Part-1-App-Domains.aspx to keep object from being garbage collected after 5 minutes. This works great as long as my application is running, but when it is shut...

StackOverflowException when calling XmlElement.OuterXml on deeply nested xml

I am having a problem validating some XML input data on my WebService. I am including everything you should need to reproduce the error, so hopefully someone will be able to help me. Thank you in advance! I have some hacker who is sending me some invalid XML to my public interface and instead of being detected in my XSD validation, it...

The transaction has aborted.

I have a multithreaded C# application where each thread has it's own set of db connections. Each thread uses TransactionScope / DTC. Sometimes, I get a "The transaction has aborted" exception. It's not from a timeout since it occurs in less than 2 seconds from starting the transaction. Here's the stacktrace: at System.Transacti...

How do I display a collection of items with a template that uses a Grid in WPF?

I have a collection of objects that I would like to represent as a Grid with each object represented as a Rectangle (or a Button - haven't settled on this yet). Each object has an X and a Y property which represent its location in the Grid. For example, I might have four objects: var one = new MyClass(){X=0, Y=0} var two = new MyClass(...

Unbale to identity WinForm ListView subitems in Coded UI test VSTS 2010

This is my window application code for listview :- // Create three items and three sets of subitems for each item. ListViewItem item1 = new ListViewItem("item1", 0); item1.SubItems.Add("1"); item1.SubItems.Add("2"); item1.SubItems.Add("3"); ListViewItem item2 = new ListViewItem("item2", 1); ...

NHibernate Session Management w/ Ninject

Is this really all that I have to do to achieve session per request with Ninject? public class WebModule : NinjectModule { public override void Load() { Bind<ISession>().ToMethod(x => MvcApplication.SessionFactory.OpenSession()).InRequestScope(); } } Global.asax: public class MvcApplication...

aspx site behaves different on the webserver...but why?

I designed a simple site with some css and jquery. All the css is in the header using and the javascript files are in a folder called Scripts and referenced in my site like below. Everything is beautiful locally, but on the server some objects such as a couple of my divs are out of their original positions, and my dropdown menus that us...

Prohibit an Instance from calling Shared/Static Method?

Is it possible to prohibit an instance of a class from calling a shared/static method? For example: I want to allow this: ClassName.MethodOne() But I want to disallow this: Dim A As New ClassName A.MethodOne() The reason this is desirable is that in this case it is semantically confusing if an instance can call the method. ...

How to add a property to a PNG file

I have a PNG file to which i want to add the properties Pixels per unit, X axis Pixels per unit, Y axis Unit specifier: meters These properties are explained in the PNG specification: http://www.w3.org/TR/PNG-Chunks.html I have programmatically read the properties of the png to check if the properties exists, so that i can set the...

How to create overloading functions in Visual-C++ library (.net) ?

So what I want is to create 3 functions with same names but taking difrent arguments (one will take 2 and others one lats say System::String). (I will compile tham into .net library from visual-C++, create a c# project, connect my lib to it and want to be able to see in my library one function name which would have 3 overloads.) How to ...

Problem: .NET Performance counter data goes missing after a short period

I am trying to log the .Net memory performance counters but the logs stop recording data after a bit. I am doing this for a bunch of servers and all of them stop working at different points in time. Here is the one I am logging .NET CLR Memory(w3wp)# Total reserved Bytes But the other counters like vbytes etc. also show the same results....

Where is System.ServiceModel.DomainServices.EntityFramework DLL?

Hello, I'm trying to use RIA services, I installed Silverlight 4 and Silverlight 4 Tools/SDK, but I cannot setup a LINQToEntitiesDomainService because I can't find this namespace/assembly: System.ServiceModel.DomainServices.EntityFramework. Where does this assembly come from, not sure why it's missing? Is that an add-on I'm missing? ...

Is it possible to create an association between two normal fields in Entity Framework, thereby ignoring the primary key?

Hello fellows, I have the following situation between these three tables: Before I start explaining what I'm trying to accomplish here, let me clarify three things: I drew the model on EntityFramework, but this is actually the database view. Just assume that the fields type match between tables; I know that this database model suck...

Running a .NET app slower

I'd like to test my programs running on older machines. How can you run a .NET app as though you were on a slower processor? eg: run as if on a 400 mHz processor -- the .NET 2.0 minimum requirement. (I know RAM, hard drive speed, etc. would effect my running time also, but I have to start somewhere.) ...

(.NET) What classes implement Microsoft.Office.Interop.Outlook.TimeZone

I'm having trouble finding any classes that implement Microsoft.Office.Interop.Outlook.TimeZone. Do any such classes exist? ...

What's the easiest way to get the binary representation of an integer?

Actually, I'm not asking how to implement this functionality myself. I know it wouldn't be very complicated. I just don't want to reinvent the wheel, so I was wondering if this functionality exists somewhere in the BCL. It seems like surely it's there somewhere... Example input/desired output: Input Output 1 1 2 ...

WCF: Data contract being converted to message contract

My WCF service exports a single operation, marked with the catch-all action and reply action so that it represents a common entry point to the service: [ServiceContract] public interface IService { [OperationContract (Action="*", ReplyAction="*")] Message MyMethod (Message msg); } Client proxies are still generated as data con...