Skip to content

Microsoft.Azure.Cosmos not resolved and giving error #1

@olesjo

Description

@olesjo

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Cloning application from github, and resolving nuget packages. Visual Studio cannot resolve Microsoft.Azure.Cosmos and Microsoft.Azure.Cosmos.Direct
Uninstalled with nuget manager and installed again. Visual Studio now compiles the solution, but when running application the following errormessage occurs.

Any log messages given by the failure

Error: System.AggregateException: One or more errors occurred. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Input string was not in a correct format.
at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
at Microsoft.Azure.Cosmos.CosmosResponseMessageHeaders.set__requestCharge(String value)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
at Microsoft.Azure.Cosmos.CosmosResponseMessageHeaders.<>c__DisplayClass43_0.b__3(String value)
at Microsoft.Azure.Cosmos.CosmosMessageHeadersInternal.Add(String headerName, String value)
at Microsoft.Azure.Cosmos.Extensions.ToCosmosResponseMessage(DocumentServiceResponse response, CosmosRequestMessage requestMessage)
at Microsoft.Azure.Cosmos.Handlers.TransportHandler.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Cosmos.Handlers.AbstractRetryHandler.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Cosmos.Handlers.AbstractRetryHandler.d__1.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at Microsoft.Azure.Cosmos.ExecUtils.<>c__DisplayClass3_01.b__0(Task1 task) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Cosmos.CosmosDatabases.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at CosmosGettingStartedTutorial.Program.d__9.MoveNext() in C:\Users\olesj\source\repos\cosmos\cosmos-dotnet-getting-started\CosmosGettingStartedTutorial\Program.cs:line 77
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at CosmosGettingStartedTutorial.Program.d__8.MoveNext() in C:\Users\olesj\source\repos\cosmos\cosmos-dotnet-getting-started\CosmosGettingStartedTutorial\Program.cs:line 62
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at CosmosGettingStartedTutorial.Program.

d__7.MoveNext() in C:\Users\olesj\source\repos\cosmos\cosmos-dotnet-getting-started\CosmosGettingStartedTutorial\Program.cs:line 36
---> (Inner Exception #0) System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Input string was not in a correct format.
at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
at Microsoft.Azure.Cosmos.CosmosResponseMessageHeaders.set__requestCharge(String value)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
at Microsoft.Azure.Cosmos.CosmosResponseMessageHeaders.<>c__DisplayClass43_0.b__3(String value)
at Microsoft.Azure.Cosmos.CosmosMessageHeadersInternal.Add(String headerName, String value)
at Microsoft.Azure.Cosmos.Extensions.ToCosmosResponseMessage(DocumentServiceResponse response, CosmosRequestMessage requestMessage)
at Microsoft.Azure.Cosmos.Handlers.TransportHandler.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Cosmos.Handlers.AbstractRetryHandler.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Cosmos.Handlers.AbstractRetryHandler.d__1.MoveNext()<---

End of demo, press any key to exit.

Expected/desired behavior

Application running without issue

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
Windows 10

Versions

3.0.0.1-preview

Mention any other details that might be useful


Thanks! We'll be in touch soon.

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