.net

what is the right versioning strategy for different version of .NET

What is the right way to version assemblies for different versions of .NET? For example, if I have an assembly foo.dll and I produce a version for .NET 2.0 and a version for .NET 4.0, what is the best option: Provide two assemblies foo.20.dll and foo.40.dll Allow only one version installed on a given computer Provide two assemblies wi...

ASP.NET Load unmanaged dll from bin folder

Question: I use an embedded Firebird database in ASP.NET. Now, Firebird has a .NET wrapper around native dlls. The problem is, with the .NET compilation and execution process, the dlls get shadow copied to a temporary folder. Unfortunately, only the .NET dlls, and not the native dll. See http://msdn.microsoft.com/en-us/library/ms36672...

.NET interop COM DLL behaves differently in VB6 debugger

I have a .NET v2.0 Dll that exposes a few classes to COM. The assembly is called BLogic.DLL I'm calling these classes from a legacy visual basic 6.0 application. I can generate and EXE file and if I have Blogic.dll in the same folder as the EXE, the program runs without a hitch. However If I try and launch the same program within the V...

Is there anyway to duplicate the intellisense provided by the Color struct in visual studio?

What I want to do is provide some public static fields that will be used as instances of an interface implementation and have intellisense pick them up when the interface is a method argument. The idea is to have it look like an enum to the developer. I reference Color because basically this is the behavior I want, I just don't know ho...

.NET System.Net.Mail messages are always being flagged junk, on internal server.

I'm using System.Net.Mail to send out a few emails. The emails are being sent by our internal mail server to local addresses. However all of the messages are going straight to junk in Outlook. The messages are being sent from valid email addresses. What would be causing our our servers to label it as junk? MailMessage msg = new MailMess...

Can you step into specific properties in VS 2010?

I know that you can either step into every property or not step into every property, but I would really like to be able to step into a specific property, and not the rest. Is this possible? (I also know I can use keyboard commands, but I'm asking if there's a more permanent solution.) I have a lot of properties and my setters do importan...

How to install .Net Framework 2.0 without harming 3.5 and 4.0 already installed?

I've got quite a complex .Net 2.0 project to build (with VS 2010) which does not build without 2.0 version of System.ServiceModel.dll and does not run if compiled with .Framework 4.0. Can I install Net Framework 2.0 safely after 3.5 and 4.0? Or where can I download an old System.ServiceModel .dll assembly? ...

Width of dynamic created Label in runtime on C#

I create Label in runtime: Label myLabel = new Label {Text = "somText"};. After that myLabel.Width equals default value 104. How I can know real width of myLabel? ...

How do I use SafeHandle to safely use TimeZoneInfo with SQL CLR?

I am trying to use .NET TimeZoneInfo class from a SQL CLR function, as described in stackoverflow questions here and here. While researching possible solutions, I found this post that suggests using SafeHandle to safely handle the resources accessed by TimeZoneInfo. How do I use SafeHandle in this situation? ...

Threading and cores

If I have X cores on my machine and I start X threads. Let's assume for the sake of argument that each thread is completely separated in terms of the memory, hdd, etc it uses. Is the OS going to know to send each thread to a core or do more time slicing on one core for multiple threads. What the question boils down to, is if I have X co...

Good .NET library for fast streaming / batching trigonometry (Atan)?

I need to call Atan on millions of values per second. Is there a good library to perform this operation in batch very fast. For example, a library that streams the low level logic using something like SSE? I have profiled the application, and I know that this call to Atan is a bottleneck. I know that there is support for this in Open...

What to sign when signing a message with ws-security

I am adding security to my web service and chose to sign the Timestamp and Token. While reading docs I found a lot of examples where they sign the Body of the SOAP message. My question is: what is best to sign? From what I understand signing the Body could lead to performance issues if the Body is pretty large. Thanks. ...

Is there anything wrong with having a few private methods exposing IQueryable<T> and all public methods exposing IEnumerable<T>?

I'm wondering if there is a better way to approach this problem. The objective is to reuse code. Let’s say that I have a Linq-To-SQL datacontext and I've written a "repository style" class that wraps up a lot of the methods I need and exposes IQueryables. (so far, no problem). Now, I'm building a service layer to sit on top of this rep...

Get user email using facebook toolkit

Hi! I try to get user's emails, I got extemded permissions, this is my code: string email_address = ""; var response = MainForm.stFacebookService.Api.Fql.Query(String.Format("SELECT email FROM user WHERE uid = {0}", "1495548076")); XDocument xml = XDocument.Parse(response); XNamespace fbns = XName...

.Net Entity Framework & POCO ... querying full table problem

I'm attempting to implement a repository pattern with my poco objects auto generated from my edmx. In my repository class, I have: IObjectSet<E> _objectSet; private IObjectSet<E> objectSet { get { if (_objectSet == null) { _objectSet = this._context.CreateObjectSet<E>(); } return _obj...

HTTP 400 Bad Request error attempting to add web reference to WCF Service

I have been trying to port a legacy WSE 3 web service to WCF. Since maintaining backwards compatibility with WSE 3 clients is the goal, I've followed the guidance in this article. After much trial and error, I can call the WCF service from my WSE 3 client. However, I am unable to add or update a web reference to this service from Visual...

.NET: bool vs enum as a method parameter

Each time I'm writing a method that takes a boolean parameter representing an option, I find myself thinking: "should I replace this by an enum which would make reading the method calls much easier?". Consider the following with an object that takes a parameter telling whether the implementation should use its thread-safe version or not...

Best way to encrypt certain fields in SQL Server 2008?

I'm writing a .NET web app that will read and write information to a SQL Server 2008 database. Some of this information will be highly confidential in nature so I want to encrypt certain data elements. I don't want to use TDE or any full-database encryption for performance reasons. My main concern is protecting this sensitive data as a...

Choosing a type for search results in C#

I have a result set that will never exceed 500; the results that come back from the web-service are assigned to a search results object. The data from the webservice is about 2mb; the bit I want to use is about a third of each record, so this allows me to cache and quickly manipulate it. I want to be able to sort and filter the results...

C# System.Diagnostics.Process redirecting Standard Out for large amounts of data

I running an exe from a .NET app and trying to redirect standard out to a streamreader. The problem is that when I do myprocess.exe >> out.txt out.txt is close to 14mb. When I do the command line version it is very fast but when I run the process from my csharp app it is excruciatingly slow because I believe the default streamreader ...