cake-build/example

build.ps1: Could not load file or assembly Microsoft.Build

Closed this issue · 4 comments

This has now happened on two different PCs, both running Windows 10 with VS 2017 installed.

Also:
NuGet Version: 3.5.0.1938
MsBuild Version: 4.6.1586.0

Preparing to run build script...
Running build script...
Analyzing build script...
Processing build script...
Installing tools...
Downloading and installing Roslyn...
Installing packages (using https://packages.nuget.org/api/v2)...
Copying files...
Copying Roslyn.Compilers.CSharp.dll...
Copying Roslyn.Compilers.dll...
Deleting installation directory...
Compiling build script...

========================================
Clean
========================================
Executing task: Clean
Creating directory C:/Users/rickysmith/Documents/Projects/cake-example/src/Example/bin/Release
Finished executing task: Clean

========================================
Restore-NuGet-Packages
========================================
Executing task: Restore-NuGet-Packages
Failed to load msbuild Toolset
  Could not load file or assembly 'Microsoft.Build, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot f
ind the file specified.
An error occurred when executing task 'Restore-NuGet-Packages'.
Error: NuGet: Process returned an error (exit code 1).

Faced the same problem. There is a solution?

Do you get the same issue with latest stable version of Nuget (at this v4.1.0)?
It can be downloaded at https://dist.nuget.org/index.html

I decided to update. I get this error:

PS D:\Projects\ODB> .\build.ps1 -Verbosity Diagnostic
Preparing to run build script...
Running build script...
Module directory does not exist.
Analyzing build script...
Analyzing D:/Projects/ODB/build.cake...
Processing build script...
Installing tools...
Package NUnit.ConsoleRunner has already been installed.
Installing addins...
Package MagicChunks has already been installed.
The addin MagicChunks will reference MagicChunks.Cake.dll.
The addin MagicChunks will reference MagicChunks.dll.
Creating script session...
Downloading and installing Roslyn...
Installing packages (using https://packages.nuget.org/api/v2)...
Error: System.Net.WebException: The underlying connection is closed: An unexpected transmission error occurred. ---> System.IO.IOException: Authentication is not passed because of the closure of the transport stream by the remote party.
в System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
в System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
в System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
в System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
в System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
в System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
в System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
в System.Net.ConnectStream.WriteHeaders(Boolean async)
--- Конец трассировки внутреннего стека исключений ---
в System.Net.HttpWebRequest.GetResponse()
в NuGet.RequestHelper.GetResponse()
в NuGet.RedirectedHttpClient.GetResponseUri(HttpClient client)
в NuGet.RedirectedHttpClient.EnsureClient()
в System.Lazy1.CreateValue() в System.Lazy1.LazyInitValue()
в NuGet.MemoryCache.GetOrAdd[T](Object cacheKey, Func1 factory, TimeSpan expiration, Boolean absoluteExpiration) в NuGet.RedirectedHttpClient.get_CachedClient() в NuGet.RedirectedHttpClient.get_Uri() в NuGet.DataServicePackageRepository.get_Context() в NuGet.DataServicePackageRepository.FindPackage(String packageId, SemanticVersion version) в NuGet.PackageRepositoryExtensions.FindPackage(IPackageRepository repository, String packageId, SemanticVersion version, IPackageConstraintProvider constraintProvider, Boolean allowPrereleaseVersions, Boolean allowUnlisted) в NuGet.PackageRepositoryHelper.ResolvePackage(IPackageRepository sourceRepository, IPackageRepository localRepository, IPackageConstraintProvider constraintProvider, String packageId, SemanticVersion version, Boolean allowPrereleaseVersions) в NuGet.PackageManager.InstallPackage(String packageId, SemanticVersion version, Boolean ignoreDependencies, Boolean allowPrereleaseVersions) в Cake.Scripting.Roslyn.Stable.RoslynScriptSessionFactory.Install(DirectoryPath root) в Cake.Scripting.Roslyn.Stable.RoslynScriptSessionFactory.CreateSession(IScriptHost host) в Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath, IDictionary2 arguments)
в Cake.Commands.BuildCommand.Execute(CakeOptions options)
в Cake.CakeApplication.Run(CakeOptions options)
в Cake.Program.Main()

Closing this as "out-of-date" - sorry for not replying earlier.
Feel free to reach out via discussion if the problem persists.