Skip to content
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

Connecting to an database on mac... #3274

Closed
hahmed opened this issue Sep 30, 2015 · 10 comments
Closed

Connecting to an database on mac... #3274

hahmed opened this issue Sep 30, 2015 · 10 comments

Comments

@hahmed
Copy link

hahmed commented Sep 30, 2015

Can you connect to a database using EF on vnext just yet? As I am seeing some errors which I cannot seem to find any answer for.

If i persist security info (connection string) I get an error message:

error   : [Microsoft.AspNet.Diagnostics.ErrorHandlerMiddleware] An unhandled exception has occurred: Persisting security info is not yet implemented
System.NotImplementedException: Persisting security info is not yet implemented
  at System.Data.SqlClient.SqlConnectionStringBuilder.SetValue (System.String key, System.Object value) [0x00000] in <filename unknown>:0 
  at System.Data.SqlClient.SqlConnectionStringBuilder.set_Item (System.String keyword, System.Object value) [0x00000] in <filename unknown>:0 
  at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString (System.String value) [0x00000] in <filename unknown>:0 
  at System.Data.SqlClient.SqlConnectionStringBuilder..ctor (System.String connectionString) [0x00000] in <filename unknown>:0 
  at Microsoft.Data.Entity.SqlServer.SqlServerConnection.get_IsMultipleActiveResultSetsEnabled () [0x00000] in <filename unknown>:0 

[Full stack trace removed]

If I try and connect to an azure sql database I get another error message:

error   : [Microsoft.AspNet.Diagnostics.ErrorHandlerMiddleware] An unhandled exception has occurred: SSL encryption for data sent between client and server is not implemented.
System.NotImplementedException: SSL encryption for data sent between client and server is not implemented.

Thanks

@ErikEJ
Copy link
Contributor

ErikEJ commented Sep 30, 2015

Could you share your connection string? I think you have some unsupported settings in it.

@hahmed
Copy link
Author

hahmed commented Sep 30, 2015

@ErikEJ

I just simply copied it directly from azure portal...

This is the connection string for the azure portal sql database, do you want the connection string to my rackspace db too?

Server=tcp:test-dbs.database.windows.net,1433;Database=dbname;User ID=user;Password={your_password_here};Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;

I am setting it like so:

optionsBuilder.UseSqlServer($"Server=tcp... etc");

@lucamorelli
Copy link

on mac? seems to me that the mono implementation of the sql driver does not suports encryption. I suppose we have to wait that for the a coreClr implementation of that driver

@hahmed
Copy link
Author

hahmed commented Sep 30, 2015

@lucamorelli yep... on a mac.

Ok cool, is there any idea when that will be shipped?

@lucamorelli
Copy link

I don't know if this is fixed for beta 8, anyway I suppose that you can check in the documentation site http://ef.readthedocs.org/en/latest/providers/index.html and see if they update the note

@rowanmiller
Copy link
Contributor

Correct, CoreCLR will be the ultimate solution to this since there are some significant limitations on the Mono SQL Client implementation.

@danroth27 do we have a public schedule on the availability of CoreCLR on Mac?

@danroth27
Copy link
Member

@saurabh500

The .NET Core schedule is aligned to the ASP.NET 5 roadmap: https://github.com/aspnet/home/wiki/roadmap. The xplat SqlClient isn't quite ready for beta8, but it should be available in Nov.

@natemcmaster
Copy link
Contributor

@hahmed can we close this issue on EF? As Mono's implementation of SqlClient is very outdated and not likely to be updated, there isn't much we can do in EF to alleviate this problem.

@hahmed
Copy link
Author

hahmed commented Sep 30, 2015

@natemcmaster closed this issue. Subscribed to the referenced issue so I can track when this will be fixed.

I am creating my team admin site using vnext and ef. I have managed to connect to my rackspace database I needed to remove the setting Persist Security info to make that work. Hopefully this will be done some time soon.

I know this is off topic, but do migrations work the same way as before? As in if I never want migrations to run, do I need to tell the migrations not to run like in EF6? How about deploying to azure, I never want my migrations to run either. Has this been documented somewhere that I can get hold off?

@natemcmaster
Copy link
Contributor

@hahmed Migrations is an opt-in feature. They do not run automagically. So if you are not sure if migrations run or not, you probably aren't.

Has this been documented somewhere that I can get hold off?

Not yet, docs are in progress. https://github.com/aspnet/EntityFramework.docs is all we have.

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants