Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DateTime.Now = Cannot provide the value: host value not found

The system I'm working on modifying uses forms authentication and creates a ticket to authenticate the user. I get the Cannot provide the value: host value not found error when attempting to retrieve the system time, IE; Dim mytime as DateTime = DateTime.Now. I'm using VB.Net with VS 2019 on windows 10 and SQL Server as the state server. What am a missing? I'm not real familiar with Windows 10, I assume it's a setting with IIS Express or Windows 10, I just don't know what/where.

like image 596
Prescott Chartier Avatar asked Oct 31 '19 15:10

Prescott Chartier


2 Answers

According to developer community site, solution is to add

Imports System.Diagnostics
<Assembly: DebuggerDisplay("{ToString}", Target:=GetType(Date))>

to your AssemblyInfo.vb (located in the MyProject folder of your Startup project)

Not the fix I wanted to see - but it works.

like image 135
Andrew MacNeill Avatar answered Nov 20 '22 09:11

Andrew MacNeill


In the Immediate Window, display the value "toString"ed, i.e. ?variablename.ToString will display it correctly. This worked for me.

like image 2
Hercules Gunter Avatar answered Nov 20 '22 10:11

Hercules Gunter