none
Sample n-tier applications for SQL

    Question

  • Can someone point me in the direction of the latest or most current sample n-tier applications for Microsoft platforms, e.g., Petshop, Stocktrader, etc?
    Tuesday, November 11, 2014 11:58 PM

All replies

    • Proposed as answer by Mr. WhartyModerator Thursday, November 13, 2014 1:06 AM
    • Unproposed as answer by Randyisit Thursday, November 13, 2014 1:38 AM
    Wednesday, November 12, 2014 9:57 AM
  • Thank you for the suggestion. I'm more interested in more current versions of Petshop or Stocktrader. Preferably something based on SQL and IIS, as well as documentation for deployment.
    Thursday, November 13, 2014 1:41 AM
  • I have essentially the same question, because I have found that the StockTrader 6 sample app is woefully unusable in its present form on the later .NET stack.  The packaged deployment appears to be bound to the following run-time libraries:

    WindowsAzureAuthoringTools-x64.msi version 2.1.0
    WindowsAzureLibsForNet-x64.msi version 2.1.0

    However, those are no longer downloadable, at the Azure SDK version 2.1 for .NET links on MSDN.

    I tried using Visual Workstation 2015 to update the StockTrader 6 project, but the sources are based on deprecated Azure SDK and the newer versions of the Azure SDK are not compatible (nor is VWS2015 compatible with the older Azure SDK's).  I even tried going back to VWS2012, but it could not load the project for other incompatibility reasons.  I am in the process of trying VWS2013 with Azure SDK version 2.2 for .NET, to see if I can covert the run-time references to version 2.2.0, but by now what should be a simple matter is taking days and days worth of rather large downloads with no end in sight.  :S

    To clarify...  I am not even trying to use Azure features; rather, I just want to deploy locally into IIS with a local SQL Server instance, a la "Configure StockTrader for use with IIS," but the app won't load due to the unresolved dependencies in code I don't even expect to be using.  :-(

    In case anyone has any helpful suggestions for updating the Stocktrader 6 app, the prominent errors that I keep getting (due to lack of Azure for .NET 2.1.0 runtimes) is this one and there is a similar one for Microsoft.WindowsAzure.Diagnostics:

    Server Error in '/StockTrader6Web' Application.
    
    Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    
    Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
    
    Source Error: 
    
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 
    
    Stack Trace: 
    
    
    [FileNotFoundException: Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
       ConfigService.AzureConfigUtility.AzureUtility.isOnAzure() +0
       ConfigService.ServiceConfigurationUtility.ConfigUtility.setAzureRuntime(Boolean check) +17
       Trade.Web.Global.Application_Start(Object sender, EventArgs e) in c:\depot\stocktrader\Source\StockTrader\StockTrader\StockTraderWebApplication\AzureStockTraderRole\Global.asax.cs:16
    
    [HttpException (0x80004005): Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
       System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +475
       System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
       System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +176
       System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +349
       System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +303
    
    [HttpException (0x80004005): Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +658
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +95
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +189
    • Proposed as answer by Leon.S Saturday, October 01, 2016 4:26 AM
    • Unproposed as answer by Leon.S Saturday, October 01, 2016 4:26 AM
    Friday, September 30, 2016 7:27 PM
  • I've finally managed to hack the StockTrader 6 sample app to work, but not without consceding to reverting to Visual Studio 2013.  :-/

    Okay then...   I'll bet nobody would have dreamed how dead-on-the-vine MS has allowed the StockTrader 6.1 app to become.  :S   It seriously needs updating, but by someone more experience with it than me (and it wouldn't take much).  ;-)

    What I learned the hard way...

    1)  MS has pulled the version 2.1 Azure SDK for .NET runtime libraries from their website; hence, the app blows up upon startup, due to permanently unresolvable dependencies.  I say permanent, because the libraries are unobtainable.  Grrr.

    Based on a local IIS / local SQL DB deployment, I am not even using Azure features, but the app still needs to resolve the dependencies or it won't load.  It means the app needs to be recompiled with a newer SDK...and that's where the "fun" begins.

    2)  The newest Visual Studio (2015) is incompatible with the older versions of the Azure SDK for .NET, so an older compiler is needed in order to use a version of the SDK that still supports the deprecated features needed by StockTrader 6.1 sources.  Of course I didn't know that until I tried it (and a FULL day of downloading spent between getting the 2015 version and later trying the 2012 version before arriving at #3).  Thank goodness for Virtual Machine snapshots!  =D

    3)  There is a combination of Visual Studio 2013 and Azure SDK version 2.2 for .NET that is ultimately able to convert the projects from Azure SDK 2.1 to SDK 2.2. Yay! =D

    4)  Visual Studio 2013 fails to complete the Azure SDK conversion, leaving unresolved issues that I only found a long way into an increasingly futile chain of following rat-hole after rat-hole.  :S

    I eventually noticed a warning about not being able to write a file in the build location.  The Stocktrader 6.1 installer leaves the files owned by SYSTEM and perms them off so that the regular Visual Studio developer cannot write files there, which Visual Studio is virtually silent about.  :S  Attempting to recursively change the directory owner failed with numerous errors, despite having ADMIN privs.  It turns out that the top-level stocktrader6_1 directory itself was set to read-only.  More than a tad silly for an app that is designed to used as a learning environment for budding MS developers, but in retrospect, they probably expect the developer to copy the folder first before modifying it.  FINE! … but it should work out of the box first!  ;-)

    After finally uncovering and correcting all of the above issues, I was ultimately able to convert the projects to the newer SDK and get the StockTrader app to run.  Yay!

    Saturday, October 01, 2016 4:35 AM