2017-07-23 70 views
0

我已經使用VS2017 Preview 3.0創建了一個Azure函數項目。奇怪的是,當我添加對System.Net.Http的引用時,項目編譯並運行良好。但是我無法在項目定義中找到對System.Net.Http的程序集引用。 enter image description here我在哪裏可以找到VS2017 Azure函數項目中的項目引用

下面是完整的csproj文件。我在這裏找不到任何參考。現在是在不同的地方定義?

<Project Sdk="Microsoft.NET.Sdk"> 
    <PropertyGroup> 
    <TargetFramework>net461</TargetFramework> 
    </PropertyGroup> 
    <ItemGroup> 
    <PackageReference Include="Microsoft.Azure.WebJobs" Version="2.1.0-beta1" /> 
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions" Version="2.1.0-beta1" /> 
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="1.0.0-beta1" /> 
    <PackageReference Include="Microsoft.Azure.WebJobs.ServiceBus" Version="2.1.0-beta1" /> 
    <PackageReference Include="Newtonsoft.Json" Version="10.0.2" /> 
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.0-alpha3" /> 
    </ItemGroup> 
    <ItemGroup> 
    <Reference Include="Microsoft.CSharp" /> 
    </ItemGroup> 
    <ItemGroup> 
    <None Update="host.json"> 
     <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 
    </None> 
    <None Update="local.settings.json"> 
     <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 
    </None> 
    </ItemGroup> 
</Project> 

我爲了解決臨到這個another problem

編輯:更新的截圖擴大的NuGet引用以及

enter image description here

+0

展開NuGet子樹。 –

+0

它不在nuget中。我將更新屏幕截圖 –

+0

WebJobs包拉入其他包中,結果是很多DLL的大型依賴樹。 – camelCase

回答

1

我發現System.Net.Http.Formatting.dll是下的NuGet包和系統.Net.Http.Formatting.dll使用System.Net.Http.dll作爲其依賴項之一。這意味着一旦我們想要使用System.Net.Http.Formatting.dll,System.Net.Http.dll也將被安裝在我們的項目中。

enter image description here

+0

就我而言,這是一個直接參考。我在System.Net.Http.dll中使用HttpClient。然而,System.Net.Http.dll的引用無法在項目文件中找到。 –

+0

由於System.Net.Http.dll安裝在您的項目中,您可以直接使用它而無需從NuGet安裝它。您也可以手動從NuGet安裝它。之後,您可以在NuGet包中看到System.Net.Http.dll。 – Amor

+0

除非您從NuGet手動安裝軟件包,否則將不會在項目文件中找到對System.Net.Http.dll的引用。 – Amor

相關問題