Search code examples
vb.netwindows-10iis-express

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.


Solution

  • 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.