.NET Core Connection String Transformation

Vale's Avatar

Vale

06 Jun, 2017 03:03 PM

I have been able to successfully build and deploy a sample .NET core application using the publishing instructions in this post - https://support.appharbor.com/discussions/problems/90387-is-net-cor.... However, I was never able to get my database working properly. If I add my AppHarbor sequelizer connection string to my application manually then everything works fine. So it would seem the transformation is not taking place or not taking place correctly. I have added the alias "DefaultConnection" as seen in my connection string below to the configuration variables but no luck. Is this known to not be working currently or is there something else I need to do to my publishing configuration?

"ConnectionStrings": { "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=AppHarborTest;Trusted_Connection=True;MultipleActiveResultSets=true" }

  1. Support Staff 1 Posted by rune on 08 Jun, 2017 11:51 PM

    rune's Avatar

    Hi,

    So the part that's missing is specifically related to the configuration -- it'll be injected into the application's environment variables after a platform update scheduled for early next week.

    However, if you're using ASP.NET Core on top of desktop .NET framework (e.g. .NET 4.7 or earlier) you may want consider using the old ConfigurationManager to inject the regular appSettings into your app. These will continue to be injected in the web.config file, and any other config files, so might be useful if you're migrating several projects with for instance a mix of web and background workers. You'd need a custom configuration provider for it and there's a good example here.

    If you're using ASP.NET Core on top of the .NET Core framework it'd probably make more sense to wait until the update next week -- I'll post an update to this discussion as soon as we do which I can see you're also subscribed to updates to already!

    Best,
    Rune

  2. rune closed this discussion on 08 Jun, 2017 11:51 PM.

  3. Vale R. Trujillo re-opened this discussion on 09 Jun, 2017 01:24 AM

  4. 2 Posted by Vale R. Trujill... on 09 Jun, 2017 01:24 AM

    Vale R. Trujillo's Avatar

    Sounds good! Thank you very much Rune!

  5. Support Staff 3 Posted by rune on 10 Jun, 2017 12:36 AM

    rune's Avatar

    Of course, happy to help!

    Have a great weekend,
    Rune

  6. rune closed this discussion on 10 Jun, 2017 12:36 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac