相关疑难解决方法(0)

无法在Visual Studio 2015中构建,因为找不到"Microsoft.Build.Tasks.v14.0.dll"

尝试在Visual Studio 2015中构建时,缺少以下文件?该项目以前是在VS2013中构建的.

严重级代码说明项目文件行错误无法从程序集"C:\ Program Files(x86)\ MSBuild\14.0\bin\Microsoft.Build.Tasks.v14.0.dll"加载任务工厂"CodeTaskFactory".无法加载文件或程序集'file:/// C:\ Program Files(x86)\ MSBuild\14.0\bin\Microsoft.Build.Tasks.v14.0.dll'或其依赖项之一.该系统找不到指定的文件.

c# msbuild visual-studio-2015

54
推荐指数
5
解决办法
4万
查看次数

在visual studio online tfs build上缺少Microsoft.Build.Tasks.v4.0.dll

我正在尝试使用visual studio在线构建我的项目.

我收到以下错误.

C:\a\src\.nuget\nuget.targets (71): The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Build.Tasks.v4.0.dll". Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Build.Tasks.v4.0.dll' or one of its dependencies. The system cannot find the file specified.
Run Code Online (Sandbox Code Playgroud)

这来自我的解决方案中的nuget.targets文件.

  <UsingTask TaskName="SetEnvironmentVariable" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
        <ParameterGroup>
            <EnvKey ParameterType="System.String" Required="true" />
            <EnvValue ParameterType="System.String" Required="true" />
        </ParameterGroup>
        <Task>
            <Using Namespace="System" />
            <Code Type="Fragment" Language="cs">
                <![CDATA[
                try {
                    Environment.SetEnvironmentVariable(EnvKey, EnvValue, System.EnvironmentVariableTarget.Process);
                }
                catch  {
                }
            ]]>
            </Code>
        </Task>
    </UsingTask>
Run Code Online (Sandbox Code Playgroud)

我已将nuget.exe更新为最新版本,并且未在nuget.targets中更改任何内容.

tfs azure-devops

9
推荐指数
1
解决办法
6873
查看次数

.NET 4.5.1 Visual Studio 2012中的预览支持

首先让我为错误添加一些上下文,我已经安装了.NET 4.5.1预览版,我在VS 2012中注意到的第一件事是.NET 4.5.1没有列在可用的框架中.我不确定这是否是正确的行为,因为这只是升级到4.5所以我想VS 2012应该列出它.

而且,现在如果我安装了VS 2013预览,升级我的项目.NET 4.5.1和VS开解2012新.NET版本又出现了,所以我不知道这是一个错误的VS 2012或不?好的,现在我在VS 2012中有.NET 4.5.1,当我尝试构建项目时,我收到以下错误

Error   3   The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Build.Tasks.v4.0.dll". Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Build.Tasks.v4.0.dll' or one of its dependencies. The system cannot find the file specified.  D:\Projects\MyProject\Master\Source\.nuget\nuget.targets    71  9   MyProject.Core.Modules
Run Code Online (Sandbox Code Playgroud)

NuGet.targets报告了一行

<SetEnvironmentVariable EnvKey="VisualStudioVersion"
EnvValue="$(VisualStudioVersion)" Condition=" '$(VisualStudioVersion)'
!= '' AND '$(OS)' == 'Windows_NT' " />
Run Code Online (Sandbox Code Playgroud)

在我看来,由于某些原因VS 2012无法解决路径或程序集,所以我不确定我是否应该在NuGet.targets中修复某些东西,或者它是一个Visual Studio的东西,任何想法?

谢谢

.net nuget nuget-package visual-studio-2012 visual-studio-2013

8
推荐指数
3
解决办法
9787
查看次数