.net

Can I use a library which references an unavailable assembly, if it's not used?

I have a library X, which has a class C which used component Y. However, Y isn't available in 64 bit, so it's been replaced by component Z, but I want to still use Y when available. So I would like to reference Y and Z and then have C.vb: #If 32bit then Class C // implementation of C using Y End Class #End If C64.vb #If 64bit then ...

UserControl Location in WPF

I am new in WPF, I created a new UserControl MyUserControl. Now I am surprised: the UserContol does not have a location. How can I read (by code) myUserControl1.Location in the parent container? I explain: I have some Dots (UserControls) that the user can drag in a panel. Actually, I am not sure what kind of Panel this will be... P...

Status Messageboxes going behind the application

I have a situation like this..I have a windows application (Single threaded) that has one main form. After performing some operation, I'll get a message "Operation completed successfully" But most of the time it goes behind my application and hence it is not visible. Any idea why this is happening ? Thanks in Advance ...

Can Log4net run in a newly created AppDomain

I have a windows service that executes pieces of code in a new AppDomain. This AppDomain is created just for executing this pieces of code then destroyed thereafter. I am using log4net for logging purpose since I like its simplicity and flexibility. It works just fine in the default AppDomain, but logging statements inside the newly crea...

Set .Net 4 'useLegacyV2RuntimeActivationPolicy' during runtime?

Is it possible to set the app.config useLegacyV2RuntimeActivationPolicy parameter during runtime (basically before one of the 'affected' assemblies is being loaded?). ...

C# Memory leak, tracking techinques and tools.

The app I am writing is suffering quite dramatically from a memory leak. Pretty much the entire object model is staying in memory when a user closes down a loaded project. The way I know this is because closing a project in my app barely effects the memory usage in the task manager and then opening a new project almost makes it double ...

Windows Search using OLE DB SQL Fields

Hi I need to use Windows Search within my .NET application to search for certain files containing certain keywords. All of this seams easy enough using OLE DB to connect to the Windows Search data store on Windows 7. I have what I hope is a seriously easy question. I have been searching high and low for the field definitions for the SQ...

Selecting items from a list to achieve a sum

I have a list of items that has numeric values and I need to achieve a sum using these items. I need your help to build such an algorithm. Below, there is a sample that describes my problem, written in C#: int sum = 21; List<Item> list = new List<Item>(); list.Add(new Item() { Id = Guid.NewGuid(), Value = 3 }); list.Add(new Item() { Id...

IIS settings problem

I have installed IIS on my windows7 but it is some problems with it. I successfully can open html files like (http)://localhost/index.html , but can't open ASP site: (http)://localhost/ProjectList.aspx HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a scrip...

What is the "correct" way to initialize a C# delegate?

C# delegates have always been difficult for me to grasp and so I was very happy to stumble across logicchild's article on The Code Project web site titled "C# Delegates: Step by Step". He has a very succinct way of explaining C# delegates and I can recommend it to you. However, in trying out the examples, I see that are two ways to initi...

Wrong URL in WSDL hyperlink when using WCF (https)

I got my WCF Service running with HTTPS, It shows the Infopage, but the URL below "To test this service, ... with the following syntax:" is: svcutil.exe https://servername.group.service.com/MyService.svc?wsdl (full address of the server) Instead of the correct URL https://my.service.com/MyService.svc?wsdl (assigned hostheader), how can...

How can I implement my existing Business Layer to a SilverLight 4.0 Application?

Hi, Lets assume that I have my own business layer containing my business objects and my business services. And I have decided to create a "SilverLight Business Application" (with SL v 4.0) and I want to use my already used Business Layer from the SL application I plan to develop. I know that I cannot include a project which is not a SL...

nUnit - ignore GAC copy of a DLL

I am using a nUnit to, well, unit test an assembly. The assembly is in my project output dir (\bin\debug) and is loaded into nUnit (Assemblies > Add Assembly) from this location. However an older version is also in the GAC and nUnit is picking this one up instead. I can of course remove the old version and re-install to the GAC upon b...

Binding problem in WPF

I am new in WPF, need to bind a line to 2 dots. But the code bellow does not work: <Canvas> <Ellipse x:Name="dot1" Width="5" Height="5" Canvas.Left="50" Canvas.Top="50"/> <Ellipse x:Name="dot2" Width="5" Height="5" Canvas.Left="100" Canvas.Top="100"/> <Line X1="{Binding ElementNa...

IronPython -> .exe Executable & distribute with all DLLs HELP

Been trying to compile this IronPython program into a working .exe for the past 3-4 hours with no luck. I'm using the pyc.py that came with "IronPython 2.6 for .NET 4.0" D:\IronTestCompile>ipy pyc.py file1.py file2.py /out:Program /main:program.py /target:exe The program compiles out to Program.dll & Program.exe but the Program.exe ca...

How can I use UDP Multicast in Silverlight4?

How can I use UDP Multicast? Who can help me? I have some sample, but it does not work. Who can explain me how to work with this technology? ...

2 Properties in One Binding?

Can I combine 2 elements in one biding? <Canvas> <Ellipse Fill="Black" x:Name="dot1" Width="16" Height="16" Canvas.Left="124" Canvas.Top="133"/> <Ellipse Fill="Black" x:Name="dot2" Width="16" Height="16" Canvas.Left="221" Canvas.Top="40"/> <Line Stroke="Black" x:Name="line1" X1="{Binding ElementName=dot1, Path=(Ca...

Is there a programmatic way I can hook into user logins and logouts (Windows SBS 2003) with the goal of simple logging?

I'm trying to write a central reporting tool that will allow time tracking based on Windows users logging into a domain. Initially I was going to create a small executable that would run on 'all users' start-up on each computer, track the logged in username and update a central database. The main problems with this would be having to m...

Application.OpenForms.Count = 0 always

I have this situation. Application.OpenForms doesnt return the right result. ie Application.OpenForms.Count = 0 always.. Purpose of getting the form is get the owner of the Form so that I can pass the owner as the parameter of the MessageBox.Show() function. ...

retrieve all configuration settings that are loaded by the configuration manager

Is there any way to enumerate through all settings to get the values that have been loaded by the configuration manager? Maybe I'm being dense here, but I can't find a way to enumerate through the settings that are contained within a section group. I have a WCF service which is a designed to allow the calling system to pass in request ...