# .NET Core Mercury, just "Date" is not valid?

**URL:** https://talk.remobjects.com/t/net-core-mercury-just-date-is-not-valid/26267
**Category:** Water
**Tags:** mercury
**Created:** [March 1, 2022, 2:48pm UTC](https://talk.remobjects.com/t/net-core-mercury-just-date-is-not-valid/26267 "2022-03-01T14:48:44Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![avonelle](https://talk.remobjects.com/user_avatar/talk.remobjects.com/avonelle/32/13001_2.png) [@avonelle](https://talk.remobjects.com/u/avonelle)
#### Post date: [March 1, 2022, 2:48pm UTC](https://talk.remobjects.com/t/net-core-mercury-just-date-is-not-valid/26267/1 "2022-03-01T14:48:44Z")

</div>

Version 11.0.0.2717 in Mercury (I’ve only tried this in Water.)

In classic [VB.NET](http://VB.NET), I can define a property or variable as just Date instead of DateTime, and it compiles and runs fine. This also seems to work in a standard VB .NET Core project in Visual Studio.

But in my test [ASP.NET](http://ASP.NET) Core Mercury project, I am getting an Unknown Type error:  
 ![image](https://talk.remobjects.com/uploads/default/original/3X/0/c/0c1af2af9d90cb9efde9f7f10f816ef811003623.png)

Not a big deal if this isn’t going to be supported going forward, because as near as I can tell it still treats it as a DateTime. Even the tooltip in Visual Studio shows it as a DateTime.

 ![image](https://talk.remobjects.com/uploads/default/original/3X/6/8/68af30ca06f1b20e85f63d84a855bac467a54f7d.png)

But I’m thinking if I had existing [VB.NET](http://VB.NET) code I was moving to Mercury, it might be kind of a pain.

I haven’t tested any other scenarios (like standard .NET).

–Avonelle

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [March 1, 2022, 4:56pm UTC](https://talk.remobjects.com/t/net-core-mercury-just-date-is-not-valid/26267/2 "2022-03-01T16:56:25Z")

</div>

Hmm. pretty sure we had an alias to DateTime. let me check…

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [March 1, 2022, 4:57pm UTC](https://talk.remobjects.com/t/net-core-mercury-just-date-is-not-valid/26267/3 "2022-03-01T16:57:41Z")

</div>

```auto
Module Program

  Sub Main(args as String())
    writeLn("The magic happens here.")
    
    Dim X As Date
    writeLn($"x {X}")
  End Sub

End Module

```

this compiles fine for me in a new project, what could I be missing?

---

<div class="post-metadata">

### Author: ![avonelle](https://talk.remobjects.com/user_avatar/talk.remobjects.com/avonelle/32/13001_2.png) [@avonelle](https://talk.remobjects.com/u/avonelle)
#### Post date: [March 1, 2022, 5:02pm UTC](https://talk.remobjects.com/t/net-core-mercury-just-date-is-not-valid/26267/4 "2022-03-01T17:02:39Z")

</div>

> [@mh](#):
>
> this compiles fine for me in a new project, what could I be missing?

Hmmmm…You are right, works fine for me with a .NET Classic console app and a .NET Core console app.

Let me see if I can figure out what the difference is…

–Avonelle

---

<div class="post-metadata">

### Author: ![avonelle](https://talk.remobjects.com/user_avatar/talk.remobjects.com/avonelle/32/13001_2.png) [@avonelle](https://talk.remobjects.com/u/avonelle)
#### Post date: [March 1, 2022, 5:11pm UTC](https://talk.remobjects.com/t/net-core-mercury-just-date-is-not-valid/26267/5 "2022-03-01T17:11:35Z")

</div>

I think it is something specific to [ASP.NET](http://ASP.NET) Core projects. Adding a simple variable declaration of Date fails for both the “[ASP.NET](http://ASP.NET) Core MVC/Razor-based Web application” and “[ASP.NET](http://ASP.NET) Core Empty Web Application” project templates. But it compiled fine for a classic Windows app.

FYI: I also see that “Date” doesn’t show up in the CC list in my test projects for [ASP.NET](http://ASP.NET) Core but it does in the classic Windows app.

–Avonelle

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [March 1, 2022, 7:12pm UTC](https://talk.remobjects.com/t/net-core-mercury-just-date-is-not-valid/26267/6 "2022-03-01T19:12:10Z")

</div>

Hmm, it looks like the template misses a reference to Mercury.dll. Adding that fixes it. I’ll fix the templates.

---

<div class="post-metadata">

### Author: ![avonelle](https://talk.remobjects.com/user_avatar/talk.remobjects.com/avonelle/32/13001_2.png) [@avonelle](https://talk.remobjects.com/u/avonelle)
#### Post date: [March 1, 2022, 7:39pm UTC](https://talk.remobjects.com/t/net-core-mercury-just-date-is-not-valid/26267/7 "2022-03-01T19:39:38Z")

</div>

Excellent. Thanks!

–Avonelle
