.net

Install .NET 4.0 dll to the GAC

I have a visual C# 2010 express install. Built a .NET 4.0 dll that is signed. Now I need to get it into the GAC. Im on 64bit vista. Anyone know if there is a gacutil supporting the 4.0 framework yet? Any other suggestions on getting it into the GAC? I have tried drag and drop into C:\Windows\assembly, whenever I do, it appears to c...

What is the target color profile in Image.FromFile?

I am curious what the useEmbeddedColorManagement parameter in System.Drawing.Image.FromFile actually does. This parameter directory corresponds to a GDI+ parameter in the same method of the same class. So debugging .NET source does not lead anywhere. If my understanding of color profiles is correct, a color profile is basically a mappin...

Extending the SketchFlow player

I would like to add some controls to the SketchFlow player. For example, I would like to add a combo box with a list of values for a specific variable, and selecting a value will make a specific screen/state show up in the SketchFlow player canvas. Is this possible? I have seen that using the PlayerContext allows access to some controls/...

What is this <Module> Type in an assembly

Each time I open an assembly in reflector, I see this special <Module> type that shows up. Recently, I came across an assembly that has a static method defined in this type and I want to invoke it through reflection. Is this possible? Btw, this method has privatescope hidebysig method attributes EDIT: Assembly assembly = Assembl...

Integer array or struct array - which is better?

In my app, I'm storing Bitmap data in a two-dimensional integer array (int[,]). To access the R, G and B values I use something like this: // read: int i = _data[x, y]; byte B = (byte)(i >> 0); byte G = (byte)(i >> 8); byte R = (byte)(i >> 16); // write: _data[x, y] = BitConverter.ToInt32(new byte[] { B, G, R, 0 }, 0); I'm using inte...

MS Exam 70-536 - How can you constrain the input before you write any code?

Hello! In MS Exam 70-536 .Net Foundation, Chapter 3 "Searching, Modifying, and Encoding Text" in Case Scenario 1 Your organization, Northwind Traders, is creating a Web-based application to allow customers to enter their own contact information into your database. As a new employee, you are assigned a simple task: create the fro...

Replace low level web-service reference call transport with custom one

I'm not sure if title sounds right actually, so I will give more explanation here. I will begin from very beginning :) I'm using c# and .net for my development. I have an application that makes requests to some soap web-service and for each user request it produces 3 to 10 requests for web-service, they should all run async to finish...

.NET Month Picker Control

Hi all, Is there a winforms month-only picker control? I need to allow the user to select the month regardless of the day of the month. Thanks. ...

How do you load the app.config file into a DLL

So I cant find a definitive answer to the Question. How do you load the app.config file into a DLL. I understand that generally the App.config info should be put into the executable app.config. However i am building an add-in and have to executable available. I would like to use the namespace.dll.config file to store my variables, bu...

How can avoid at this line an OverflowException?

LastInput.time is an Integer and m_idleTime is an Integer too. This line sometimes generates an Overflow exception, I think that this happens when both values are big negative values. (Environment.TickCount - lastInput.time) > m_idleTime How can I avoid that? With casting? (CType(Environment.TickCount,Long) - CType(lastInput.time,Lon...

WCF: How to detect new connections to WCF PerSession services ?

I have a self-hosted WCF service with the InstanceContextMode set to PerSession. How can I detect new client connections (sessions) to my service from the host application and use that new session context to observe my service trough its events? Something like: [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)] pub...

How to implement a .net 3-tier architecture using Winforms

I have for some time build n-tier Applications using a database server as the data tier, Winforms as the presentation tier and an ASP.NET asmx webservice in the middle to send back and forth untyped Datasets. While this approach has worked for me so far, it certainly does feel outdated today. What technologies should I use if I were to ...

What's the primary use of Windows Event Viewer?

Hi all, Just wondering what everybody's opinion is on the Windows Admin tool Event Viewer? I'm writing a WCF application at the moment and have started logging errors to the windows event viewer when I handle them. I then started thinking, should I be logging more than just errors, such as when a user has logged in or out or would you ...

Converting a URI path to a relative file system path in .NET

How do I convert an absolute or relative URI path (e.g. /foo/bar.txt) to a (segmentwise) corresponding relative file system path (e.g. foo\bar.txt) in .NET? My program is not an ASP.NET application. ...

IEnumerable.GetEnumerator() and IEnumerable<T>.GetEnumerator()

Hi, In the .net framework, there's a generic IEnumerable<T> interface which inherits from the not-generic IEnumerable, and they both have a GetEnumerator() method. The only differents between these two GetEnumerator() is the return type. Now I have a similar design, but when I compile the code, the compiler said: MyInterface<T>.GetIte...

How to select min and max values of a column in a datatable?

For the following datatable column, what is the fastest way to get the min and max values? AccountLevel 0 1 2 3 ...

How to set exe icon using AssemblyBuilder?

Given that I am generating an exe application with AssemblyBuilder, how do I set an icon to it? I think I should be using System.Reflection.Emit.AssemblyBuilder.DefineUnmanagedResource Is there an example how to do it? http://msdn.microsoft.com/en-us/library/aa380599(VS.85).aspx ...

File comparison utility

Hello all I am looking for compare utility similar for "win merge" or "beyond compare" . That in addition for gui comparison will have api that i will be able to run on my files via my code and see if the files are the same or not and also use it in gui mode to show graphically the differences . Any recommendations ? thanks ...

Monovation: Assembly Injection into Live Processes

I read this article by Miguel de Icaza on attaching an assembly into a live mono process. How is this any different to attaching a DLL to a running process? I do this already, but once the DLL is attached, it can't be unloaded without using an AppDomain (which I am trying to avoid). Miguel talks about "patch[ing] running programs", but...

.net - invoke methods from classes from a certain namespace via reflection

SPL and PHP allows you to create objects on the fly from classes, that fulfill certain conditions, such as implementing certain interfaces and stuff like that. However, I would like to do something similar in c# and automatically create objects from all classes in a namespace and invoke a particular method from those classes that implem...