|
|
These blog entries are written by industry experts and leaders. We consider this content to be a good read for any software developer or web technologist.
Browse by Tags
All Tags » .NET » C# (RSS)
-
Do .net 2.0 service pack 1 compiled binaries fail when ran on machines without that service pack? Developers automatically get force-fed .net 2.0 sp1 when we install VS 2008, which doesn't sound like it should be a big concern typically. But what about the next time you compile an existing VS 2005 app and deploy on machines without sp1, which would of course be the case for most non-dev machines right now? I believe I have found a case where this is indeed happening, at least that's the only explanation I can find so far, and it looks like there are a few others reporting things too -- but the details so far are sketchy at best.
I've got an existing .net 2.0 app (written in C#) that calls a 3rd party web service that has always ran just fine. I needed to make a couple of small updates to my app which did not change anything related to the calling of this web service at all. Everything works flawlessly on my development pc, which has service pack 1 for .net 2.0, but fails when deployed on my qa server, which does not have service pack 1. Here are the exception details:
Error type = System.InvalidOperationException Error Message: There is an error in XML document (5, 2). Stacktrace: at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle) at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at ...
I am able to confirm that the 3rd party does receive my call to this web service, and it is sending the expected response, which I have also confirmed with TcpTrace. So the problem seems to be that the xml deserialization that is needed to parse the web service response is no longer working the same, and code compiled with sp1 cannot be executed without it.
Can anyone confirm this? Are there any work-arounds, short of compiling without sp1 or deploying sp1? By the way, I am in the process of setting up a virtual machine that will just have VS 2005 without sp1 to confirm this if no one else can, and assuming I can confirm this then I'll have to determine if I want to start requiring sp1.
Here's a couple related links, which may or may not be the same problem I'm experiencing:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2668654 http://weblogs.asp.net/grobinson/archive/2008/02/13/net-2-0-sp1-shipped.aspx http://channel9.msdn.com/ShowPost.aspx?PostID=363583 http://blog.jalil.org/2008/01/27/dep-nxcompat-and-changes-in-net-framework-20-sp1

|
-
Here's a nice library function useful when loading enum-typed properties from your database: public static T ToEnum<T>(int typeValue) { return (T)Enum.ToObject(typeof(T), typeValue); } 
|
-
The Atlanta Code Camp was today, so I finally got to give my LINQ and O/R Mapping talk that I've been preparing. I tried to have minimal slides so that I could do a deep dive into real code, but I still went a little too long. The slides look great on my own PC, and in fact they're mostly some I stole straight from other LINQ presentions. But the overhead I was using made the text nearly unreadable for some reason, which made me take longer on the slides. It also made some of the standard VS color syntax unreadable, with the work-around being to select that code. I small the same problem with another speaker in the same room, so I guess it was the projector, but very frustrating. In the end I still got to hopefully show a fair amount of LINQ to SQL, but I had really hoped to show more. I also made sure I gave a glimpse at SqlMetal and LINQ to Entities, but both of those were meant to be just glimpses. Finally, I briefly demoed my new "real" example application written with LINQ to SQL which is included in my download. This example shows off my own POCO objects with an external XML Mapping file, instead of the ugly code gen with attributes. Its also a "real" app that consumes the LINQ to SQL with WinForms grids, drop-down filtering, and create, update, and delete. Note that it assumes the May 2006 CTP, but I'll update it to the next one when it comes out, hopefully next month. Its also nearly identical to my existing "real" example app downloads that I have for my own ORMapper and NHibernate. 
|
-
Breaking News: Microsoft is working on having a version of the framework that will run on the Mac! That's right -- Rory broke this story just the other day in his interview with Scott Guthrie.
First, a little bit of background, which although not secret has largely went unnoticed so far. Hopefully you've heard of WPF/E, which is a subset of WPF that runs in the brower, even Firefox and Safari. So far the first CTP is largely focused on the cool graphics capabilities and supporting media. But even in this first CTP the XAML can be programmed against on the client-side using JavaScript, even with Ajax. But its also already been discretely said that in the future WPF/E will also contain a small cross platform subset of the CLR. That will mean that we will also be able to use C# or VB on the client-side to program against WPF/E! And that will be true even in Firefox and Safari on the Mac -- and this is old news that simply hasn't been widely talked about. Mike Harsh as early as March 23, 2006 said:
So what is WPF/E? It is a cross-platform, cross-browser web technology that supports a subset of WPF XAML. WPF/E also has a friction-free install model and the download size we’re targeting is very small. WPF/E supports programmability through javascript for tight browser integration. The WPF/E package also contains a small, cross platform subset of the CLR and .NET Framework that can run C# or VB.NET code. Yes, we are bringing C# programming to the Mac.
And Joe Stegman said this just last month: To be clear, "WPF/E" is independent of the .NET Framework. In a future version, we'll support a small cross platform CLR based execution engine that will run on both Windows and Apple OS X (everything we do from a runtime perspective works on both Windows and Apple OS X). In general, our tools are dependent on Windows but with the current version of "WPF/E", you can develop using a text editor and deploy on any web server. When we support the small CLR, compiling/debugging will require Windows (and so will our designer tools) but running/deployment will still work cross platform.
And then Scott said this in the interview at the 9 minute mark: Scott: And overtime we'll also support a managed programming language, uh framework, against WPF/E as well. So in addition to using JavaScript, you'll be able to use C#, uh Rory: You mean, even for the other? Scott: Yeah even for the Safari and Mac.
But what Scott said in this interview with Rory went beyond the small CLR for WPF/E in the browser. Instead Scott said that they were also looking at a version of this that would run outside of the browser, even on the Mac! Listen to this interview and its pretty clear that Scott was probably not intending to announce this until Mix. Rory was also quite suprised and wondered if he needed to remove this from the video. But Scott said he could keep it and acknowledged that this was probably the first time this was publicly talked about. Rory was of course very excited to be the one to get this scoop out of Scott. :) So here's what Scott said in the interview at the 23:45 mark: Rory: Is there any possibility of eventually having a framework that runs outside the browser? Scott: Yea, yea, that's definitely something we're looking at is, uh, kind of what we call the in-browser experience and kind of the out-of-browser experience. And so that's something we'll talk more about at mix, uh Rory: And that stuff's secret now? Cause I don't mean to bring up something that's secret. Scott: No, no, well that's something, uh, that we haven't talked about publicly yet. But that's certainly a scenario we're thinking about. Rory: Do I have to get that out of the video? Scott: No, you can keep that. Rory: I can keep that? Is this like the first time anyone's heard it? Scott: Probably, yeah.
Just having the ability to use our favorite .NET language and a subset of the CLR inside the browser to target an incredibly rich graphics platform like WPF/E is huge to me, but if we're not even restricted to the browser -- wow! For instance, Keith Elder already has a post on his blog where he considers some of the possibilities, and that's just one person thinking out loud. Of course right now the first CTP is still very much cool graphics and media, but this is a very strategic start. Why? Because this is focusing on what isn't easily possible any other way, and its getting the big media players involved. And if the big media players use it then you can bet that everyone will be downloading the plugin just like they do now for Flash. Most users aren't going to care about the .NET part, but once its ubiquitous, then we will also be able to take advantage of it.
So there you go -- its just a matter of time before there will be a small CLR version of the .NET framework everywhere, with your favorite .NET language of course!

|
-
Registration for Atlanta Code Camp 2007 on January 20th is now open. Space is limited and fills up fast, so do NOT delay registering -- it's free. Thanks to Jim Wooley for putting this together this year.
I'll be presenting a session titled "Linq and O/R Mapping" that will be lots of real code and very little powerpoint. If you've seen the standard Linq sessions already, or even if not, but you've been wanting more then this is for you. I'm not going to waste any time on Linq to Objects or Xml, although those are cool in their right -- I will focus purely on Linq to Sql, and to a lesser extend Linq to Entities or Datasets. Do you want to see a real application built using Linq to Sql? That's what I plan to do, and I'll do it several ways so you can experience the possibilities. For instance, should we use SqlMetal, the GUI Designer, or do our own thing with xml mappings instead of attributes? What if you want to include some relationships, use some stored procs, and even some inheritance? We shall cover all of those possibilities and more -- you will NOT be disappointed since this will not be just another slide deck or sample series based on what's already available. In fact, I would actually challenge you to find any other "real" sample that includes all of these with xml mappings, but you won't find it since it doesn't exist. I hope you get that I'm excited about this, as these technologies have definitely matured past my initial criticisms. And even if you can't make it for some reason, I'll post at least some version of my sample app after the event is over for all to see.

|
-
Which topic would you like to see me present at the Atlanta Cutting Edge .NET User Group (formerly the C# User Group)? I've given a presentation on Custom Providers in ASP.NET at Code Camp that some have asked me to do again, but it would be a repeat, or I can dig into a little known but powerful specific provider and do a presentation on Logging and Diagnositics in ASP.NET. Those are probably the only two options for now, so please give me your preference on these two, but feel free to suggest other topics if you have a good idea and I'll consider it in the future, although probably not right now.

|
-
I think it makes great sense to rename WinFX to .NET v3.0, but I haven't seen any mention as to whether or not this implies any type of sync with C# 3.0 and LINQ, let alone DLINQ and ADO.NET v3.0 Entity stuff -- anyone have anything they can share? It seems like it would be really weird to have .NET v3.0 come out a lot sooner than C# 3.0 and ADO.NET v3.0, and I don't think those are going to be released earlier, so does this mean that part of this renaming entails a delay in WinFX, or should we expect the other things to later be renamed to 3.x or even 4.0? Sorry if it seems I'm ignoring VB, but since its not labelled 3.0 to begin with its not really a problem with this other renaming if it ships later or not.

|
|
|
|