ASP.NET VNEXT DNU Restore error - asp.net

Every time I try to perform a package restore in visual studio, I get the error below. I also get the same error when using the samples from github with the command prompt i.e (
C:\Users\xxxxxx\Documents\GitHub\aspnet\samples\1.0.0-beta4\HelloMvc dnu restore)
I set my execution environment to use the following dnx -dnvm use 1.0.0-beta4 -r clr -arch x86 -p
I have tried deleting the packages from .dnx/packages and have tried replacing the runtimes, but nothing seems to work.
This may be a result of installing visual studio 2015 RC over the CTP 6; however, I have tried uninstalling and re-installing visual studio multiple times.
Any help would be appreciated.
Writing lock file C:\Users\xxxxxx\Documents\Visual Studio 2015\Projects\test3\src\test3\project.lock.json
----------
System.MissingMethodException: **Method not found: 'Newtonsoft.Json.Linq.JValue Newtonsoft.Json.Linq.JValue.CreateNull()'.**
at Microsoft.Framework.Runtime.DependencyManagement.LockFileFormat.WriteString(String item)
at Microsoft.Framework.Runtime.DependencyManagement.LockFileFormat.WriteArray[TItem](IEnumerable`1 items, Func`2 writeItem)
at Microsoft.Framework.Runtime.DependencyManagement.LockFileFormat.WriteProjectFileDependencyGroup(ProjectFileDependencyGroup frameworkInfo)
at Microsoft.Framework.Runtime.DependencyManagement.LockFileFormat.WriteObject[TItem](IEnumerable`1 items, Func`2 writeItem)
at Microsoft.Framework.Runtime.DependencyManagement.LockFileFormat.WriteLockFile(LockFile lockFile)
at Microsoft.Framework.Runtime.DependencyManagement.LockFileFormat.Write(Stream stream, LockFile lockFile)
at Microsoft.Framework.Runtime.DependencyManagement.LockFileFormat.Write(String filePath, LockFile lockFile)
at Microsoft.Framework.PackageManager.RestoreCommand.WriteLockFile(String projectLockFilePath, Project project, List`1 graphItems, PackageRepository repository, IEnumerable`1 frameworks)
at Microsoft.Framework.PackageManager.RestoreCommand.<RestoreForProject>d__74.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Framework.PackageManager.RestoreCommand.<>c__DisplayClass73_0.<<ExecuteCommand>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Framework.PackageManager.RestoreCommand.<ExecuteCommand>d__73.MoveNext()
----------
Restore failed
Method not found: 'Newtonsoft.Json.Linq.JValue Newtonsoft.Json.Linq.JValue.CreateNull()'.

Found the issue: Newtonsoft.json.dll verion 6.0.3 does not contain the CreateNull method. Added version 6.0.8 to the GAC and everything worked.

Related

Error with publishing my ASP.net website

solved.
My solution: Build -> clean -> rebuild
I got host for my website and now I'm trying to upload the website's files via VS2017 using 'publish' feature of VS. I setup the connection with the host properly (Validate connection went successful..). But as the VS tries to upload my files it says:
Unable to add 'Content/homePage.css' to the Web site. Unable to parse server response to PASV command.
This error message is shown for each file in my website. The above is just an example to such message. I'm using FTP publish method. My host is 000webhost
diagnostic log:
15/07/2018 08:56:08
System.AggregateException: One or more errors occurred. ---> System.Exception: Publish failed due to build errors. Check the error list for more details.
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Web.Publish.PublishService.VsWebProjectPublish.<>c__DisplayClass40_0.<PublishAsync>b__2()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ApplicationCapabilities.Publish.ViewModel.ProfileSelectorViewModel.<RunPublishTaskAsync>d__88.MoveNext()
---> (Inner Exception #0) System.Exception: Publish failed due to build errors. Check the error list for more details.<---
===================

VSTS Build agent issues in step 'Publish Artifact: drop'

We are seeing inconsistent failures in our vsts builds. These showed up out of nowhere.
The agent runs on-prem. When using the hosted build agent we don't see any issues.
On consecutive builds, a lot of retries are needed. Usually the build fails, but sometimes it doesn't.
Multiple build definitions in different projects are affected
We are trying to find the root cause, any help diagnosing this issue would be much appreciated!
Here's the relevant version information:
[2017-04-25 07:25:58Z INFO AgentProcess] Agent is built for Windows - win7-x64.
[2017-04-25 07:25:58Z INFO AgentProcess] RuntimeInformation: Microsoft Windows 6.3.9600 .
[2017-04-25 07:25:58Z INFO AgentProcess] Version: 2.111.1
Here is an excerpt from the logs:
017-04-25T07:28:14.1561247Z ##[section]Starting: Publish Artifact: drop
2017-04-25T07:28:14.1561247Z ==============================================================================
2017-04-25T07:28:14.1561247Z Task : Publish Build Artifacts
2017-04-25T07:28:14.1561247Z Description : Publish Build artifacts to the server or a file share
2017-04-25T07:28:14.1561247Z Version : 1.0.40
2017-04-25T07:28:14.1561247Z Author : Microsoft Corporation
2017-04-25T07:28:14.1561247Z Help : More Information
2017-04-25T07:28:14.1561247Z ==============================================================================
2017-04-25T07:28:15.0779877Z ##[section]Async Command Start: Upload Artifact
2017-04-25T07:28:15.0779877Z Uploading 8 files
2017-04-25T07:28:20.1111153Z Total file: 8 ---- Processed file: 7 (87%)
2017-04-25T07:28:30.2611071Z Total file: 8 ---- Processed file: 7 (87%)
2017-04-25T07:28:35.3611234Z Fail to upload 'E:\Build\agents\scully_work\4\a\Project.Name.Web.zip' due to 'An error occurred while sending the request.'.
2017-04-25T07:28:35.3611234Z System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: The connection with the server was terminated abnormally
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.Http.WinHttpHandler.d__101.MoveNext()
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.Http.HttpClient.d__58.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__45.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.FileContainer.Client.FileContainerHttpClient.d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at Microsoft.VisualStudio.Services.FileContainer.Client.FileContainerHttpClient.<UploadFileAsync>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.Worker.Build.FileContainerServer.<UploadAsync>d__14.MoveNext()
2017-04-25T07:28:35.3611234Z Detail upload trace for file that fail to upload: drop/Project.Name.Web.zip
2017-04-25T07:28:35.3611234Z Begin chunking upload file 'drop/Project.Name.Web.zip', chunk size '4194304 Bytes', total chunks '3'.
2017-04-25T07:28:35.3611234Z Attempt '1' for uploading chunk '1' of file 'drop/Project.Name.Web.zip'.
2017-04-25T07:28:35.3611234Z Generate new HttpRequest for uploading file 'drop/Project.Name.Web.zip', chunk '1' of '3'.
2017-04-25T07:28:35.3611234Z Start uploading file 'drop/Project.Name.Web.zip' to server, chunk '1'.
2017-04-25T07:28:35.3611234Z Chunk '1' attempt '1' of file 'drop/Project.Name.Web.zip' fail to send request to server. Error: System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: The connection with the server was terminated abnormally
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.Http.WinHttpHandler.<StartRequest>d__101.MoveNext()
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.<SendAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.Http.HttpClient.<FinishSendAsync>d__58.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.d__45.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.FileContainer.Client.FileContainerHttpClient.d__17.MoveNext().
2017-04-25T07:28:35.3611234Z Backoff 5.16 seconds before attempt '2' chunk '1'
Update:
Updated agent to latest stable, and issue still exists:
[2017-04-25 08:33:04Z INFO AgentProcess] Agent is built for Windows - win7-x64.
[2017-04-25 08:33:04Z INFO AgentProcess] RuntimeInformation: Microsoft Windows 6.3.9600 .
[2017-04-25 08:33:04Z INFO AgentProcess] Version: 2.115.0
That typically means that there's networking issues somewhere between your agent and the service where you're getting interruptions.
Starting with the 2.x agent we aggressively try to handle network conditions. We break each file into chunks (4MB), open an http stream and pipe that file chunk to the service. Each file chunk is given a long time (10 min)
We have retries per chunk and backoff retrying.
Backoff 5.16 seconds before attempt '2' chunk '1'
Then if we're still unable to upload a chunk even with retries, we put that file into a retry queue for one more pass.
So as you can see, we try really hard.
The more networking interruptions and the larger a file increase the odds. Also if upload speeds are severely slow it could fail to upload chunks in time (4mb in 10 min is a long time) but in your case, it looks like the stream / network is getting interrupted.
You should check the networking. Something is getting interrupted between your machine and the service.
One more experiment to try is a private agent on an private cloud VM (like azure). That gives you a faster cloud network on upload but also the control of a private agent (install the software you want, incremental source and packaging etc...).
Are you seeing the retries I am describing? I'm also forwarding this to our agent dev. I'll edit if there's anything else to add.

Adding migrations: System.MissingMethodException: Method not found ILibraryManager

Full error:
System.MissingMethodException: Method not found:
'Microsoft.Extensions.PlatformAbstractions.ILibraryManager
Microsoft.Extensions.PlatformAbstractions.PlatformServices.get_LibraryManager()'.
at Microsoft.Data.Entity.Commands.Program.ValidateProject(String
targetProject) at
Microsoft.Data.Entity.Commands.Program.<>c__DisplayClass2_7.b__15()
at
Microsoft.Dnx.Runtime.Common.CommandLine.CommandLineApplication.Execute(String[]
args) at Microsoft.Data.Entity.Commands.Program.Main(String[] args)
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly
assembly, String[] args, IServiceProvider serviceProvider) at
Microsoft.Dnx.ApplicationHost.Program.<>c__DisplayClass3_0.b__0()
at System.Threading.Tasks.Task`1.InnerInvoke() at
System.Threading.Tasks.Task.Execute()
Command that I try to run:
dnx ef migrations add test1
Version of EF commands:
Entity Framework Commands 7.0.0-rc1-16348
Version of dnx:
Microsoft .NET Execution environment Clr-x86-1.0.0-rc2-16595
My project currently use RC1. It all worked before.
Mostly sure the issue is the fact that you're mixing RC1 packages with RC2 runtime. Downgrade the runtime to RC1 or switch from dnx to dotnet and upgrade the packages to RC2

Unable to start ASP Application using `dnx run` on Ubuntu

I am on Ubuntu 14.04
I have installed ASP using these instructions http://docs.asp.net/en/latest/getting-started/installing-on-linux.html#installing-on-ubuntu-14-04
Running dnvm list gives me the following:
Active Version Runtime Architecture OperatingSystem Alias
------ ------- ------- ------------ --------------- -----
* 1.0.0-rc1-update1 coreclr x64 linux default
1.0.0-rc1-update1 mono linux/osx
I then tried to create an ASP application using this tutorial:
https://azure.microsoft.com/en-us/documentation/articles/web-sites-create-web-app-using-vscode/
However when I run dnx run I get the following error:
System.InvalidOperationException: IHostingBuilder.UseServer() is required for Start()
at Microsoft.AspNet.Hosting.Internal.HostingEngine.EnsureServer()
at Microsoft.AspNet.Hosting.Internal.HostingEngine.BuildApplication()
at Microsoft.AspNet.Hosting.Internal.HostingEngine.Start()
at Microsoft.AspNet.Hosting.WebApplication.Run(Type startupType, String[] args)
at ASPTutorial.Startup.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider)
at Microsoft.Dnx.ApplicationHost.Program.<>c__DisplayClass3_0.<ExecuteMain>b__0()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
A similar issue arises when I change from coreclr to mono.
UPDATE
dnx web works fine however!
The command to run with dnx is defined in the project.json in your project.
As mentioned in the comments, "run" is usually used for console applications and "web" is used for web applications. But you can write any command name you want in your project.jseon, even something like:
"commands": {
"runmyawesomeapp": "[...]"
}
And you can run it with
> dnx runmyawesomeapp
hope this helps :)

Error generating the bundle. See output window for details

I am using Visual Studio 2013 Professional Update 3 and I have installed the latest version of Web Essentials (updated 8/8/2014), but I receive this error about 90% of the time I build or save. I even check out the source js/html files and all the existing files in the bundles folder from TFS before building. Any ideas on what else I can do?
Error generating the bundle. See output window for details
System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
at EnvDTE.Properties.Item(Object index)
at MadsKristensen.EditorExtensions.ProjectHelpers.AddFileToActiveProject(String fileName, String itemType)
at MadsKristensen.EditorExtensions.BundleFilesMenu.<GenerateAsync>d__2d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MadsKristensen.EditorExtensions.BundleFilesMenu.<UpdateBundleAsync>d__22.MoveNext()
I updated Visual Studio 2013 to Update 4 and updated to the Web Essentials for Update 4 and that appeared to fix the issue.

Resources