locked
Sharing code between Server, Common and Client projects RRS feed

  • Question

  • Thinking the Common project was common to both the client and server I created some code in Common\UserCode.

    While the Client project can see my stuff in the Common project as expected, the namespace, class and routines are not visable in the Server project unless I attach the .cs file from Common to Server\UserCode\xxx.cs.

    Is this correct? Am I missing something? Is this the intended way to share code or is ther an alternative suggestion?


    Bruce

    Thursday, February 23, 2012 1:57 AM

Answers

  • You shuld see every public type on server and client if you add it in common project.

    Maybe you missing some using directive on server side code.

    By default your custom  code is in LightswitchApplication.UserCode namespace.

    Try to rebuild solution and just use appropriate namespace on server and client side.

    • Marked as answer by bruce demoose Saturday, February 25, 2012 3:29 PM
    Thursday, February 23, 2012 8:03 AM

All replies

  • You shuld see every public type on server and client if you add it in common project.

    Maybe you missing some using directive on server side code.

    By default your custom  code is in LightswitchApplication.UserCode namespace.

    Try to rebuild solution and just use appropriate namespace on server and client side.

    • Marked as answer by bruce demoose Saturday, February 25, 2012 3:29 PM
    Thursday, February 23, 2012 8:03 AM
  • You're right; can't figure what I was doing wrong. Feel kinda stupid; not the first time - won't be the last time.


    Bruce

    Saturday, February 25, 2012 3:29 PM
  • is there a way to skip thee common project and just let server and client project interact with each other?
    Thursday, November 28, 2013 5:06 PM
  • No. Do a search on the terms "lightswitch client server code" and you will find a number of posts describing the architecture.

    Bruce

    Tuesday, December 3, 2013 1:21 PM