tntwist / NL.Serverless.AspNetCore

Hosting an AspNet Core App inside an Azure Function V3 HTTP Trigger
MIT License
20 stars 3 forks source link

Error running in Azure: "Can't find 'C:\home\site\wwwroot\MY_WEBAPP.deps.json'" #54

Open ChristianWeyer opened 2 years ago

ChristianWeyer commented 2 years ago

Thanks for this Lib :-)

My solution runs fine locally. When deploying it to Azure, I get an HTTP 500 when calling the site and I can see this exception in Application Insights:

System.InvalidOperationException: Can't find 'C:\home\site\wwwroot\GrpcCodeFirst.Api.deps.json'. This file is required for functional tests to run properly. There should be a copy of the file on your source project bin folder. If that is not the case, make sure that the property PreserveCompilationContext is set to true on your project file. E.g '<PreserveCompilationContext>true</PreserveCompilationContext>'. For functional tests to work they need to either run from the build output folder or the GrpcCodeFirst.Api.deps.json file from your application's output directory must be copied to the folder where the tests are running on. A common cause for this error is having shadow copying enabled when the tests run.

I tried and set the PreserveCompilationContext, rebuilt, and redeployed. But still got the same result.

When looking at the Function App with Kudu, I can see GrpcCodeFirst.FunctionApp.deps.json, but not the file mentioned in the exception.

Did you ever see this? Any idea how to fix it?

This is my code sample: https://github.com/thinktecture/blazor-wasm-grpc-code-first/tree/functionsapp

Thanks!

ChristianWeyer commented 2 years ago

Any idea @tntwist ?

tntwist commented 2 years ago

Hi there. Not a clue at the moment. Sorry. I´ll look into this hopefully on the weekend.

ChristianWeyer commented 2 years ago

Did you have a chance to look into it @tntwist ? Thanks!