Skip to content

v3.0.1, ArgumentNullException if Connection String is missing #240

@dstj

Description

@dstj

(Reboot of #79)

In Profiler v3.0.1, when starting without a Connection String, throws a ArgumentNullException.

OneTimeSetUp: SetUp : System.ArgumentNullException : Value cannot be null. (Parameter 'connectionString')
--SetUp
   at Microsoft.ApplicationInsights.Profiler.Shared.Services.ServiceProfilerContext..ctor(ConnectionString connectionString, IEndpointProvider endpointProvider, ILogger`1 logger)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
   at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
...

This happens even if I have in my appsettings.json:

	"ServiceProfiler": {
		"IsDisabled": true
	},

In 2.7.3, it only used to log an error: Profiler Instrumentation Key is invalid.

This is quite annoying because during Development, I do not have a Connection String, nor do I want one.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions