labs icon indicating copy to clipboard operation
labs copied to clipboard

Build and run the azure function but I get an error message

Open Haroon921 opened this issue 4 years ago • 0 comments

Hello Mark,

I am preparing for a partner workshop using the following link: https://github.com/AzureCosmosDB/labs/blob/master/dotnet/labs/08-change_feed_with_azure_functions.md#create-an-azure-function-to-consume-cosmos-db-change-feed

I need to build and run the azure function but I get an error message.

C:\labs\Lab08\ChangeFeedFunctions>dotnet run Unable to run your project. Ensure you have a runnable project type and ensure 'dotnet run' supports this project. A runnable project should target a runnable TFM (for instance, net5.0) and have OutputType 'Exe'. The current OutputType is 'Library'. I attempted to include the following <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp3.1</TargetFramework> <AzureFunctionsVersion>v2</AzureFunctionsVersion> </PropertyGroup> <ItemGroup> then I get the following C:\labs\Lab08\ChangeFeedFunctions>dotnet run CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [C:\labs\Lab08\ChangeFeedFunctions\ChangeFeedFunctions.csproj] The build failed. Fix the build errors and run again.

Haroon921 avatar Mar 15 '21 15:03 Haroon921