by Miha Markič
26. September 2005 22:20
One day I've decided to install WinFX (along with VS 2005 beta 2) on my laptop to see how it works on hardware accelerated graphics (I take a look at WinFX before - in VMWare Workstation though). So I installed everything as requested. The first step to test it was to run XAML Pad, a utility to build UI using XAML. No go. I took a look at Fusion Log Viewer (fuslogvw) I saw that XamlPad application tried (unsuccessfully) to load totaly unrelated 3rd party assemblies built for .net 1.x (plus some of .net 1.0 system assemblies). Go figure. I haven't put much effort into solving this (who has time to play these days). I've rather posted a reply to a guy having same problem in MS newsgroup microsoft.public.windows.developer.winfx.avalon ("XamlPad.exe NullReferencException with WinFX CTP Sept." thread).
After a while, Daniel Danilin found (in another post in same thread) an (obvious) solution: remove offending 3rd party (not .net 1.x system ones) assemblies from GAC. While this solution isn't perfect (what about applications that use those assemblies?) it just works - and I have something to play with while traveling to my second MVP summit.
8a4ca33e-4e0d-459f-b8f6-0069326028e2|0|.0
Tags:
.net
by Miha Markič
19. September 2005 14:38
In case you didn't know, MS has put up three forums (part of their Technical Forums) to discuss Linq, DLinq and XLink.
You'll find them here.
b8a68543-6a25-40d4-b5cb-5d1dd434df27|0|.0
Tags:
.net
by Miha Markič
18. September 2005 20:57
I've posted my first CodeSmith template for generating DLinq classes (DLink is part of Linq project, a future of .net). The generated code is C#. You can make suggestions or just give feedback in this forum.
Get the template here.
Enjoy.
418ffbfc-5dbf-4865-8bab-c3f940dbc90a|0|.0
Tags:
.net
by Miha Markič
16. September 2005 21:56
I've set new expiration date for RightHand.DataSet.Visualizer to 11/7/2005 and recomplied with July CTP. New version is 0.9.1. Get it
here.
Comments are welcome in the
forum.
e2a633f2-9b5d-4c84-a8dd-b94d0b29ef7b|0|.0
Tags:
.net
by Miha Markič
16. September 2005 20:56
There was a question on MS' forum about how to log the DLinq's sql commands. Well, actually DataContext's sql commands. Here is the solution, it is easy:
StringBuilder sb = new StringBuilder(); // create a StringBuilder instance to store output
TextWriter tw = new StringWriter(sb); // create a StringWriter that will write into StringBuilder above
db.Log = tw; // attach it to DataContext
Console.WriteLine(sb.ToString()); // output the result
The trick is to use DataContext.Log property (db represents DataContext instance in this example) to attach a valid TextWritter derived instance. And voila - no more black box. Of course, output will be empty unless there is a sql command issued either by doing query or persistence.
fb302d38-93ff-45a2-a284-bef9ede5422b|0|.0
Tags:
.net
by Miha Markič
16. September 2005 11:15
I am doing some tests with DLinq. I have created my classes properly decorated with attributes. I have also implemented IChangeNotifier to make tracking faster (all this was created by my CodeSmith template which I will post later). However I couldn't persist a simple change which left me scratching my head for a while. Here is my pseudo code:
Load an entity
Change its property
Call DataContext.SubmitChanges
Simple, huh. Yet nothing was saved. I've checked with SqlProfiler to see if anything is going on - and no, there was no update command issued which indicated that DataContext was unaware of any change. At one point in time I've commented out IChangeNotifier implementation and the thing started working normally, as one would except. After another while I've found the problem - I was calling OnChanging() too late:
set
{
if (value != id)
{
id = value;
OnChanging();
}
}
Moving OnChanging one row up fixed the problem:
set
{
if (value != id)
{
OnChanging();
id = value;
}
}
This seems logical as OnChanging implies that is should occur before change is persisted. Another mystery solved.
5334b453-a528-4288-9bc6-4faeb57f2e05|0|.0
Tags:
.net
by Miha Markič
14. September 2005 09:42
While C# 2.0 isn't even released yet, there is already a lot of documentation about C# 3.0. And it brings a lot of candies based on features introduced in C# 2.0 (generics, anonymous methods, ...).
Go check it out. And go wonder, there is a also a
working compiler (requires Visual Studio 2005 beta 2). I guess the fact that C# 3.0 works on .net 2.0 implies that it will come out much faster as there is no need to change the .net framework. I certainly hope so.
aed6b770-b4b1-4432-834d-36155d39b7aa|0|.0
Tags:
.net
by Miha Markič
13. September 2005 16:32
Whoa, Visual Studio 2005 Team Suite Release Candidate is available for download at MSDN subscriber downloads. There is also a bunch of Sql Server 2005 September downloads. Apparently this is one and only RC before RTM.
Microsoft servers are under heavy load of course. I've barely managed to get to the link.
I wonder why :-)
4687c9aa-3651-4006-91e5-73880e2fead2|0|.0
Tags:
.net
by Miha Markič
10. September 2005 21:35
RemObjects' Alef pointed me to this wonderful piece of code. Warning: whatever you do, don't write such code. Ever.
While you are in the mood, go check the story of Champions.
0ee6e82b-6813-43f2-b84a-cd68aaf42ad1|0|.0
Tags:
by Miha Markič
8. September 2005 15:01
A lot of people have noticed a highly annoying bug in Visual Studio 2005 when dealing with Developer Express' controls. The description of the bug goes like this:
During the build of the solution IDE starts throwing a modal dialog box with error icon: "cannot access a disposed object. Object name: 'DesignerFrame'". If you click OK the same dialog reappears and you'll never get rid of it (regardless if you click OK or not) and you won't be able to close IDE either (you have to resort to Task Manager for killing it). Regardless of the issue the solution starts running if it was built properly.
AFAIK this is the problem in Visual Studio 2005 Beta 2 and there are two workarounds to this problem:
- upgrade to a CTP later then beta 2 (preferably july CTP since there is no public august CTP version of DevExpress controls) where error doesn't appear anymore
- close all designer windows within IDE before doing build