This is how close will become C# and VB in next release:
|C# 4.0 ||Visual Basic "10"|
|Named/Optional Parameters ||Named/Optional Parameters |
|Dynamic Scoping ||Dynamic Scoping |
|Statement Lambdas ||Statement Lambdas |
|Multiline Lambdas ||Multiline Lambdas |
|Auto-Implemented Properties ||Auto-Implemented Properties |
|Collection Initializers ||Collection Initializers |
|Generic Variance ||Generic Variance |
|Extension Properties ||Extension Properties |
The items in white-bold are new features…
(Source: PPTX from VS2010 and .NET Framework 4.0 Training Kit)
This is what we currently have in .NET 3.5 SP1
And this is what will be included in .NET 4.0
(Source: PPTX from VS2010 and .NET Framework 4.0 Training Kit)
MSBuild is very powerful language for automating build process but as every computer thing it could be confusing.
So for a start this should work as Visual Studio solution files (*.sln/*.proj) files are valid MSBuild files:
So for more script-like example this can show how complex solution with Web Application project can be build and files (result of publish operation) copied to drop location.
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns=http://schemas.microsoft.com/developer/msbuild/2003
<Exec Command="MSBuild.exe WcfFileTransfer.sln /t:Clean" />
<Exec Command="MSBuild.exe WcfFileTransfer.sln /t:Rebuild /p:Configuration=Release
/p:OutDir=..\$(OutputFiles)" ContinueOnError="False" />
<!--include needed files-->
<Message Text="Copying to Deployment Dir:@(WebFiles) to $(ReleseFolder) :" />
<!--perform recursive copy-->
This script is executed from Visual Studio Command Prompt like this
For more information about MSBuild you can take a look at MSDN reference page or Channel9 Wiki:
Or the MSBuild: By Example tutorial:
- Introducing Well-Known Metadata
- Formatting Your Output
- Editing MSBuild Files with IntelliSense
- Integrating MSBuild into Visual Studio
- Introducing Custom Metadata
- Understanding the Difference Between @ and %
- Using Environment Variables in Your Project
- Reusing MSBuild Project Elements
- Dealing with MSBuild Errors
I hope this is good as a start.
After being quite busy for last 4 months it is a time to ramp up with new cool technologies that are on the product line.
So while installing VS 2010 it is a good reading to find out what to do once it is done:
And of course get some free time – a night or two should be enough :) should be enough for starting…
Today the hardware is cheap (and getting cheaper) so it is easily affordable to have multiple quad code CPUs, 8 GB RAM and more. In order to fully utilize this hardware x64b OS is needed and Windows has x64b editions for a while.
But what happens with the software we write?! if you use managed code only then is easy – IJW – It Just Works (do you remember that term for compiling unmanaged code C++ into IL? well that’s different)
As MSDN article “Migrating 32-bit Managed Code to 64-bit” says
Consider a .NET application that is 100% type safe code. In this scenario it is possible to take your .NET executable that you run on your 32-bit machine and move it to the 64-bit system and have it run successfully. Why does this work? Since the assembly is 100% type safe we know that there are no dependencies on native code or COM objects and that there is no 'unsafe' code which means that the application runs entirely under the control of the CLR. The CLR guarantees that while the binary code that is generated as the result of Just-in-time (JIT) compilation will be different between 32-bit and 64-bit, the code that executes will both be semantically the same. (You cannot install the .NET Framework version 2.0 on Windows 2000. Output files produced using .NET Framework versions 1.0 and 1.1 will run under WOW64 on a 64-bit operating system.)
If you want to dig into x64 vs x86 differences read Scott Hanselman’s article “Back to Basics: 32-bit and 64-bit confusion around x86 and x64 and the .NET Framework and CLR”
Also check Brian Peek’s blog post on the subject
“To deal with the many technology additions since then, J. D. Meier and his team from Microsoft patterns & practices have created a new application architecture guide to provide insightful guidance for designing .NET applications based on the latest practices and technologies. The outcome is Application Architecture Guide 2.0, a guide targeted to help solution architects and developers design effective applications on the .NET platform. The guide gives an overview of the Microsoft .NET platform and the main technologies and capabilities within it. It provides not only principles-based guidance, but also platform-independent, pattern-oriented guidance for designing your application. Even though the guide itself is comprehensive on its own, the team has also provided a Knowledge Base on the Web, which provides informative expansion on the topics and concepts outlined in the guide.”
Forewords by Scott Guthrie
Corporate Vice President of .NET Developer Platform
Go grab it or read online @ http://www.codeplex.com/AppArchGuide/
I had interesting issue today: I was on urge to complete a task when I saw a strange exception – you know – the Murphy's law. It hit at the most inconvenient time. To be even more interesting I’ve deployed my work on two different servers and worked fine.
But on the most important one I got this exception when I tried to hit WCF service:
System.MissingMethodException: Method not found: 'Void System.ServiceModel.Diagnostics.EventLogger.UnsafeLogEvent(System.Diagnostics.TraceEventType, System.ServiceModel.Diagnostics.EventLogCategory, System.ServiceModel.Diagnostics.EventLogEventId, Boolean, System.String)'.
at System.Runtime.CompilerServices.RuntimeHelpers.PrepareDelegate(Delegate d)
at System.AppDomain.add_UnhandledException(UnhandledExceptionEventHandler value)
at System.ServiceModel.PartialTrustHelpers.PartialTrustInvoke(ContextCallback callback, Object state)
at System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Very strange… and search engines doesn’t know much about the problem…
Luckily this was not used heavily and I could reinstall .NET Framework 3.5. And this solved the problem.. Now back to more productive things…
You come up with a great HTML layout for data-driven ASP.NET web page which makes perfect sense from business perspective and reveals key indicators while making possible to drilldown into details if needed. This page utilizes DHTML and AJAX calls to improve User eXperience (UX) and overall page looks great until… your database is not filled up and page load time is increasing due to generated HTML size, DHTML is slow due to big DOM tree and users starting to complain about it.
At that point there are several approaches that can be employed to help:
- Rework page layout so only part of data is loaded;
- Download data to the client in XML or JSON format and generate necessary HTML code on client
- Load only those portions that need to be immediately displayed and load others on demand (e.g. like paging)
Let’s explore these options:
Here is no technical challenge here – just business one: you have to sell new layout to existing users/customers and once they liked the initial one this can be really difficult. If you can do that – go ahead. There is nothing wrong with that approach.
Instead of downloading 10 MB HTML code to client’s browser you can generate pure JSON and having a template of HTML just to fill data in the HTML template with simple (or not-so-simple) loop. Good news here is that such feature is coming to ASP.NET AJAX in v4.0. It is called client templates and implements the idea. Here are some resources:
Partially Loading Page
This is also not new concept – load only those parts that should be visible immediately to the user. Traditional paging explores that option although it is not that fancy. If you’re using Google Reader you probably noticed that it loads only visible part of the feed and as you scroll down it keeps loading from the RSS feed.
So here is the idea: having small piece of HTML loaded would ease the browser in rendering HTML DOM tree and you gain performance. As user keeps using the page you keep adding HTML to existing DOM tree by loading it dynamically using AJAX.
Tricky part could be rendering ASP.NET User Control within Web Service so pure HTML can be returned by AJAX. Here are some useful tips:
Utilizing these techniques could improve download time for your web apps and also speed them up because the browser doesn’t need to process whole DOM before give the control to the user. All these can be used together or in any combination as long as it makes sense from business perspective.
Hope this helps!
I had interesting experience today. I tried to create a web setup project for one of my recent projects. As you know it is pretty straightforward: From Visual Studio 2008 File –> Add –> New Project –> Select Setup wizard.
and just add output from existing project.
Then press Ctrl+Shift+B (Build ) and you’re ready… But not in Windows Server 2008. When I decided to test this newly made installation package I hit the ground with single dialog showing this message:
"The installer was interrupted before ApplicationName could be installed. You need to restart the installer to try again.
Click "Close" to exit."
Being experienced installer package developer I knew what I had to do: run the installer with verbose logging.
by executing this line:
1: msiexec /i Installer.msi /lv detail.log
And I had nice 57 KB file to read in wonderful notepad. And the problem action quickly appeared:
1: Action start 16:22:53: WEBCA_SetTARGETSITE.
2: MSI (c) (B4:4C) [16:22:53:082]: Note: 1: 2235 2: 3: ExtendedType 4: SELECT `Action`,`Type`,`Source`,`Target`, NULL, `ExtendedType` FROM `CustomAction` WHERE `Action` = 'WEBCA_SetTARGETSITE'
3: MSI (c) (B4:48) [16:22:53:082]: Invoking remote custom action. DLL: C:\Users\ADMINI~1\AppData\Local\Temp\MSIFB61.tmp, Entrypoint: SetTARGETSITE
4: INFO : [11/11/2008 16:22:53:097] [SetTARGETSITE ]: Custom Action is starting...
5: INFO : [11/11/2008 16:22:53:097] [SetTARGETSITE ]: CoInitializeEx - COM initialization Apartment Threaded...
6: ERROR : [11/11/2008 16:22:53:097] [SetTARGETSITE ]: FAILED: -2147221164
7: ERROR : [11/11/2008 16:22:53:097] [SetTARGETSITE ]: Custom Action failed with code: '340'
8: INFO : [11/11/2008 16:22:53:097] [SetTARGETSITE ]: Custom Action completed with return code: '340'
9: Action ended 16:22:53: WEBCA_SetTARGETSITE. Return value 3.
10: MSI (c) (B4:4C) [16:22:53:097]: Doing action: FatalErrorForm
11: Action start 16:22:53: FatalErrorForm.
Seeing WEBCA_SetTARGETSITE means that the installer was trying to set the destination. Having a web setup this means IIS was asked for “Default Web Site” and this call must be the one that fails. But why!? I have Web Server Role installed on the machine:
I and remembered from my MS DevDays 2008 IIS talk – you still can use old (pre v7) IIS management tools with IIS7 as long as you have “IIS 6 Metabase Compatibility” role service installed.
I installed this role and … Voila!!! it works!!!
Our favorite and very wide spread development framework has new logo. It’s cool and it is already used on Microsoft PDC 2008 slide decks
(via Scott Hanselman’s blog)