Beth's Chinese blog
Last week I demonstrated a more advanced sample at TechEd and showed different levels of customization that you can do to your LightSwitch applications as a professional developer by putting your own code into the client and server tiers. You can watch the session where I went through it here: Extending Microsoft Visual Studio LightSwitch Applications (also check out additional resources from my trip report I posted yesterday).
Download the Contoso Construction Sample
This sample demonstrates some of the more advanced code, screen, and data customizations you can do with Visual Studio LightSwitch Beta 2 as a professional developer (you get paid to write code). If you are not a professional developer or do not have any experience with LightSwitch, please see the Getting Started section of the LightSwitch Developer Center for step-by-step walkthroughs and How-to videos. Also please make sure you read the setup instructions below.
Features of this sample include:
You will need Visual Studio LightSwitch Beta 2 installed to run this sample. Before building the sample you will need to set up a few things so that all the pieces work. Once you complete the following steps, press F5 to run the application in debug mode.
You will need the following extensions installed to load this application: http://code.msdn.microsoft.com/Filter-Control-for-Visual-90fb8e93 http://code.msdn.microsoft.com/Excel-Importer-for-Visual-61dd4a90 And the Bing Map control from the Training Kit: http://go.microsoft.com/?linkid=9741442
These are .VSIX packages and are also located in the root folder of this sample. Close Visual Studio and then double-click them to install.
In order to use the Bing Maps Control and the Bing Maps Web Services, you need a Bing Maps Key. Getting the key is a free and straightforward process you can complete by following these steps:
When you create, update or cancel an appointment in the system between a customer and an employee emails can be sent. In order for the emailing of appointments to work you must add the correct settings for your SMTP server in the ServerGenerated project's Web.config:
<add key="SMTPServer" value="smtp.mydomain.com" /> <add key="SMTPPort" value="25" /> <add key="SMTPUserId" value="admin" /> <add key="SMTPPassword" value="password" />
The system is set to Forms Authentication but if you change it to Windows Authenticaion then in order for the "My Appointments" feature to work you will need to add yourself into the Employees table and specify your domain name as the user name. Make sure to specify a valid email address if you want to email appointments.
In order to import data on the Materials Catalog screen, copy the StructuralMaterials.xls located in the root of this sample to your My Documents folder first. Then click the Import from Excel button on the screen and select the spreadsheet. You can them map the columns in the spreadsheet to the entity properties and the data from the spreadsheet will appear as new rows on the Materials Catalog. Click Save to send the data to the database.
You can get a good understanding of more advanced LightSwitch features by working through the LightSwitch Training Kit. If you look under the “LightSwitch Advanced features” section on the right-hand sidebar on the opening page of the kit you will see the demos and labs.
Here are some more resources of Visual Studio LightSwitch to explore:
For questions related to this sample please contact me here. For other LightSwitch questions and troubleshooting please visit the LightSwitch Forums.
Enjoy!
Last week I spoke at TechEd North America in lovely Atlanta, Georgia. Always an amazing (and huge) conference, this year was a little more special for me as one of the faces of Visual Studio LightSwitch, the newest edition of the Visual Studio family, which had a lot of great presence and excitement at TechEd.
Members from the team ran the booth that was located dead center of the expo floor almost right in front of the main door, so we ended up with a lot of traffic. Of all the Visual Studio booths, ours had the most traffic by far! The organizers also put a lot of cool LightSwitch advertising everywhere, from a huge rug on the expo floor to a giant banner up the escalators (see pictures below). At the GeekFest party on Tuesday night everyone got a cool flashing beer mug with the Visual Studio LightSwitch logo on it. Even though I forgot mine (argh!), it was totally cool to see LightSwitch “techno-style” all over the crowds that evening.
We had a lot of great conversations with folks about what LightSwitch is and what it can do, the kind of applications it can build, and what people were going to use it for. There were developers and IT Pros of all skill levels interested in the product which was really encouraging. A lot of people had heard of LightSwitch but weren’t sure what it was. When we showed it off, people loved that so much of the application was functional without writing any code. Eyes got wide when they saw how easy it was to create tables and a master/details screen, and were able to F5 and see the application running immediately. Some of our favorite quotes were:
We also got a lot of great feedback from professional developers that our architecture was sound and made sense and how they liked the extensibility model, especially the ability to integrate your own Silverlight controls into the UI. In fact, one of our partners released an extension while we were at TechEd last week, the Document Toolkit for LightSwitch which allows you to upload and view Word documents directly on LightSwitch screens. It will be exciting to see our partners as well as the community build amazing extensions for LightSwitch when we release.
I had two sessions, one on OData and one on Extending LightSwitch. Robert Green also did a great intro session which drew over 300 people and he got great scores. I did a similar session at DevDays last month. You can watch Robert’s session here: Building Business Applications with Microsoft Visual Studio LightSwitch. Also another super-cool teammate of mine did a session on SharePoint development in VS that you can watch here: Introduction to SharePoint Development with Microsoft Visual Studio 2010.
Watch the Video: Extending Microsoft Visual Studio LightSwitch Applications
Download the Sample: Contoso Construction – Advanced LightSwitch Development Sample
In this session I showed some advanced development and different levels of customization that you can do to your LightSwitch applications. There were about 80 people in the session and only one person in the audience had never heard of LightSwitch. I ended up in the top 10 sessions at TechEd so I suppose it went really well . I started off by showing an application called “Contoso Construction” that I built using Visual Studio LightSwitch edition (no VS Pro installed) that has some pretty advanced features like:
During the session we built some of the parts of the application that any LightSwitch developer has access to. You don’t necessarily need VS Pro to write advanced LightSwitch code, you just need it to build extensions (which we did in the end). We dove into the LightSwitch API and I explained the save pipeline and the DataWorkSpace as well as talked a little bit about the underlying n-tier architecture upon which LightSwitch applications are built. I showed how to access the code behind queries so you can write more advanced LINQ statements. I showed how to flip to File View and access client and server projects in order to add your own classes. We injected some business rules into the save pipeline in order to email new, updated and canceled appointments and I walked through how to use content controls in Word to create report templates that display one-to-many sets of data. I also showed how to build custom Silverlight controls and use them on screens.
I then went through the 6 LightSwitch extensibility points. Shells, themes, screen templates, business types, custom controls and custom data sources. I showed how to install and enable them and then we built a theme. I showed off the LightSwitch Extension Development Kit which is currently in development here. This will help LightSwitch extension developers build extensions quickly and easily and I used it to build a theme for the Contoso Construction application. Just like I mentioned before, LightSwitch extensions are similar to other Visual Studio extensions, they are also VSIX packages you just click on to install and manage via the Extension Manager in Visual Studio (also included in LightSwitch). For a couple good examples of extensions, that include all source code see:
Advanced resources:
Watch the Video: Creating and Consuming Open Data Protocol (OData) Services
I also presented on the OData (Open Data) protocol and how to create and consume data services in .NET. There were about 200 attendees and I got some great scores and comments. I have written and spoken about this topic many times and it’s one of my favorites and I was honored that the Astoria team let me deliver this session for them. The session goes over what the OData protocol is and how it works on the wire but takes a business application/BI slant. We first play with the Netflix data service then I show how to create data services over Northwind and the AdventureWorks data warehouse. I then show how to consume them using PowerPivot in Excel. I also show how to consume and analyze data from the Azure DataMarket – these are sets of data in the cloud that you can subscribe to and use in your applications, some are pay and some are free. For my demo, I took some free US government crime data and used PowerPivot to create a simple report on the most violent cities in Georgia – Atlanta won by a very wide margin (eek!). I also showed how to write a VSTO Excel document customization that works with SharePoint 2010 data services to visualize the data. Here are some resources you should check out:
There’s always a ton of fun stuff happening at TechEd. You basically work all day and then party all night and do that straight for 4 or 5 days. I came back healthy with only a slightly lost voice which is a lot better than I can say for other people I know . The closing party was really awesome, held at the Georgia Aquarium and World of Coke center. There was a cool band outside and the weather was nice and warm that night. Check out some of the pictures I took:
Thank you Atlanta, see you next time!
UPDATE 12/15/2011 – This blog post is based on Beta 2. Now that Visual Studio LightSwitch has released please head on over to this Getting Started series of tutorials: Beginning LightSwitch: Getting Started --------------------------------
Now that we’ve had Beta 2 released for over a month we’re seeing a LOT more people asking questions in our forums and visiting our developer center which is awesome! Sometimes people don’t know where to start, especially as more and more people start posting more advanced LightSwitch content out there on the web. So here’s where you start:
There on the home page you will see clear steps to get started.
Download Visual Studio LightSwitch Beta 2
Watch the instructional LightSwitch "How Do I?" videos
Ask questions in the LightSwitch forums
If you click on “Get essential training” then you will be taken to the Learn page which is broken down into the sections, Getting Started, Essential Topics, Advanced Topics. The getting started section is what you want to start with (I guess we named the section appropriately )
Are you completely new to Visual Studio LightSwitch? This information will help you get started using LightSwitch to develop business applications for the desktop or the cloud. Be sure to check out the step-by-step “How Do I”videos.
Create Your First LightSwitch Application
Watch the LightSwitch How Do I Videos
Download the Visual Studio LightSwitch Training Kit
I’ll also recommend watching the following video of my session from Dev Days a couple weeks ago to give you an idea of what LightSwitch can do and how to quickly build a business application:
Video Presentation: Introduction to Visual Studio LightSwitch
When you’ve worked yourself through the getting started section, move into the Essential Topic areas to drill in more. We add content here often so if you’re learning LightSwitch, you’ll want to bookmark this page.
Have fun and Enjoy!
Recently I spoke at DevDays 2011 in The Hauge, Netherlands, and what a show! It’s my second time speaking here at the World Forum – a great venue that holds a few thousand people. This is a professional developer and IT Pro conference that they put on every spring. I did 3 sessions and 1 “geek night” talk all on Visual Studio LightSwitch so I came up with some new content and demos that I think people enjoyed.
This session was in a huge theater that had maybe 400-500 people. It was awesome to see such an interest in this new member of the Visual Studio family. In this session we build my version of the Vision Clinic application from scratch, end-to-end, including security and deployment. We do write some code but only some simple business rules and calculated fields, and in the end we have a full-blown business application. The goal is to show what LightSwitch can do for you out of the box without having to know any details of the underlying .NET technologies upon which it is built. I did the entire demo with just Visual Studio LightSwitch installed (not VS Pro or Ultimate) so that I could show how simplified the menus, toolbars, and tool windows are inside the development environment. The recording is available on Channel 9. I suggest downloading the High Quality WMV:
When I asked who had downloaded the Beta already, only about 10% raised their hand so I made it my job to convince everyone to go download it afterwards ;-). I also asked how many people were not professional developers (didn’t get paid to write code) and a few people raised their hand (I expected only a few since this was a pro developer conference). Those few were IT pros and business people that came to listen in and one business person followed me to my next talks because of how excited he was in the prospect of using LightSwitch for his cloud consulting business.
What I showed in the session is pretty much exactly what I included in the LightSwitch Training Kit. If you look under the “LightSwitch Overview” on the right-hand sidebar on the opening page of the kit you will see the complete demo code and demo script that you can use for training folks at your local user groups. :-) Here are some more resources to check out that will help introduce you to Visual Studio LightSwitch:
This session drew about 100 or so attendees, and everyone but a couple people had either been to the intro session or already knew what LightSwitch was. In this talk I show what you can do with LightSwitch beyond just the screen templates and entity designer.
I started off by quickly walking through the Course Manager sample which shows off features of Beta 2. This application does not have any custom controls or extensions and really shows what kind of powerful applications you can build right out of the box with just Visual Studio LightSwitch installed. Check out the series Andy has started on how he built the Course Manager.
We then dove into the LightSwitch API and I explained the save pipeline and the DataWorkSpace as well as talked a little bit about the underlying n-tier architecture upon which LightSwitch applications are built. I also showed how to build custom controls and data sources as well as use extensions. In this session I had LightSwitch installed into Visual Studio Professional so that I could show building custom controls. You create custom controls like you would any other Silverlight control in a Silverlight class library which can be referenced and used on screens. If you want to go a step further you can create a LightSwitch extension which (depending on the type of extension) integrates into the LightSwitch development environment and shows up like other built-in items.
To demonstrate custom controls, I built a simple Silverlight class library with a custom list box of my own and then showed how you can set up the data binding to the view model and reference the control on your LightSwitch screen. I also built a custom RIA service and showed how LightSwitch screens interacted with custom data sources. When I got to extensions, I used the Bing map control extension (which is included in the Training Kit) and loaded it into LightSwitch. Just like any other Visual Studio extension, LightSwitch extensions are also VSIX packages you just click on to install. I then added the map to a Patient details screen to display the address of the patient.
In this session I showed some more advanced development and different levels of customization that you can do to your LightSwitch applications. There were about 50 people in the session and I recognized some of them as MVPs and other speakers. This isn’t surprising since the product is still in Beta, I was happy to see 50 people there ready to dive deeper. :-)
I started off by showing an application called “Contoso Construction” that I built using Visual Studio LightSwitch edition (no VS Pro installed) that has some pretty advanced features like:
(I PROMICE I will get this sample uploaded but we want to use it at TechEd next week so I was asked to wait a week.)
During the session we built some of the parts of the application that any LightSwitch developer has access to. You don’t necessarily need VS Pro to write advanced LightSwitch code, you just need it to build extensions (which we did in the end). I showed how to access the code behind queries so you can write more advanced LINQ statements (and I messed up one of them too – my only demo hiccup of the conference so not so bad!) I showed some advanced layout techniques for screens and how to place static images and text on screens. I also showed how to flip to File View and access client and server projects in order to add your own classes. We injected some business rules into the save pipeline in order to email new, updated and canceled appointments and I walked through how to use content controls in Word to create report templates that display one-to-many sets of data.
Here are some more advanced resources of Visual Studio LightSwitch to explore:
One of our ASP.NET MVPs and LightSwitch community champions, Stefan Kamphuis held down the fort at the Visual Studio LightSwitch booth. He said it was packed the entire conference. I stopped by a couple hours and there were a lot of great discussions around how LightSwitch works, how does it scale, and deployment options. I also found it cool that everyone that came by on my watch had backgrounds in VB6, Access, Cobol and/or FoxPro and struggled with the move to .NET in the beginning for these types of business applications (myself included).
My geek night session was titled “Build a Business Application in 15 minutes” but the session was 45 minutes long and no one brought beer. So I started asking people what king of bells and whistles we should add to the app. I screen scraped the session and speakers lists from the DevDays website and then used the Excel Import extension to upload the data into the system. The cool thing about this control is that it will also relate data entities together for you, so I had a list of speakers and their sessions. I then added a rating control from the Silverlight Toolkit and adapted it to use it in LightSwitch to give speaker ratings. I think people enjoyed it even though I didn’t have beer. ;-)
I stayed thru Saturday for Queensday and OMG what a party. I’ve never seen so many people dancing on the streets nor that much trash in my life. What an unforgettable experience. I had an absolute blast!
Thank you Netherlands, see you next time!
Last week I spoke at DevDays in the Netherlands and what a fun show! They just posted my session Introduction to Visual Studio LightSwitch on Channel 9 so check it out when you have a chance, I think it went really well. The room was about 500 people so there was a lot of interest from professional developers at the conference in LightSwitch.
I’ll write up a full recap of all my sessions (along with the promised code samples and resources!) soon but for now enjoy the Beth Massi show. :-)
Watch: Introduction to Visual Studio LightSwitch (Tip, download the the High Quality WMV if you can, it’s a lot smoother)