我有一个.NET 4.5项目,我正在安装一个包含大量依赖项的库(例如:http://www.nuget.org/packages/Microsoft.WindowsAzure.Management.Libraries/0.9.6-preview)
这些依赖项中的许多都在包的单独文件夹中包含net40和net45二进制文件。但是正如您在下面看到的那样,即使包中有net45版本,它们也会引用net40和net35。 (它也引用了一些net45)
是什么导致这种情况?
<Reference Include="Microsoft.Data.Edm">
<HintPath>..\..\..\..\external\Nuget\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.OData">
<HintPath>..\..\..\..\external\Nuget\Microsoft.Data.OData.5.6.0\lib\net40\Microsoft.Data.OData.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Common">
<HintPath>..\..\..\..\external\Nuget\Microsoft.WindowsAzure.Common.0.9.8-preview\lib\net45\Microsoft.WindowsAzure.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Common.NetFramework">
<HintPath>..\..\..\..\external\Nuget\Microsoft.WindowsAzure.Common.0.9.8-preview\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Configuration">
<HintPath>..\..\..\..\external\Nuget\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\external\Nuget\Microsoft.WindowsAzure.Management.0.9.5-preview\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Compute">
<HintPath>..\..\..\..\external\Nuget\Microsoft.WindowsAzure.Management.Compute.0.9.9-preview\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Monitoring">
<HintPath>..\..\..\..\external\Nuget\Microsoft.WindowsAzure.Management.Monitoring.0.9.2-preview\lib\net40\Microsoft.WindowsAzure.Management.Monitoring.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Scheduler">
<HintPath>..\..\..\..\external\Nuget\Microsoft.WindowsAzure.Management.Scheduler.0.9.8-preview\lib\net40\Microsoft.WindowsAzure.Management.Scheduler.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.ServiceBus">
<HintPath>..\..\..\..\external\Nuget\Microsoft.WindowsAzure.Management.ServiceBus.0.9.3-preview\lib\net40\Microsoft.WindowsAzure.Management.ServiceBus.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Sql">
<HintPath>..\..\..\..\external\Nuget\Microsoft.WindowsAzure.Management.Sql.0.9.4-preview\lib\net40\Microsoft.WindowsAzure.Management.Sql.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Storage">
<HintPath>..\..\..\..\external\Nuget\Microsoft.WindowsAzure.Management.Storage.0.9.3-preview\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.VirtualNetworks">
<HintPath>..\..\..\..\external\Nuget\Microsoft.WindowsAzure.Management.VirtualNetworks.0.9.3-preview\lib\net40\Microsoft.WindowsAzure.Management.VirtualNetworks.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.WebSites">
<HintPath>..\..\..\..\external\Nuget\Microsoft.WindowsAzure.Management.WebSites.0.9.3-preview\lib\net40\Microsoft.WindowsAzure.Management.WebSites.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Storage">
<HintPath>..\..\..\..\external\Nuget\WindowsAzure.Storage.3.0.3.0\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
答案 0 :(得分:0)
仔细检查您的项目是否真的是.NET 4.5项目。您可以尝试卸载并重新安装软件包以修复它们。或者做我做的事情并修改csproj。