.net

How to combine URIs

I have two Uri objects passed into some code, one is a directory and the other is a filename (or a relative path) var a = new Uri("file:///C:/Some/Dirs"); var b = new Uri("some.file"); when I try and combine them like this: var c = new Uri(a,b); I get file:///C:/Some/some.file where I wold expect to get the same effect as with ...

Using MSBuild to Sign ClickOnce or Assembly Error: MSB3321

I've set up my simple project in VS2008 to use a click-once installer. I've specified that the ClickOnce manifests should be signed by our comapny's pfx file. When I set this up in Visual Studio it asked for the password for the pfx file, which I gladly supplied. Everything works fine when I build and publish from within Visual Studio. I...

How can I get Powershell TabExpansion to print all the possible completions?

The default TabExpansion in Powershell cycles through the possible completions for the fragment on the command prompt. Internally in the PowerShell host, there's a circular buffer, and the first TAB fills the buffer and puts the first potential completion on the prompt. Subsequent TABs cycle through the list of possible completions. ...

Sending formatted text with UCMA 2.0

Has anyone been successful in sending formatted text over an Instant Message flow using the UCMA 2.0 sdk? It doesn't seem to be very well documented on MSDN. Are there any examples out there? Any books that talk about this? ...

Creating UDF with VSTO in Excel

Hi there, I know how I can do this for the simple case as details here: http://geekswithblogs.net/Denis/archive/2007/01/03/102623.aspx But what I'm trying to do is when my category is selected in Excel I want to be able to dynamically populate the function list at run-time. As is, it's populated using all public function in the catego...

C# winforms: Is my separation of GUI and logic done correctly?

Edit Based on suggestions below to send the logic code GUI delegates, I came up with code like this: Action ClearFunction = new Action(()=>Invoke(new Action(delegate() { ResultsBox.Clear(); } ) )); Is it possible to shorten this? Here is part of my C# windows forms program. When I started converting the code to use another thread...

Binding to properties of a control in a tooltip

Hi, I want to display some properties of a (custom) Label in its Tooltip, but I can't seem to get it working correctly so must be doing something wrong: <Label.ToolTip> <Border BorderBrush="Gray" CornerRadius="5" Margin="5" Padding="5"> <Label Content="{Binding Path=Width, RelativeSource={RelativeSource Mode=FindAncestor, An...

SOAP using C#

How do you use SOAP using C#? Is there a simple, yet effective tutorial for this? ...

How can I execute Javascript function before Page load?

Hi, I am using a hidden field 'Isjsenabled' to detect whether Client's Javascript is enabled or disabled. If Javascript is enabled, Javascript function will be fired and it will set hidden field's value to 1. I want to check the hidden value from server side Page_load. But the problem is Javascript gets fired after Page load. Do you ...

Sending and receiving SOAP messages without envelopes in C#

This there a good tutorial or example of C# code sending and receiving SOAP messages without using a SOAP envelope? ...

What's the compelling reason to upgrade to Visual Studio 2010 from VS2008?

Are there new features in Visual Studio 2010 that are must-haves? If so, which ones? For me, the big draws for VS2008 as compared to VS2005 were LINQ, .NET Framework multitargeting, WCF (REST + Syndication), and general devenv.exe reliability. Granted, some of these features are framework things, and not tool things. For the purposes o...

How to get the PEKind and ImageFileMachine of a AMD64 assembly from a x86 .NET Application (and viceversa)?

I'm writing a installation validation tool for our product and I need to retrieve some PE information from several installed assemblies. No matter what the platform our product is installed on, we ship AMD64, x86 and MSIL assemblies to certain locations to let the user create deployment projects for these the platforms. The problem is ...

Using WSDL for sending and receiving in C#

You are given a WSDL and a sample soap message, is there a good tutorial or sample code in using that WSDL to consume a web service? Does the WSDL follow a certain format in order for which it can be consumed properly? I recall a web service in Java that I changed certain tags and attributes in order for this to work, is there a gener...

C#: Restricting Types in method parameters (not generic parameters)

I'd like to code a function like the following public void Foo(System.Type t where t : MyClass) { ... } In other words, the argument type is System.Type, and I want to restrict the allowed Types to those that derive from MyClass. Is there any way to specify this syntactically, or does t have to be checked at runtime? ...

Unable to Step in to .net framework source code

Hi I am able to load the symbols but not able to step-in. How to achieve this? This is for .Net 3.5 SP1 ...

Invalid attribute value for property TargetType in Silverlight Custom Control

Any idea why I get this error with the following code? I'm trying to create a default template for a custom control in Silverlight 3. IInvalid attribute value custom:CaptionControl for property TargetType. [Line: 5 Position: 23] <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://...

How to add code to a DLL at run time

Hi there, Let's say in the constructor of my .NET class I want to write code that will actually add methods to my class dynamically. So now when I reflect over my class I will see the methods where as when I first built the project the methods didn't exist How can I achieve this? I've been looking up CodeDom but it's all a bit confusi...

What is .NET Framework?

I am confused can someone clarify what is .NET Framework means? Is that an another name of Visual Studio? ...

VSTO, UDF: Accessing the function list programmatically

Hi there, Is there any way of programmatically accessing the Excel Fucntion list of a UDF so I can dynamically add more enteries to it? ...

[resolved] Can Access "Forms" be treated like .NET forms, example given inside

In a .net project, create two forms {Form1, Form2} and on each form create a basic button {Button1} On [Form1] use this code: Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim myform As New Form2 myform.Show() End Sub End Class and on [Form2]: P...