Archive

Posts Tagged ‘LightSwitch’

Strange errors in generated file DataServiceImplementation.cs in LightSwitch

September 2, 2011 3 comments

Over the past week or so I have been playing with LightSwitch and have been very impressed with what I have found.

That being said, while I know this problem was my fault for being lazy, I have come across my first batch of strange code generation errors. While simple to solve I assume I am probably not the only person to make this mistake so thought I would share my findings.

As part of learning about LightSwitch, I have been going through and following a number of tutorials on the various aspects.

Currently I am looking at using RIA services as a data source and have been following the Creating a Simple LightSwitch RIA Service (using POCO) tutorial from LightSwitch Help Website.

Rather than download the code sample, I was rewriting the code step by step. However once I added my data source to the LightSwitch application and tried to compile I received these errors in DataServiceImplementation.cs within the ServerGenerated project.

Error	1	) expected
Error	2	Invalid expression term ')'
Error	3	; expected
Error	4	; expected
Error	5	A new expression requires (), [], or {} after type
Error	6	; expected

ErrorList

Of course I thought generation errors probably mean I have done something wrong. I looked over the code I had written and it all roughly matched what was provided in the tutorial. I then downloaded the tutorial source and saw that it compiled and worked correctly.

Puzzled I took a closer look at my code and decided to clean it up as I had been lazy and just dumped everything in the same file while I was working. Upon doing so I noticed that when I created the CustomerRecord model class, I accidentaly created it as a nested class of the domain service class.

i.e.

public class DomainService
{
    public class CustomerRecord
    {           
    }
}

instead of


public class DomainService
{
}

public class CustomerRecord
{
}

After refactoring this class into its own file as I should have done in the first place, and updating the data source the solution copiled correctly.

With any luck this will help someone else that makes the same stupid mistake as me.

Categories: .NET Tags:

First Impressions of Microsoft Visual Studio LightSwitch

September 1, 2011 Leave a comment

A couple of weeks ago I attended the Tech Ed Australia 2011 Brisbane Preview breakfast session. As I am not actually attending Tech Ed this year, this was a chance for me to see some short and sweet versions of a few of the sessions being presented.

One of the sessions that took my fancey was the Introduction of Visual Studio LightSwitch by Andrew Coates (@coatsy).

As a result, over the past week or so I have been playing with LightSwitch and have been very impressed with what I have found.

For those of you who have not seen or heard of it yet, LightSwitch is a self-service development tool that enables non developers to build business applications quickly and easily. While it lends itself well to forms over data type systems, with a SilverLight client it is not limited to such applications.

In my eyes it is a replacement tool for building the equivalent of all of the old archaic MS Access and Excel “programs” out there that have been built by non developers out of necessity for something simple right then and there.

It is also very powerful for prototyping and initial requirements gathering for a bespoke system, as real working software can be shown rather than just wire frames and mock ups.

What I see as the added bonus however is that LightSwitch is also a very extensible, customisable and flexible, opening it up to mid and high level developers as well. This along with the built in 3 tier architecture and simple deployment scenarios, I see this filling a lot of holes, and increase speed of delivery in the SME (Small and medium enterprise) market.

This also means that these “necessity” applications can later be taken over by a professional development team without the usual screams of pain…

If you are getting started I would suggest you run through the Lightswitch How Do I? Videos and download the slides from @coatsy’s Tech Ed sessions.

The other resource I have found very helpful is the LightSwitch Help Website and another large list is available from Glenn Wilson’s (@Mykre) blog post here.

I am still learning this stuff myself but if you have any questions leave me a comment and I will see what I can do.

Categories: .NET, General Tech Tags: ,
Follow

Get every new post delivered to your Inbox.

Join 141 other followers