Skip to content

Latest commit

 

History

History
63 lines (47 loc) · 2.66 KB

ConsoleAppsReadme.md

File metadata and controls

63 lines (47 loc) · 2.66 KB

Producer and Consumer Console Apps

The producer is a console app. It simulates a sensor attached to a taxi driving in a city. It loads data from files that record the locations of taxi and emits to Azure Storage Account Table.

The producer and the consumer are implemented in C#. They are running on the cross-platform .NET Core 2.0.

1. Run & Debug with Visual Studio 2017

1.1. Prerequisites

  1. You need Visual Studio 2017 version 15.3.0 or higher with the .NET Core cross-platform development workload. Please follow this official guide to install this workload.
  2. An existing Storage Account. Follow this link to create a Storage Account in the Azure Portal.

1.2. Debugging the producer

  1. Launch Visual Studio 2017 and open project file producer.csproj in the client/producer folder.
  2. Check appsettings.json file to make sure the properties connectionString and eventHubName are configured correctly.
  3. You can press F5 to start the app in debug mode. Visual Studio 2017 will then start restoring the dependency packages, after which the debugger will start.

Note: Make sure your project path does not contain any special characters (such as %20) otherwise restoring of NuGet packages may fail with an error message similar to this: The operation failed as details for project producer could not be loaded.

Package restored

  1. Press Shift + F5 to exit debug mode.

2. Build

2.1. Prerequisites

  1. Install .NET Core on your environment (Windows, Linux or macOS/OS X)

2.2. Producer

  1. Switch to producer folder
cd clients\producer
  1. Restore
dotnet restore
  1. Build
dotnet build
  1. Publish

For Windows 10

dotnet publish -c Release -r win10-x64

For Linux

dotnet publish -c Release -r linux-x64

For macOS

dotnet publish -c Release -r osx-x64

The default output location is client\producer\bin\Release\netcoreapp2.0 Publish Location

3. Conclusion

Now, you have an executable in your output folder that will allow you to run the producer without the use of Visual Studio.