Archived Support Site

This support site is archived. You can view the old support discussions but you cannot post new discussions.

Is .net core supported yet?

dragosh's Avatar

dragosh

11 Apr, 2017 09:16 AM

Any news on this one?

  1. Support Staff 1 Posted by rune on 12 Apr, 2017 05:08 PM

    rune's Avatar

    Hi Dragosh,

    It's not supported yet, but almost complete and will be rolled out over the next couple of weeks -- so we should have full support ready by the end of this month! I'll make sure to follow up here as soon as it's ready.

    Best,
    Rune

  2. 2 Posted by blackbone on 10 May, 2017 06:31 PM

    blackbone's Avatar

    any news on this one?

  3. Support Staff 3 Posted by rune on 11 May, 2017 09:04 PM

    rune's Avatar

    Hi,

    Unfortunately it's not enabled on the build servers just yet (although both the build servers and app servers now have the latest .NET Core SDKs and runtimes installed). We're working hard to get the build server integration implemented properly, and hope to release this early next week.

    Best,
    Rune

  4. 4 Posted by dlopez on 17 May, 2017 04:19 PM

    dlopez's Avatar

    About how far are you away from supporting .NET Core builds? I see that you mentioned that you were possibly going to have this enabled earlier this week... Did this happen, or are there still kinks to work out?

  5. 5 Posted by Zardify on 26 May, 2017 05:54 PM

    Zardify's Avatar

    Any news?! Rune please... :( We can't wait for it!

  6. Support Staff 6 Posted by rune on 30 May, 2017 03:08 AM

    rune's Avatar

    Hi folks,

    Apologies for the slow response and thanks for your patience! Quite a few blockers have held this release back for way too long, but fortunately those are addressed now and the build infrastructure is finally being updated this week to support .NET Core builds.

    You may want to wait a couple of days for a couple of minor publishing features to be deployed (along with more documentation), but in case you want to .NET Core now you can do so with a couple of tweaks; currently you'd just need to trigger the Publish target and set the PublishDir property yourself in the new VS2017/MsBuild 15 project formats. That's pretty straightforward as you can see in the example csproj file below, which uses a default ASP.NET Core (Core FX) template app created with VS017:

    <Project Sdk="Microsoft.NET.Sdk.Web" DefaultTargets="Publish">
        <PropertyGroup>
            <TargetFramework>netcoreapp1.1</TargetFramework>
            <PublishDir>$(OutDir)_PublishedWebsites\NetCoreWebApp\</PublishDir>
        </PropertyGroup>
        <PropertyGroup>
            <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
        </PropertyGroup>
        <ItemGroup>
            <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
            <PackageReference Include="Microsoft.AspNetCore" Version="1.1.2" />
            <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" />
            <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.2" />
            <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.2" />
            <PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.2" />
        </ItemGroup>
        <ItemGroup>
            <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.1" />
        </ItemGroup>
    </Project>
    

    The same configuration is required for ASP.NET Core apps that use the regular .NET Framework, which also works today! Everything else should work as usual, including NuGet restore (which also supports the new package configuration and formats) and the regular solution file conventions for the build process.

    I'll make sure to give you a heads up here when the publish operation has been integrated, but in the meantime please don't hesitate to reach out with any feedback or questions!

    Best,
    Rune

  7. 7 Posted by Vale on 05 Jun, 2017 10:52 PM

    Vale's Avatar

    Hello, is this all ready to go?

  8. 8 Posted by Kacper on 19 Jun, 2017 02:34 PM

    Kacper's Avatar

    Hi Rune,

    Any news on supporting .NET Core apps on Core Framework?
    Are the configuration variables available already?

    Best regards,
    Kacper

  9. 9 Posted by Zardify on 22 Jun, 2017 01:12 PM

    Zardify's Avatar

    I'm not going to lie, I'm a little bit disappointed about this topic. It's not the "slowness". Everyone knows this task can be huge, there's a lot of possible complications, dependencies etc. Just the communication is a little on the short side.

    Maybe if we could just get really short snippet-sized updates if there's some problem, if it's still on the way?

  10. Support Staff 10 Posted by rune on 23 Jun, 2017 08:03 AM

    rune's Avatar

    I agree that the communication has fallen short on this topic, and the project has been plagued by delays -- will post more frequent updates going forward so you can plan accordingly.

    The good news is that most of the missing pieces are now finally being deployed to the platform. Earlier today worker servers in the US region were updated to support ASP.NET Core (.NET Core and regular .NET framework) environment configuration, with configuration variables injected as environment variables. This can be useful for setting for setting the ASPNETCORE_ENVIRONMENT and other configuration you want to override. It also works "out of the box" with the Visual Studio ASP.NET Core templates as these will use environment variable configuration by default, but please don't hesitate to reach out with any questions or feedback.

    Servers in the EU region and private regions are scheduled to be updated tomorrow. Full build server support will also be over the weekend, and I'll keep you updated here as this progress. For the time being you can still just set the publish target and directory as described earlier to make sure the website is compatible with AppHarbor's current artifact directory structure.

    Best,
    Rune

  11. 11 Posted by AHRocks on 23 Jun, 2017 08:19 AM

    AHRocks's Avatar

    I have created a Web.Config parser that works within the dotnetcore configuration system and works with AppHarbor's normal configuration system. It supports dynamic reloading and binding.

    public class WebConfigSource : FileConfigurationSource
    {
        public override IConfigurationProvider Build(IConfigurationBuilder builder)
        {
            FileProvider = FileProvider ?? builder.GetFileProvider();
            return new WebConfigConfigurationProvider(this);
        }
    
        public class WebConfigConfigurationProvider : FileConfigurationProvider
        {
            public WebConfigConfigurationProvider(WebConfigSource source) : base(source) { }
    
            public override void Load(Stream stream)
            {
                Data = XDocument.Load(stream).Element("configuration").Element("appSettings")
                    .Elements("add").ToDictionary(_ => "webconfig:" + _.Attribute("key").Value.Replace(".", string.Empty), _ => _.Attribute("value").Value);
            }
        }
    }
    

    Typical use:

    public Program(IHostingEnvironment env)
    {
        var builder = new ConfigurationBuilder()
            .SetBasePath(env.ContentRootPath)
            .Add(new WebConfigSource() { Path = "web.config", Optional = false, ReloadOnChange = true, })
            .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
            .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
            .AddEnvironmentVariables();
        Configuration = builder.Build();
    }
    
    And then the simple way of getting a value (not using Bind):
    Configuration.GetSection("webconfig").GetValue<string>("RAVENHQ_CONNECTION_STRING");
    
  12. 12 Posted by AHRocks on 23 Jun, 2017 08:38 AM

    AHRocks's Avatar

    So Rune and I must have been composing our posts at the same time. I can verify that the AH updates that Rune talked about are working and the configuration values are being injected into the environment.

    So no need for the web.config ConfigurationSource/ConfigurationProvider above. Just really, really bad timing - I swear when I started the above code tonight, the environment didn't have the config values.

    AH ROCKS!

  13. 13 Posted by ignatandrei on 04 Jul, 2017 03:40 AM

    ignatandrei's Avatar

    I have copied the .csproj file for my .NET project , located at https://appharbor.com/applications/countrytaghelper.
    But the deployed shows just nginx :
    http://countrytaghelper.apphb.com/
    //Could you please help?
    - It works after I exclude published web files from the project....

Discussions are closed to public comments.
If you need help with AppHarbor please start a new discussion.

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