appwrite / templates

Templates for Appwrite Functions ⚡ī¸đŸŒŠī¸
https://appwrite.io
MIT License
119 stars 85 forks source link

🐛 Bug Report: .NET starter fails to build locally #50

Closed moguzalp closed 1 year ago

moguzalp commented 1 year ago

👟 Reproduction steps

When I build https://github.com/appwrite/templates/tree/main/dotnet/starter csproj

👍 Expected behavior

Build successfully

👎 Actual Behavior

In public async Task Main(RuntimeContext Context)

The type or namespace name 'RuntimeOutput' could not be found (are you missing a using directive or an assembly reference?) The type or namespace name 'RuntimeContext' could not be found (are you missing a using directive or an assembly reference?)

🎲 Appwrite version

Version 1.4.x

đŸ’ģ Operating system

Windows

🧱 Your Environment

No response

👀 Have you spent some time to check if this issue has been raised before?

đŸĸ Have you read the Code of Conduct?

loks0n commented 1 year ago

Hey @moguzalp ! Thanks for creating this issue.

Is the build output you have provided from your local machine, or from the function build logs display in Appwrite Console?

If it's from your local machine, the function is failing to build because it doesn't have the runtime context objects used by Open Runtimes run your function.

If it's from the function build logs on Appwrite Console, it's a bug and we would need to fix the template.

moguzalp commented 1 year ago

Hey @loks0n , Thanks for the reply.

It is the issue:

"If it's from your local machine, the function is failing to build because it doesn't have the runtime context objects used by Open Runtimes run your function."

Let me details in my words:

if I deploy the code to self container appwrite, I mean to localhost appwrite, it works as expected. However I want to develop .csproj file in visual studio, it does not compile because it does not resolve the RuntimeOutput and RuntimeContext although it has appwrite nuget package.

loks0n commented 1 year ago

Ah, okay. The RuntimeOutput and RuntimeContext are added by the Open Runtimes container before you code is executed on Appwrite. You can see the code for this here.

In the future we'd like to build some helper functions to mitigate these local errors, but for now it's fine to ignore them. If you have any suggestions as to how we can improve Visual Studio support, we'd love to hear them 🚀

moguzalp commented 1 year ago

From my experience on appwrite, appwrite is awesome product. It works as self container and it has a cloud version as well.

But more documentation is needed it seems. Especially while version upgrades such as Appwrite 1.4 for example. So far I found the answers to my question while digging in appwrite's github issues fortunately.

This thread I created will help many others I hope. Thanks for awesome answer.