GoogleCloudPlatform/functions-framework-dotnet

Is there a way to specify a specific project to build?

StephenHodgson opened this issue · 3 comments

I have a project where I'm using multiple .csproj files embedded in a single .sln

When deploying I get the error:

ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed: expected to find exactly one project file in directory ., found [./Submodule/submodule.csproj ./***-gcloud-functions.csproj];

I tried setting the --source flag to specify the specific .csproj to use because of the similar strategies for Node and Python:

Note that, depending on your runtime type, Cloud Functions will look for files with specific names for deployable functions. For Node.js, these filenames are index.js or function.js. For Python, this is main.py.

Is there another way to specify the .csproj to use?

Yes, you need to set the GOOGLE_BUILDABLE environment variable during the build process.

See https://github.com/GoogleCloudPlatform/functions-framework-dotnet/blob/master/docs/deployment.md#deploying-a-function-with-a-local-project-dependency for more details, along with the sample command line in https://github.com/GoogleCloudPlatform/functions-framework-dotnet/blob/master/docs/examples.md#multiprojectfunction-and-multiprojectdependency

Hopefully that will sort you out - if not, if you could provide a minimal complete example as a zip file, that would be great. Please be aware that it's a public holiday in the UK on Monday though, so I probably won't get to it until Tuesday.

I didn't actually try this out. I ended up publishing the other project to Nuget instead.

Okay. It sounds like you're sorted anyway - I'll close the issue now. Please let me know if you run into any more problems.