【发布时间】:2019-04-23 21:01:31
【问题描述】:
编辑:由于无法通过使用提供的答案解决问题。我接受了切换到 .NetStandard 的建议,这就是答案被接受的原因。
我收到此错误,但无法解决:
您的项目未引用“.NETPortable,Version=v4.6,Profile=Profile44”框架。在项目文件的“TargetFrameworks”属性中添加对“.NETPortable,Version=v4.6,Profile=Profile44”的引用,然后重新运行 NuGet 恢复。
我的 .csproj 看起来像这样:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<MinimumVisualStudioVersion>10.0</MinimumVisualStudioVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1D5637E9-E724-4943-A535-5B61D0C1C4BC}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>xxx.xxx.xxx/RootNamespace>
<AssemblyName>xxx.xxx.xxx</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TargetFrameworkProfile>Profile44</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
既然已经有了
<TargetFrameworkProfile>Profile44</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
在里面我不知道该怎么办。
我恢复了 NuGet,但没有要恢复的内容。
我不知道我可以改变什么来解决这个问题。
提前致谢。
【问题讨论】:
-
您是否尝试通过右键单击项目下的引用然后
Add Reference...来添加引用? -
我不知道该添加哪一个即使在我下载的程序集中也没有这个名称的dll
标签: c# visual-studio build portable-class-library