question

Kev Riley avatar image
Kev Riley asked

blank hostname for connections using .Net Core

Has anyone noticed (or hopefully fixed with a workaround) that connections to SQL from applications developed in .Net Core using the 'Core .Net SQL Data Provider' always have a blank hostname? I've noticed this when using: - DMVs such as sys.sessions, as by implication tools such as sp_whoisactive, sp_blitzwho etc - Profiler (yes I still use it) - Extended Events At first I thought it was due to how the devs had constructed their connection strings (as you can manipulate this kind of data there), but on review they seemed 'normal'. Is it due to the fact the .Net Core is platform agnostic? Is a server name a 'windows' thing? I do still see an IP address in sys.connections.
connection-string.net-core
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Usman Butt avatar image
Usman Butt answered
Very interesting indeed. Which version of .NET Core it is? There was an issue with the previous .NET Core version as pointed out [here][1] (Yes, I was helped out by the dev team :) ). We are developing new application based on .NET Core 2, but that is giving us the correct information about the HostName. [1]: https://github.com/dotnet/corefx/issues/12627
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kev Riley avatar image Kev Riley ♦♦ commented ·
Excellent! Thank you @Usman this would explain it!
0 Likes 0 ·
Usman Butt avatar image Usman Butt commented ·
BTW, now I owe the dev a cup of coffee at Gloria Jeans, but this is how it goes is in our environment. I had exploited the same quite a few times myself. :) But I am really glad, it helped. Cheers.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.