Azure-docs: Deployment

Created on 28 Mar 2019  Â·  3Comments  Â·  Source: MicrosoftDocs/azure-docs

Hi! Great walkthrough! Ran into an issue while deploying the C# code sample. I've attempted this twice now (from scratch) and received the same terminal message:

Sending build context to Docker daemon    341kB
Step 1/12 : FROM microsoft/dotnet:2.1-sdk AS build-env
 ---> c17aa78d71c2
Step 2/12 : WORKDIR /app
 ---> Using cache
 ---> 05172f3d0a7c
Step 3/12 : COPY *.csproj ./
 ---> Using cache
 ---> 9ac30548298c
Step 4/12 : RUN dotnet restore
 ---> Using cache
 ---> c77754b95b4d
Step 5/12 : COPY . ./
 ---> Using cache
 ---> 732d73f332fe
Step 6/12 : RUN dotnet publish -c Release -o out
 ---> Running in e856da5fd352
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restoring packages for /app/csharpmodule.csproj...
  Generating MSBuild file /app/obj/csharpmodule.csproj.nuget.g.props.
  Generating MSBuild file /app/obj/csharpmodule.csproj.nuget.g.targets.
  Restore completed in 1.55 sec for /app/csharpmodule.csproj.
Program.cs(27,53): error CS1525: Invalid expression term '>' [/app/csharpmodule.csproj]
Program.cs(28,46): error CS1525: Invalid expression term '>' [/app/csharpmodule.csproj]
Program.cs(68,35): error CS1525: Invalid expression term '>' [/app/csharpmodule.csproj]
Program.cs(112,23): error CS1056: Unexpected character '$' [/app/csharpmodule.csproj]
Program.cs(115,24): error CS1056: Unexpected character '$' [/app/csharpmodule.csproj]
Program.cs(115,85): error CS1525: Invalid expression term '' [/app/csharpmodule.csproj]
Program.cs(115,85): error CS1056: Unexpected character '$' [/app/csharpmodule.csproj]
Program.cs(115,87): error CS1003: Syntax error, ',' expected [/app/csharpmodule.csproj]
The command '/bin/sh -c dotnet publish -c Release -o out' returned a non-zero code: 1

I've tried this with the dotnet 2.2 core sdk and the runtime.

Can you clarify what the issue is or help point me in the right direction? Thanks!


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

cxp doc-bug in-progress iot-edgsvc triaged

Most helpful comment

From the error message it seems there is some invalid char in the Program.cs file '&gt' (>). It may be caused by when copy/paste the code from the docs. @KingdomOfEnds can you check the Program.cs file to find whether there is invalid chars.

All 3 comments

@KingdomOfEnds Thanks for the feedback! We are currently investigating and will update you shortly.

From the error message it seems there is some invalid char in the Program.cs file '&gt' (>). It may be caused by when copy/paste the code from the docs. @KingdomOfEnds can you check the Program.cs file to find whether there is invalid chars.

Thanks @adashen - You are correct. Several white spaces were introduced (between arrow functions and template strings) causing the errors. A new line character (between import statements) prevented the characters from appearing. Should have caught that. I am testing again now. Much appreciated!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Favna picture Favna  Â·  3Comments

JeffLoo-ong picture JeffLoo-ong  Â·  3Comments

DeepPuddles picture DeepPuddles  Â·  3Comments

behnam89 picture behnam89  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments