tag:blogger.com,1999:blog-5655811.post4029746728938860631..comments2024-03-14T02:32:59.473-07:00Comments on Greg's Cool [Insert Clever Name] of the Day: No more of that sinking feeling when using async for .Net 4/Silverlight 5 Projects - The Async Targeting Pack for Visual Studio 11 now available (Nuget: "Microsoft.CompilerServices.AsyncTargetingPack")Greghttp://www.blogger.com/profile/00904998050540497754noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-5655811.post-56343009488904308242012-04-29T10:00:08.593-07:002012-04-29T10:00:08.593-07:00Hi Greg
I have one concern with the new targeting...Hi Greg<br /><br />I have one concern with the new targeting pack and developing in VS 11 while targeting .NET 4.<br /><br />In our office we created an small spike WCF solution (Server/Client) that uses a ServiceContract let's say ISomeService that has one operation contract that returns a Task. For creating this we used VS 11 with the new targeting pack and of course we were targeting .NET 4 for both projects Server and Client.<br /><br />Now the problem is that even though we know WCF 4 cannot serialize Tasks our solution compiled and ran perfectly in our development PC but when testing it in an XP PC with just .NET 4 installed for obvious reasons (.NET 4.5 doesn't support XP) our bits failed with the exception that Tasks cannot be serialized etc etc. perfectly understandable since .NET 4 cannot serialize Tasks.<br /><br />Now we can avoid this and not use Task returning services in WCF since we are targeting .NET 4 because we now about this problem and NOT because when we were developing and testing VS 11 even targeting .NET 4 failed, which is the behavior I will expect from VS 11 to fail when I try to run a project that targets .NET 4 the way is not supposed to be used.<br /><br />So my real concern is what kind of other problems we can be incurring in using async/await features while developing in VS 11 + Async Targeting pack even though you target .NET 4 rather than using VS 2010 + Async CTP. I mean we will be incurring into those problems since we will be developing in VS 11 thinking that we are safe because we targeted .NET 4 framework when in reality when we test our apps in an environment with just .NET 4 they can fail.<br /><br />Even worse my wild guess is that all these problems are related to the fact that .NET 4.5 is an in-place update to .NET 4 so what ever .NET 4.5 fixed, improved, added or replaced from .NET 4 will be the real stuff we will be using in our development environments with VS 11 and .NET 4.5 no matters we explicitly target .NET 4 leading to a possible failure when our apps run in a just .NET 4 environment.<br /><br />So my point here is what is the advantage to use VS 11 + Async targeting pack for targeting .NET 4 over VS 2010 + Async CTP if at the end chosing the first can shoot ourselves in the foot.<br /><br />I would really appreciate if someone knows a way to overcome this problem (I mean being able to properly use VS 11 + Async targeting pack while targeting .NET 4 knowing that our apps will safely run in for example XP), probably we did something wrong with our spike WCF solution. Any feedback will be greatly appreciated.<br /><br />by the way does anyone know if at the end .NET 4.5 will support XP this will make our lives easier ;-) or if at least the final .NET 4.5 will be a side by side installation rather than in-place update (I guess this could solve my problem as well eventhough I much prefer .NET 4.5 supporting XP so we can all make use of the new features at full capacity)<br /><br />Regards,<br /><br />ArielAGlezhttps://www.blogger.com/profile/11558731388261455775noreply@blogger.com