-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Data type 'nvarchar' is not supported in this form" after scaffolding from database #9501
Comments
The exact same bug is present in 2.0.0. An nvarchar(4000) gets scaffolded as this : entity.Property(e => e.Name)
.HasColumnName("name")
.HasColumnType("nvarchar"); Which result in the above error. nvarchar(MAX) correctly gets scaffolded to this : entity.Property(e => e.Name).HasColumnName("name"); And other lengths like 255 correctly to this : entity.Property(e => e.Name)
.HasColumnName("name")
.HasMaxLength(255); However, this was apparently adressed in issue #9188 and fixed. Any chance to see it in 2.0.1 ? |
What do you need to know more to look into this? I could pm the contextfile if that could help. |
That is not how this gets scaffolded. I have: entity.Property(e => e.AppointmentDescription) entity.Property(e => e.FormData) |
|
@ErikEJ I am running 2.1.0-preview as you can see above. Do you know what build it will be included in? |
It was only fixed 3 days ago, so it could be a single digit number of days from now |
I cant find 2.1.0-preview of the All-package or EFcore Did something change? How am one to install previews from now on? |
@bassebaba The preview (stable dev build) feed url is: https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json |
Still not fixed... Even in the version 2.1 preview |
@statler - Can you write the full version no. you used to verify? |
Verified that this is fixed in version 2.1.0-preview1-26816 |
Duplicate of #9188 |
Getting this error : My scaffolded nvarchar fields : The scaffolding seems correct (as far as I read from your comments), but still it is throwing the error. |
@fatherofwhales It is only nvarchar(max) fields that are scaffolded in an insupported syntax. Look for HasColumnType("nvarchar"). I need to replace all of those every time I scaffold with HasMaxLength(4000). |
@johanskoldekrans Fixed. The error wasn't pointing to the entity that had this HasColumnType("nvarchar") property which got me confused. Thanks. |
@fatherofwhales @johanskoldekrans - filed #9761 to improve error message. Thanks for feedback |
Hi @fschlaef, @bassebaba, @statler, @fatherofwhales. We are gathering information on the use of EF Core pre-release builds. You reported this issue shortly after the release of 2.0.0 RTM. It would be really helpful if you could let us know:
Thanks in advance for any feedback. Hopefully this will help us to increase the value of pre-release builds going forward. |
I have to host the web sites on IIS and since I couldn't get hold of the
updated server hosting for the previews I had to downgrade which is
extremely frustrating since just have fixed so many bugs since release. And
the strategy to not release those fixes as patches is something I just
can't understand.
On version 1.* when you had another documentation site you could choose the
dev-bransch and download the server hosting files. But it is still scary to
go live with preview versions for production systems.
So patch up, test and release would be something I would appreciate more.
ATB,
Johan
2017-09-12 20:09 GMT+02:00 Arthur Vickers <[email protected]>:
… Hi @fschlaef <https://github.com/fschlaef>, @bassebaba
<https://github.com/bassebaba>, @statler <https://github.com/statler>,
@fatherofwhales <https://github.com/fatherofwhales>. We are gathering
information on the use of EF Core pre-release builds. You reported this
issue shortly after the release of 2.0.0 RTM. It would be really helpful if
you could let us know:
- Did you consider testing your code against the pre-release builds?
- Was there anything blocking you from using pre-release builds?
- What do you think could make it easier for you to use pre-release
builds in the future?
Thanks in advance for any feedback. Hopefully this will help us to
increase the value of pre-release builds going forward.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9501 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AR1Ti6BAlGspDTc5Gob4dpEYnJ7h6qC4ks5shsi9gaJpZM4O9Q9u>
.
--
Johan Sköldekrans
*IT*
Telefon +46 8 463 8000 <+4684638000>
Direkt +46 8 463 8029 <+4684638029>
Mobil +0760856512
Erik Penser Bank
Apelbergsgatan 27
Box 7405
103 91 Stockholm
--
www.penser.se
Disclaimer: www.penser.se/disclaimer
|
No, I've never considered pre-release builds. I just updated to 2.0.0 when I found there was no support for System.Transactions in 1.*. I would have used the pre-release builds but by the time I updated, 2.0.0 RTM was already there. Maybe I'll use the pre-release builds in the future. Moreover, I just started with asp.net core.
|
@ajcvickers As one programmer to another, I'm sad and ashamed to give you that explanation, but that's the reality I work with. My team barely gets enough "code out of the door" by upper management expectations, we don't even get resources to test our own code good enough. |
@bassebaba @AmarDuplantier @johanskoldekrans Thanks for the feedback; much appreciated. |
@johanskoldekrans Is this nuget package a pre-release build? What are all the features updated in it? I am looking for stored procedure support - ef dbcontext scaffold not generating functions for stored procedures from database. Is it there yet? Where can I find the release notes? |
@AmarDuplantier EFCore is version 2.0 and part of the dotnetcore metapackage or as a separat package. Everything is available on GitHub since it is open source so you can view the actual code or view outstanding issues or features being worked on right here. |
In file DbContext search for "nvarchar" -> (this is bug) and change to 'nvarchar(16)' |
I have used efcore and netcore since the betas without much trouble but now I am stuck. I had a fully functional application using 1.x. After upgrading to EFCore 2.0 I now get the error below. (also tried with preview 2.1.0-preview1-26723 same error)
I have tried to scaffold in a new project and get the same result. I dont't have any reference to datatype nvarchar except for nvarchar(max), every other column has a hasmaxlength only.
I guess the nvarchar(max) is somewhat of a problem here or any ideas??!? I have three databases I scaffold, all three are updated using the new tools.
"Data type 'nvarchar' is not supported in this form. Either specify the length explicitly in the type name, for example as 'nvarchar(16)', or remove the data type and use APIs such as HasMaxLength to allow EF choose the data type."
Include a complete code listing (or project/solution) that we can run to reproduce the issue.
Further technical details
EF Core version: 2.1.0-preview1-26723
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Win 10 build 16251
IDE: Visual Studio 15.3.1
The text was updated successfully, but these errors were encountered: