Ahmed Salijee

February 2006 - Posts

Datetime bug with WCF Jan CTP?

I was playing around with a lab on WCF which can be found at http://windowscommunication.net/collateral/pages/Lab2ReliableTransacted.htm. I got stuck for ages with a CommunicationException telling me that the server could not return a meaningful reply (tell me about it). I tried a bunch of stuff and finally stumbled across this post http://turtle.net.nz/blog/CategoryView,category,WCF.aspx

I finally modified the line trade.Date = DateTime.Now.AddMonths(2); to a hardcoded date of trade.Date = new DateTime(2005, 5, 5);

And happy days are here again

resolving my windows workflow errors

I decided to play a bit with Windows Workflow and was greeted with this (granted this is a machine that has had all kinds of betas over an extended period of time)

 

Method not found: 'Boolean System.Workflow.ComponentModel.Compiler.IWorkflowCompilerOptionsService.get_CheckTypes()'.

 

After trying lots of stuff this seemed to work.

 

Went to the Workflow dir and did an msiexec /x to remove workflow

Went to the GAC and removed the Workflow.* stuff


Repaired my WinFX install and all seems to be ok.

 

I did have the problem of no workflow items appearing on the toolbox but this was quickly resolved with a reset toolbox

 

 

 

ASP.NET How do I Video Series

It covers many of the common tasks in short 15 minute videos. Visit http://msdn.microsoft.com/asp.net/learning/learn/newtodevelopment/default.aspx

ASP.NET RSS Toolkit

Check it out and download links at http://blogs.msdn.com/dmitryr/archive/2006/02/21/536552.aspx

Nice walkthrough at http://weblogs.asp.net/scottgu/archive/2006/02/22/438738.aspx

Are you an ISV wanting to test your SQL2000 based app for SQL2005 compatibility

If yes, send me an email , ahmeds at Microsoft dot com

We might have some spaces available at a lab event (no promises)

Architects Forum - Ingo Rammer will be there

Software Factories is certainly an interesting topic and this year Ingo Rammer and Beat Schwegler will be here to talk about it. Beat is an excellent presenter and Ingo ? well if you have did any .NET Remoting you probably have read something from him. So go on ? signup J

Defining, building, and using Software Factories

This forum will present Software Factories ? an effort underway at Microsoft to evolve beyond the universal one-size-fits-all approach to constructing, deploying and managing software.

A Software Factory is a development environment configured to support the rapid production of a specific type of application via a custom collection of domain-specific languages organised by a graph of viewpoints.

By introducing patterns of industrialisation, Software Factories promise to drive the evolution of software development methods and change the character of the software industry.

For more information on the event, please visit: http://www.microsoft.com/southafrica/architectforum/

Venues

Johannesburg : Microsoft, Bryanston: Wednesday, 8 March 2006

Durban????????????? : Elangeni Hotel: Thursday, 9 March 2006

Cape Town?????? : MTN ScienceCentre (Canal Walk): Friday, 10 March 2006

VSTS Tip - I have subscribed using bissubscribe , how to do Unsubscribe?

This is another one of the things I learned when getting ready for a TechED session and I was looking at again recently. I was doing a demo on subscribing to TFS events, which is quite neat. You can hook into the events that TFS raises and then send an email or call a webservice. You can hook into these events using the bissubscribe.exe tool. This allows you to get into some interesting scenarios and also allows you to do continuous integration. For CI you simply trap the Checkin event, call a webservice and in the service you start a build. There is a sample of this posted on the MSDN forums I think

That?s the background. The problem I had (especially for a demo scenario) was to remove my subscriptions created using bissubscribe.exe. I hunted around hoping that bissubscribe would have a flag for removing the subscription. I looked for a bisunsubscribe. No luck. I did a search and found a hit where someone recommended removing an entry from the database. Then I browsed around the webservices that are available and finally found a resolution. If you look at http://localhost:8080/services/v1.0/EventService.asmx (you might need to change your server name and port) there are some webmethods. One of them is the UnsubscribeEvent. Another useful one is the EventSubscriptions service that gets you the list of subscriptions for a particular user. This is useful as you need to pass an id to the  UnsubscribeEvent and you can get the id from the EventSubscriptions service.

BTW In my session at TechED. I saw a bunch of blank faces when I mentioned Continuous Integration. Only about 5% of the audience knew what I was talking about.


Macros are nice!

This should have been an old post. During TechED last year I had to do a keynote demo. In fact during TechED time there is stacks of little stuff I learn ? just too little time to blog. The thing is they wanted to limit the amount of time for my VSTO demo ? how dare they J.  BTW VSTO totally rocks!!

I started to look at ways of speeding up my demo (yeah a nice 64 bit machine with 4GB RAM ? I wish). I started to investigate the macro functionality. I always knew macros were there. I just never used them.

In this case as part of my demo I had to add a couple of projects and then add references to these projects as well. This is a few mouse clicks and I reckoned this was the best thing to automate. My best experience with macros was with Excel VBA. The macro recorder in Excel is nice and I was expecting the same thing. Unfortunately the recorder in this case did not even come close and I was a bit disappointed. None the less it did provide some useful hints. I started to investigate. I ultimately ended up with the code below. Yes the paths are hardcoded ? the app did not need to go into production J. I did have one additional line of code (not included here) to automatically turn on XML comments for the vbproj control (turns out by default that XML comments for VB based controls are off).

The code assumes you have 1 project already created hence the reference to DTE.Solutions.Projects.Item(1). This will add the 2 projects to the solution and add references to them as well (a project to project reference)

Option Strict Off

Option Explicit Off

Imports System

Imports EnvDTE

Imports EnvDTE80

Imports System.Diagnostics

Public Module AddRef


    Sub TemporaryMacro()

        Dim proj As EnvDTE.Project

        Dim vsproject As VSLangProj.VSProject


        proj = DTE.Solution.Projects.Item(1)

        vsproject = CType(proj.Object, VSLangProj.VSProject)

        Dim t As Project = DTE.Solution.AddFromFile("C:\Presentations\Keynote\EstateApp\EstateApp.csproj")

        Dim t1 As Project = DTE.Solution.AddFromFile("C:\Presentations\Keynote\WoodgroveBankControl\WoodgroveBankControlLibrary.vbproj")

        vsproject.References.AddProject(t)

        vsproject.References.AddProject(t1)

    End Sub

End Module

Jan Atlas CTP available (AJAX for ASP.NET)

Check Nikhil?s blog entry for info on what is new.

Visit  http://atlas.asp.net to download.

If you are looking for a nice walkthrough of Atlas check out Scott Guthries blog entry here. I played with this sample/walkthrough using the December CTP ? it should work with the Jan CTP I think -- and it really is nice. I especially like the server controls where you can take an existing ASP.NET and easily enable AJAX scenarios.

Got Code Snippets

This is old news but I notice the snippet list is gradually growing here.

More on the 1.1 and 2.0 side by side - what happens to Windows hosted controls in IE

Firstly check out this blog entry for a bit more on app compat.

One of nice features you have is the ability to host .NET based Windows Forms Controls in Internet Explorer. Resources for this include http://samples.gotdotnet.com/quickstart/winforms/doc/WinFormsIeSourcing.aspx and http://msdn.microsoft.com/msdnmag/issues/02/01/UserCtrl/default.aspx

The question that arises now is what happens if I am running IE and I first browse to a page that hosts a 1.1 control and then browse to a page that hosts a 2.0 page ? and here we assuming again that you have 1.1 and 2.0 of the framework installed. Well the answer is that by default native apps (like Internet Explorer) will host the latest version of the CLR. So even if you do browse to the 1.1 page first the 2.0 CLR will load.

Notes

You cannot have different instances of the CLR hosted in the same process.

You cannot have a config for the control (i.e a dll) telling what runtime it should use ? this would be nice but it uses the host?s config.

Is there a way of forcing the 1.1 framework to load, yes -- you can create an iexplore.exe.config file (put it in the same dir as iexplore.exe) and put this into the file

<?xml version="1.0"?>

<configuration>

    <startup>

        <supportedRuntime version="v1.1.4322" />

    </startup>

</configuration>

This will load the 1.1 framework for IE. The problem you have here though is that any page hosting a 2.0 control will not work. In general 1.1 controls hosted in IE should work with CLR v2 loaded.

One thing I did try was to make a copy of iexplore.exe (call it iexplore2.exe and it just 92K). This one can have a config file pointing to 1.1 framework. The only issue I found here is when I try and run iexplore2.exe it gives me a warning that it is running in compatibility mode. None the less it did run and in effect I was able to have one instance of IE running v2 of the framework and another running v1.1 of the framework. I have not done enough testing though to determine if this is just a hack J

What would be nice is the ability to pass a config file as an argument to an exe. That way you could just create shortcuts pointing to different config files.

Borland looking for a buyer of its IDE tools

Check blogs.borland.com

What happens when a 2.0 app calls a 1.1 assembly

I got this question via email

BTW ? no comments on the horrible names I am using J.

I have an application that is built in .net 2.0.It references an assembly built in .net 1.1
What happens internally when my application uses the 1.1 assembly? Does it create a new process for the 1.1 CLR? Is it seamless?

What about the other way around?

Short answer

The old 1.1 assembly will run in the 2.0 process. No new process will be created

Other way around ? it will not work. You cannot reference a 2.0 assembly from a 1.1 app

Long answer ? the proof

Assume you have a button in a form in a classlibrary. You have this code. You can change the first line to 2.0 if recompiling in VS05. I am hard coding this value on purpose

                MessageBox.Show("built in 1.1");

        MessageBox.Show(Environment.Version.ToString());

You then have a client EXE calling this component. I am doing this via reflection

                Assembly A = Assembly.LoadFrom(@"c:\ClassLibrary1.dll");

            Type T = A.GetType("ClassLibrary1.Form1");

            Form F = (Form)Activator.CreateInstance(T);

            F.Show();

You can now try out the various configs of testing

Client11 calling Component11 ? works fine

Client2 calling Component2 ? works fine

Client2 calling Component11 ? works fine. The second messagebox will pop up showing that you are running in 2.0 framework even though you compiled in VS03 targeting 1.1 framework. ****

Client 11 calling Component2 ? error. See http://blogs.msdn.com/junfeng/archive/2004/07/14/181938.aspx

****For the third scenario

You need to be careful to check out for breaking changes. For example the code below (assuming it sits in the component) will work fine in example 1 above (i.e Client11 calling Component11). It will not work in scenario 3.

MessageBox.Show(String.Compare("a","b",true,new CultureInfo("ky-KZ")).ToString());

The reason for this is described at http://msdn.microsoft.com/netframework/programming/breakingchanges/runtime/clr.aspx   which is simply that Kyrgyzstan tag is now KG, matching official ISO tag. As the site states v1.1 and v1.0 had the wrong tag for Kyrgyzstan, KZ. Fixed this in v2.0 so the tag for Kyrgyzstan is now KG. KG is the official ISO tag for kyrgyzstan. There is no country whose official ISO tag is KZ.



VSTA (Visual Studio Tools for Applications) CTP available

I just happened to come across this from this page.

VSTA is available for download. It ships as part of the VS SDK.

 

What is VSTA: It is application customization in the .NET World. So think VBA for .NET (at a very high level)

 

You can download the SDK from http://affiliate.vsipmembers.com/affiliate/downloadFiles.aspx. You need to be registered. From that page

 

The February CTP is the next milestone in the drive towards the April 2006 v2 release . This CTP contains updated VS Integration sample and documentation content, including updates to the IronPython end-end integration sample. Brand new features of the SDK include the Domain Specific Languages extensibility kit and the Visual Studio Tools for Applications runtime and extensibility kit.

 

 

Does Rudolph know how to score 1 run

Ok, so we lost the Aussies again. But it was fun to watch van de Wath giving them a smack at the end (and Boucher a little before that). What was irritating was the final over. With van de Wath on a mission and going great I (and I think thousands of Aussies too) just wanted Rudolph to take 1 run and turn the strike over. Instead he played 5 dot balls. He did get 1 four in between but still very disappointing

More Posts Next page »