Tag: Visual Studio

Build Windows – Day 2

Day 2 got off to a great start with a great Keynote.  Jason Zander and Scott Guthrie showed some of the great new features coming in Visual Studio 11 / .Net 4.5.  We also got our first peek at some of the work being done in Windows Server 8.  (If you don’t know PowerShell I would highly recommend learning!)  Hopefully later today the video will become available on Channel 9 and I’ll update this post with a link.

Sessions

This is just a brief overview of the sessions I attended and the topics covered.  I’ll cover most of the details in depth in future posts so check back over the next couple of weeks.

What’s new in Visual Studio 11 – Jason Zander (TOOL-820F)

I started out the break out sessions with “What’s new in Visual Studio 11”.  Lots of cool new features!  First off, all the power pack tools are built in out of the box.  There are a lot of enhancements to the UI, with a focus on streamlining tasks and reducing clutter.  For example the find dialog has been replaced with an floating drop down in the editor.

The XAML editor from Expression Blend now replaces the old XAML editor.

The XML/XAML/HTML editor now has tag matching.  If you change a beginning

tag to a tag the matching

tag automatically updates to a </span> etc.

The CSS Editor now has a color picker that displays in-line as you are typing your CSS.  The picker is also smart enough to display the colors you have already used in your style sheet as the first options.

Using Windows Server 8 for Building private and public IaaS clouds – Jeff Woolsey, Sandeep Singhal, Yingal Edery (SAC-429T)

Lots of cool new stuff coming in Windows Server 8,  Especially in Hyper-V.   During the session the demonstrated the new live migration by moving a virtual machine running on one host (using local storage, not shared storage, the vhd was on the host machine’s physical disks) to another host while it was running.  The whole process took just a couple minutes and the virtual machine continued running the whole time!

 ASP.Net 4.5 loves HTML , CSS3 & JavaScript – Matt Osborn (TOOL-76T)

Matt gave a great presentation on HTML 5 in ASP.net 4.5 and Visual Studio 11.  He showed off a number of enhancements in the IDE like:

  • Auto Tag matching
  • CSS Color Picker
  • Automatic DocType detection
  • Intellisense for Character Set Meta Tags
  • CSS Folding and Formatting

We looked at the new Minification feature that is available to automatically compress and combine your CSS style sheets and JavaScript files.  (I believe This is now available as a NuGet package for Asp.Net 4.0 as well).

He also talked a bit about what we can do to use HTML 5 in ASP.net 4.0 today using Modernizr and graceful degradation.

Create rich, data-driven Web apps with ASP.Net 4.5 Web Forms – Damian Edwards (TOOL-906T)

In this session we went through building an application using ASP.Net 4.5 Web Forms and Entity Framework 4.1 (aka. Magic Unicorn Edition 🙂 ) .    Web Forms now has ModelBinder support just like MVC, Strong Typing in bound controls, Data Annotations can now be tied to a validation summary to provided validation feedback, and much more.

Today’s Schedule

I am looking forward to attending these sessions today:

  • Future Directions for C# and Visual Basic – Anders Hejlsberg
  • Creating immersive data experiences with Entity Framework – David Annsley-DeWinter/Jeff Derstadt
  • Building IIS and ASP.Net apps with the power of async –  Damian Edwards / Phil Haack
  • Building high performance Metro style apps using HTML 5 – Mathias Jourdain

Build Windows – Day 1

Day one of the conference was exciting.  We got out first official look at the Windows 8 Developer Preview with the new Metro Interface, Visual Studio 11 Express, and some demos of building applications with Metro.   Oh, and of course, all the attendees received their Samsung Windows 8 Developer’s PC.  I’ll blog about the PC a bit later, I just got mine up and running due to the lack of internet connectivity around the hotel last night.  Funny thing, if you give 5000 developers a new PC that they have to activate on line the network gets bogged down…

Anyway, a few take aways from yesterday’s Key Note and demos.

  • There is a new Windows API called WinRT (Windows Run Time) which is baked directly into the OS (ie. it’s not a framework layered on top) which is the new way to program on the Windows Platform.
  • Windows 8 has a much smaller memory footprint than Windows 7 (nearly half) and is extremely optimized for performance.
  • Visual Studio 11 supports creating Metro apps from C++, C# & VB.Net, and HTML 5 / Javascript.  (ie. .Net is NOT dead for all those fear mongering before the conference.)
  • Getting started creating simple Metro apps is easy using the built in Visual Studio Templates.
  • WinRT does not support GDI.
  • The Windows 8 interface is extremely immersive and personal.

 

More to come later.  I have to head out for the Day 2 Keynote.

Looking forward to some great break out sessions today.

Converting to Framework 4.0

We all would prefer to work with the latest technology. Unfortunately we often have applications that we built just yesterday using the last version of a framework, which is now so ancient history.  Luckily when it comes to .Net Applications Microsoft has done a great job of putting together conversion wizards to bring that old app up to the latest framework.

In this article I’ll walk through the relatively painless conversion process and then highlight a couple of things I have found to be pain points in the last couple of weeks as I have migrated applications to .Net 4.0 / Visual Studio 2010 from .Net 3.5 / Visual Studio 2008.

Converting an Application

To start you’ll need to have the latest version of Visual Studio 2010.  For the purpose of this article I’ll use Visual Web Developer 2010 Express to convert an application previous built in Visual Studio 2008.

vsopen

I usually make a copy of the project ahead of time in a separate folder before beginning,  That way if something goes wrong then nothing is lost.  (Although I have never had a conversion fail in an unexpected way.)

Go to File|Open Project … and browse to your solution file (*.sln) and open it.  The disk will churn a bit and you’ll be presented with the conversion wizard.

ConversionWizard

Click next and Visual Studio will ask you if you want to back things up first.  Since I am already working on a copy I choose no here.  I just don’t really like were Visual Studio puts the back up by default, which ends up being along side your project.

BackUp

Clicking next will bring you to the confirmation screen.

Finish

Now the disk will churn for a bit again and then you will get a dialog asking if you want to upgrade to framework 4.0 as well.

Convert

If you click no here your project will be converted to the 2010 Project format, but it will be left targeting the 3.5 framework (You can switch that later if you wish in the project properties).  If you click yes, the project file will be updated and the framework will be set to 4.0.  Pretty straight forward…

results

Once you choose an option things will churn a bit again and eventually you’ll be presented with a Conversion Report.

I did get a failure here, but it was expected.  The particular solution I converted had a number of projects in it including a couple of libraries, a web application, and a WinForms application.   Since I am opening this with Visual Web Developer the WinForms application did not load.  No problem, that was expected.

A Couple of Things to Note

After doing a few conversions I have run into a couple things you should know.

  1. In Framework 3.5 the Menu control renders by default as tables.  In 4.0 it renders by default as an unordered list.  The control has a property (RenderMode) that can be set to Default, Tables, or List.  So it’s your choice, you can set the value to Tables and move happily along, or convert things to work correctly as a List. If you choose to set it to List, I would, recommend setting the property to List explicitly.  I’ve seen things behave differently in different environments (IIS Versions) when set to default.
  2. There is a “Known Issue” in 4.0 where if you call __doPostback(‘foo’, ‘bar’) inside an AJAX Update Panel and the referenced control is not outside the Update Panel then nothing seems to happen at all.  The work around is to put a control with the specified name outside the Panel, however I have not tried this yet, In this particular case I opted to back off the 4.0 conversion for now because that change would have to be made in a number of complicated places in a critical application and it will require a large amount of testing to confirm the fix.  I converted this application to Visual Studio 2010, but left it at Framework 3.5.
  3. In the case when you have an ASP.Net web form that is allowing for example, HTML input, you may see an error something like: “A potentially dangerous Request.Form value was detected from the client…”.  We used to set RequestValidation=”false” on each page to get around this, but this does not in and of itself work in 4.0.  In 4.0 you will need to add an attribute(requestValidationMode=”2.0″) to the httpRuntime element in your web.config file to allow you to override the RequestValidation on the page level.  It looks something like this.

<httpRuntime requestValidationMode=”2.0″ />

You do still have to also set RequestValidation=”false” on the page as well.

More Information

There is a decent whitepaper on breaking changes in 4.0 on the ASP.Net web site at http://www.asp.net/learn/whitepapers/aspnet4/breaking-changes