Reference c# class library in my Azure Function(在我的 Azure Function 中引用 c# 类库)
问题描述
是否可以在 Azure Function Visual Studio 项目中引用 C# 类库?
Is it possible to reference a c# class library in an Azure Function visual studio project?
我知道引用外部库和 Nuget 包的可能性.目前我正在使用共享的 .csx 文件,如 这里.这些 .csx 文件现在包含我的 DTO 的副本,这些副本也用于我用来使用这些功能的服务代理中.
I am aware of the possibilities to reference external libraries and Nuget packages. Currently I am using shared .csx files as described here. These .csx files now contain a copy of my DTO's which are also used in the Service Agents which I use to consume the functions.
理想情况下,我想在 Visual Studio 中添加一个从函数到类库项目的引用,并且 Visual Studio 正在将此 dll 添加到 bin 文件夹中.
Ideally I want to add a reference in Visual Studio from a Function to a class library project and that Visual Studio is adding this dll to the bin folder.
推荐答案
目前不支持项目引用,但您可以将项目的输出(生成的程序集和可能的依赖项)复制到函数根目录下的文件夹中,然后您可以使用上面提到的外部库支持来利用它(例如 #r "..myassemblyfolderMyAssembly.dll"
)
Currently, project references are not supported, but you can have the output of your project (the resulting assembly and possible dependencies) copied onto a folder under your function's root, which you can then leverage using the external libraries support you've mentioned above (e.g. #r "..myassemblyfolderMyAssembly.dll"
)
如果可能,我建议就该功能请求打开一个问题,在此 上分享有关您的场景的更多信息存储库.这允许其他人支持这些请求并帮助团队优先考虑这项工作.
If possible, I'd suggest opening an issue with that feature request, sharing more about your scenario on this repository. This allows other people to upvote those requests and helps the team prioritize this work.
这篇关于在我的 Azure Function 中引用 c# 类库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在我的 Azure Function 中引用 c# 类库


- C# 中多线程网络服务器的模式 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- 输入按键事件处理程序 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01