2017-03-23 6 views
0

Guten Tag Alles, ich arbeite an einer ASP.NET-Anwendung Kernvorlage mit .Net-Framework. Ich muss meine Anwendung in Cloud Foundry veröffentlichen.Aber leider stürzt meine Anwendung ab und ist nicht in der Lage, in der Cloud Foundry-Umgebung zu implementieren.Alle, wenn über die gleiche Situation kommen und das Problem gelöst, bitte sugger.Thanks. Ich habe einige Websites durchgesehen und versucht, wie unten beschrieben, noch nicht zu deployen. Ich verwende das .NetCoreBuild-Paket für die Bereitstellung..Net Framework + Core Template-Anwendung in der Cloud bereitstellen Foundary

Program.cs:- 

public static void Main(string[] args) 
     { 
      var config = new ConfigurationBuilder() 
       .AddCommandLine(args) 
       .Build(); 
      var host = new WebHostBuilder() 
       .UseKestrel() 
       //.UseContentRoot(Directory.GetCurrentDirectory()) 
       //.UseIISIntegration() 
       .UseConfiguration(config) 
         .UseStartup<Startup>() 
         .Build(); 

      host.Run(); 
     } 
Project.Json:- 

{ 
    "buildOptions": { 
    "copyToOutput": { 
     "include": [ 
     "wwwroot", 
     "**/*.cshtml", 
     "appsettings.json", 
     "web.config" 
     ], 
     "exclude": [ 
     "bin", 
     "obj" 
     ] 
    }, 
    "debugType": "portable", 
    "emitEntryPoint": true, 
    "preserveCompilationContext": true 
    }, 

    "publishOptions": { 
    "include": [ 
     "wwwroot", 
     "**/*.cshtml", 
     "appsettings.json", 
     "web.config" 
    ], 
    "exclude": [ 
     "bin", 
     "obj" 
    ] 
    }, 

    "dependencies": { 
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.2", 
    "Microsoft.AspNetCore.Routing": "1.0.2", 
    "Microsoft.AspNetCore.Mvc": "1.0.2", 
    "Microsoft.AspNetCore.Razor.Tools": { 
     "version": "1.0.0-preview4-final", 
     "type": "build" 
    }, 
    "Microsoft.AspNetCore.StaticFiles": "1.0.1", 
    "Microsoft.Extensions.Configuration.CommandLine": "1.0.1", 
    "Microsoft.Extensions.Configuration.Json": "1.0.1", 
    "Microsoft.Extensions.Logging": "1.0.1", 
    "Microsoft.Extensions.Logging.Console": "1.0.1", 
    "Microsoft.Extensions.Logging.Debug": "1.0.1", 
    "Microsoft.NETCore.App": { 
     "type": "platform", 
     "version": "1.0.3" 
    }, 
    "Microsoft.AspNetCore.Diagnostics": "1.0.1", 
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.1", 
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", 
    "Microsoft.ApplicationInsights.AspNetCore": "1.0.0", 
    "Microsoft.Extensions.Configuration": "1.1.0" 
    }, 

    "frameworks": { 
    "net461": { } 
}, 

    "runtimeOptions": { 
    "configProperties": { 
     "System.GC.Server": true 
    } 
    }, 

    "scripts": { 
    "precompile": [ "dotnet bundle" ] 
    }, 

    "tools": { 
    "BundlerMinifier.Core": "2.2.301", 
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview4-final" 
    }, 

    "version": "1.0.3" 
} 

Antwort

1

In Ihrem project.json Datei, die Sie spezifizieren:

"frameworks": { 
    "net461": { } 
} 

Die net461 zu .NET Framework verweist 4.6.1, aber die .NET-Core buildpack unterstützt nur .NET-Core. Verwenden Sie netcoreapp1.0 statt net461, etwa so:

"frameworks": { 
    "netcoreapp1.0": { } 
} 
+0

Dank Daniel für Ihre Antwort, aber ich bin mit .NET Framework mit Kern template.In diesem Szenario freundlich vorschlagen, welches Pack bauen soll ich verwenden. – user1328277

Verwandte Themen