Azure-functions-host: #r referencing issue between web editor and local text editor

Created on 12 Apr 2016  路  3Comments  路  Source: Azure/azure-functions-host

Hi, Team.

I've been playing around Azure Functions for a couple of days. What I've found interesting is to make use of the #r directive. When I use the #r directive for my external assembly ClassLibrary1.dll in Visual Studio Code, I should use

#r "bin/ClassLibrary1.dll"

However, this causes the compile error when I push this into Azure Functions. In the web editor on Azure Functions, I should change it to:

#r "ClassLibrary1.dll"

There is something happening behind the scene in Azure Functions, which causes inconsistency in writing codes.

I know that, in Build 2016, Chris Anderson said development environment will be released in May. In the meantime, how can I sort out this issue?

Most helpful comment

@justinyoo we're still working on the local dev experience and don't (yet?) have an extension for VS Code or VS, but more guidance (and tooling) will become available in future releases. I'd encourage you to open an idea on our feedback to make this visible and help the product team prioritize those features. Here's the one for VS:
https://feedback.azure.com/forums/355860-azure-functions/suggestions/13301214-visual-studios-tooling-with-local-execution-debug

All 3 comments

@justinyoo, this is by design. Azure Functions defaults to the \bin folder for private assembly probing, so there's no need to use that in the path and you can simply reference the file name.
If you're developing locally, you can do the same. What issues are you seeing when following this process locally?

@fabiocav I would assume that it is by design. In somewhat reason, I was unable to run my test.csx code because the assembly was not found. But it's now fine after rebooting my laptop. Never mind. Thanks for your clarification.

By the way, do you have a particular extension installed in VS Code?

image

I see the #r is only allowed in scripts [net46] error message.

@justinyoo we're still working on the local dev experience and don't (yet?) have an extension for VS Code or VS, but more guidance (and tooling) will become available in future releases. I'd encourage you to open an idea on our feedback to make this visible and help the product team prioritize those features. Here's the one for VS:
https://feedback.azure.com/forums/355860-azure-functions/suggestions/13301214-visual-studios-tooling-with-local-execution-debug

Was this page helpful?
0 / 5 - 0 ratings