.net

.NET Compact Framework with Visual Studio 2010?

Hello can i use .NET Compact Framework with Visual Studio 2010? I have Visual Studio 2003, but i want change to one IDE. ...

Is there a way of using one method to handle others to avoid code duplication?

I wonder if there is a way of writing a method or a class that would add to any method some code that is shared between many methods. The methods return different things and some of them are just void. Below is a part of the code that is duplicated in the methods. StartTimer(MethodBase.GetCurrentMethod().Name); try { // Actual meth...

Software Publisher Certificates and Strong Name Keys are they related?

Should a Software Publisher Certificate granted by a third-part Certification Authority be used to generate a Strong Name Key for use with .NET assemblies? Edit: Another way of stating the question is whether code-signing and strong name keys have anything to do with each other or are they each worlds unto their own? ...

Bitmap lockbits and cloning

Can someone familiar with GDI shed some light on why the following sequence throws? var b = new Bitmap("some file"); var bd= b.LockBits(rect , readonly, px); //correct size and pixel type var clone = (Bitmap)b.Clone(); var cd = clone.LockBits(rect , readonly , px); //okay clone.UnlockBits(cd); //okay b.UnlockBits(bd); //throws -- w...

In .NET when Aborting Thread, can this piece of code get corrupted?

Little intro: In complex multithreaded aplication (enterprise service bus ESB), I need to use Thread.Abort, because this ESB accepts user written modules which communicates with hardware security modules. So if this module gets deadlocked or hardware stops responding - i need to just unload this module and rest of this server aplicatio...

NHibernate Native SQL and DialectScope

Hi, I have two native SQL queries. One for Oracle and one for MSSql. I want to run them trough NHibernate. How do I find out what Db-engine I'm on? I know I can add dialect-scope in mapping files for <database-object />. Is there something similar for <sql-query />? Or should I put an if-loop in my code and try to figure out the dialect...

How to figure out why .NET app runs at 32-bit on a 64-bit machine

I have a .NET app (webforms - .NET 3.5) that is running on a 64-bit server as 32-bit (I checked the IntPtr.Size result). The compilation is set to AnyCPU so I would expect that on a 64-bit machine, the app would be run at 64-bit. There are many Third-party programs incorporated into the app, could they be causing a problem? How do I f...

VB.net save opened word document!

Hi! I just trying to made word add-ins that gone save opened document.I made ribbon and button on it.Below is the that i use for saving word document on certain location: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As Microsoft.Office.Tools.Ribbon.RibbonControlEventArgs) Handles Button1.Click Dim ThisApplic...

Windows Mobile - Way to invert compact framework controls

I have a screen in my windows mobile app that I is intended for another person than the user to look at and interact with (it is a signature screen). There is a few edit boxes and such on that screen. Is there any way to make them display upside down? If so I would love to hear how. Thanks! ...

What does the "ApplicaionDirectory" Membership condition mean in .NET Code Access Security?

I am not sure about the semantic of "ApplicationDirectory" membership condition. I am trying to use it in the .NET Framework 2.0 configuration tool. The tool's explanation to it is as below: The Application Directory membership condition is true for all assemblies in the same directory or in a child directory of the running a...

Strategy for WCF server with .Net clients and Android clients?

I am using WCF to write a server that should be able to communicate with .Net clients, Android clients and possibly other types of clients. The main type of client is a desktop application that will be written in .Net. This client will usually be on the same intranet as the server. It will make an initial call to the server to get the ...

problems with Console.SetOut in Release Mode?

i have a bunch of Console.WriteLines in my code that I can observe at runtime. I communicate with a native library that I also wrote. I'd like to stick some printf's in the native library and observe them too. I don't see them at runtime however. I've created a convoluted hello world app to demonstrate my problem. When the app runs, I...

Code generating SOAP Web Service Proxy objects yourself - C#/.NET 3.5/T4

Is there a framework or code already available that will give me more control over the code that gets generated based off my web references? I'm working at a new company. And the Web Services Proxies are all self contained in their own assembly. I would really rather generate this whole project. Every time they change something on the S...

What is the "Console" in Console.WriteLine statements?

foreach(int i in array1) { Console.WriteLine(i); } What is "Console" in this context? ...

XML Serialization

I am trying to serialize an ASMX web service result, but I get the following error. There is an error in XML document. ---> System.InvalidOperationException: <ArrayOfT_SATQuestionInfo xmlns='http://tempuri.org/'&gt; was not expected Any idea on how to fix this so it will 'expect' the namespace? ...

Poll SelectMode.Read throws WouldBlock all the time on client

I have another tricky situation with my socket experience. I'm writing a non-blocking server/client for some key-value data storage. Here's the situation: connect to server post data to it (wait for no confirmation that data's being submited) right after then (staying on the same connected socket) I'm trying to read that data Here's...

Something Better than .NET Reflector?

I used to love Reflector back in the day, but ever since RedGate took over it has gone downhill dramatically. Now it forces me to update (which is absolutely ridiculous), half the time the update doesn't go smoothly, and it is increasingly hindering my productivity with each update. I am sick of it, and I am ready for something better....

FileSystemWatcher event trigger problem(s)

It seems like , FileSystemWatcher triggers events more than once. Here is my settings ; watcher = new FileSystemWatcher(); watcher.Path = @"D:\testSpace"; watcher.InternalBufferSize = 1024*64; watcher.Deleted += Triggered; watcher.Changed += Triggered; watcher.Created += Triggered; watcher.Error += ErrorOccured; watcher.NotifyF...

C#/.NET: FInd out whether a server exists, Query DNS for SVC records.

Writing a cleint/Server tool I am tasked trying to find a server to connect to. I would love to make things as easy as possible for the user. As such, my idea is to: CHeck whether specific servers (coded by name) exist (like "mail.xxx" for a mail server, for example - my exampüle is not a mail server;) Query otherwise for DNS SVC recor...

C# - Accesing to items for a collection inherited from List<string>

I am trying to implement a new class inherited from List<string>, to load the contents from a text file to the items. using System.Collections.Generic; using System.IO; using System.Linq; public class ListExt : List<string> { string baseDirectory; public void LoadFromFile(string FileName) { //does not work because ...