Skip to content

Restore failed when project.json has commented out sections #691

@mkosieradzki

Description

@mkosieradzki

In general project.json can contain comments and works correctly. But in some cases when opening solution in Visual Studio 2015 RC there is following error:

IMO: comments in project.json should be allowed or disallowed - not something between :). (In this specific case I use // - style comments.

Restore failed
Illegal character '/' (Unicode hexadecimal 002F).
Microsoft .NET Development Utility CLR-x86-1.0.0-beta5-12087

Restoring packages for [MyPath]\project.json

[MyPath]\project.json(19,5): Error: Microsoft.Framework.Runtime.FileFormatException: Illegal character '/' (Unicode hexadecimal 002F). ---> Microsoft.Framework.Runtime.Json.JsonDeserializerException: Illegal character '/' (Unicode hexadecimal 002F).
at Microsoft.Framework.Runtime.Json.JsonBuffer.Read()
at Microsoft.Framework.Runtime.Json.JsonDeserializer.DeserializeObject(JsonToken head, JsonBuffer buffer)
at Microsoft.Framework.Runtime.Json.JsonDeserializer.DeserializeInternal(JsonToken next, JsonBuffer buffer)
at Microsoft.Framework.Runtime.Json.JsonDeserializer.DeserializeObject(JsonToken head, JsonBuffer buffer)
at Microsoft.Framework.Runtime.Json.JsonDeserializer.DeserializeInternal(JsonToken next, JsonBuffer buffer)
at Microsoft.Framework.Runtime.Json.JsonDeserializer.Deserialize(TextReader reader)
at Microsoft.Framework.Runtime.Project.GetProjectFromStream(Stream stream, String projectName, String projectPath, ICollection1 diagnostics) at Microsoft.Framework.Runtime.Project.TryGetProject(String path, Project& project, ICollection1 diagnostics)
--- End of inner exception stack trace ---
at Microsoft.Framework.Runtime.Project.TryGetProject(String path, Project& project, ICollection`1 diagnostics)
at Microsoft.Framework.PackageManager.RestoreCommand.d__77.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__DisplayClass76_0.<b__1>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.d__76.MoveNext()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions