![](/img/trans.png)
[英]How to get the path of the dll within the function inside the dll in C#?
[英]Dot net dll path when compiling c# code inside an azure function
我在Azure函數中使用什么路徑引用框架dll?
使用CSharpCompilation類在ac#應用程序內編譯c#代碼時,我指定對框架dll的元數據引用,以提供完整路徑,如下面的示例,其中路徑為“ C:\\ Program Files \\ dotnet \\ shared \\ Microsoft.NETCore.App \\ 2.2 .4 \\“。 我想將此功能移植到azure函數,並且不確定我必須使用什么路徑來引用框架dll,或者如果在azure函數中甚至可能這樣做?
IReadOnlyCollection<MetadataReference> references = new MetadataReference[] {
MetadataReference.CreateFromFile(@"C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.2.4\netstandard.dll"),
MetadataReference.CreateFromFile(@"C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.2.4\mscorlib.dll"),
};
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.