2016-09-22 4 views
0

私は、アプリケーションがアイデンティティ、IdentityServer4、Entity Frameworkのコアなど を使用し、それはいくつかのNPMとBowerの依存関係を持っているのAzure http://iberodev.azurewebsites.net私のウェブアプリはアズールでは動作しません - エラー0x00000000の

をアプリケーションを展開しようとしていますそれはSASSなどからCSSを生成するためにgulpを使用します。 かなり標準的なWebアプリケーションです。

すべてはアズールに公開するとき、私はすべてのエラーを取得しないと私はすべての私のDLLとwwwrootのコンポーネントがある見ることができますローカル に適しています。

アプリケーションにアクセスすると、空白のページが表示されます。しかし、私はアプリケーションが実行中であることを知ることができます(favicon.icoを返し、ミドルウェアのパイプラインに到達します)。

私はAzureでいくつかのログを有効にしましたが、私はアプリにリクエストを送信する度に、500内部サーバーエラーが発生するよりも見ることができます。しかし、それは多くの詳細を与えるものではありません:

printscreen of error

エラーが0x00000000の

私はより良い、この問題のトラブルシューティングを行うことができたりかもしれないもの方法上の任意のアイデアですか?私は考えがなくなった。

これは、Azureの

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <!-- 
    <system.webServer> 
    <handlers> 
     <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" /> 
    </handlers> 
    <aspNetCore processPath="dotnet" arguments=".\Iberodev.Web.dll" stdoutLogEnabled="false" stdoutLogFile="\\?\%home%\LogFiles\stdout" forwardWindowsAuthToken="false" /> 
    <rewrite> 
     <rules> 
     <!-- BEGIN rule TAG FOR HTTPS REDIRECT --> 
     <rule name="Force HTTPS" enabled="true"> 
      <match url="(.*)" ignoreCase="false" /> 
      <conditions> 
      <add input="{HTTPS}" pattern="off" /> 
      </conditions> 
      <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" /> 
     </rule> 
     <!-- END rule TAG FOR HTTPS REDIRECT --> 
     </rules> 
    </rewrite> 
    </system.webServer> 
</configuration> 

の私のweb.configファイルで、私のproject.jsonがあまりにも非常に簡単です:

{ 
    "dependencies": { 
    "Microsoft.NETCore.App": { 
     "version": "1.0.1", 
     "type": "platform" 
    }, 
    "Iberodev.Common": "1.0.0", 
    "Iberodev.Data": "1.0.0", 
    "Iberodev.Data.SqlServer": "1.0.0", 
    "Iberodev.Web.Model": "1.0.0", 
    "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0", 
    "Microsoft.AspNetCore.Authentication.OpenIdConnect": "1.0.0", 
    "Microsoft.AspNetCore.Diagnostics": "1.0.0", 
    "Microsoft.AspNetCore.Mvc": "1.0.*", 
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", 
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.1", 
    "Microsoft.AspNetCore.StaticFiles": "1.0.0", 
    "Microsoft.EntityFrameworkCore.Design": "1.0.0-preview2-final", 
    "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final", 
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", 
    "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0", 
    "Microsoft.Extensions.Configuration.Json": "1.0.0", 
    "Microsoft.Extensions.Logging.Console": "1.0.0" 
    }, 

    "tools": { 
    "BundlerMinifier.Core": "2.0.238", 
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final", 
    "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final" 
    }, 

    "frameworks": { 
    "netcoreapp1.0": { 
     "imports": [ 
     "dotnet5.6", 
     "portable-net45+win8" 
     ] 
    } 
    }, 

    "buildOptions": { 
    "emitEntryPoint": true, 
    "preserveCompilationContext": true 
    }, 

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

    "publishOptions": { 
    "include": [ 
     "wwwroot", 
     "web.config" 
    ] 
    }, 

    "scripts": { 
    "prepublish": [ 
     "npm install", 
     "bower install", 
     "dotnet bundle", 
     "gulp clean", 
     "gulp compile" 
    ], 
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] 
    }, 
    "version": "1.0.0" 
} 

これは私の起動クラス パブリッククラススタートアップ { プライベート読み取り専用でありますIHostingEnvironment _env; パブリックIConfigurationRoot設定{get;プライベートセット; }

public Startup(IHostingEnvironment env) 
    { 
     _env = env; 
     var builder = new ConfigurationBuilder() 
      .SetBasePath(env.ContentRootPath) 
      .AddJsonFile(Constants.IberodevisSettings.SETTINGS_FILE_FULLNAME, optional: true, reloadOnChange: true) 
      .AddJsonFile($"{Constants.IberodevisSettings.SETTINGS_FILE_NAME}.{env.EnvironmentName}.{Constants.IberodevisSettings.SETTINGS_FILE_EXTENSION}", optional: true) 
      .AddEnvironmentVariables(); 
     Configuration = builder.Build(); 
    } 

    public void ConfigureServices(IServiceCollection services) 
    { 
     var connectionString = Configuration.GetConnectionString("DefaultConnection"); 
     var migrationsAssembly = typeof(Startup).GetTypeInfo().Assembly.GetName().Name; 

     // AspNet Core Identity 
     services.AddIdentity<User, Role>(config => { 
      config.User.RequireUniqueEmail = Constants.IdentityValues.REQUIRE_UNIQUE_EMAIL; 
      config.Password.RequiredLength = Constants.IdentityValues.PASSWORD_MIN_LENGTH; 
      config.Password.RequireDigit = Constants.IdentityValues.REQUIRE_DIGIT; 
      config.Password.RequireUppercase = Constants.IdentityValues.REQUIRE_UPPERCASE; 
      config.Password.RequireNonAlphanumeric = Constants.IdentityValues.REQUIRE_NON_ALPHANUMERIC; 
     }) 
      .AddEntityFrameworkStores<IberodevContext, Guid>() 
      .AddDefaultTokenProviders() 
      .AddUserStore<UserStore<User, Role, IberodevContext, Guid>>(); 

     //Add EF services 
     services.AddDbContext<IberodevContext>(options => 
     { 
      options.UseSqlServer(connectionString, 
       sqlServerOptions => sqlServerOptions.MigrationsAssembly(migrationsAssembly)); 
     }); 

     // Identity Server 4. 
     services.AddIdentityServer() 
     .AddInMemoryStores() 
     .AddInMemoryClients(ConfigInMemory.GetClients("http://localhost:8080")) 
     .AddInMemoryScopes(ConfigInMemory.GetScopes()) 
     .AddAspNetIdentity<User>(); 

     // AspNet Core MVC 
     services.AddMvc(); 

     BootstrapServices(services); 
     BootstrapRepositories(services); 
    } 

    private void BootstrapServices(IServiceCollection services) 
    { 
     services.AddScoped<IUserService, UserService>(); 
    } 

    private void BootstrapRepositories(IServiceCollection services) 
    { 
     services.AddScoped<IUserRepository, UserRepository>(); 
    } 


    public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) 
    { 
     var logLevel = env.IsDevelopment() ? LogLevel.Debug : LogLevel.Information; 
     loggerFactory.AddConsole(logLevel); 

     if (env.IsDevelopment()) 
     { 
      app.UseDeveloperExceptionPage(); 
     } 

     //ASP.NET Core Identity (adds cookie authentication) 
     app.UseIdentity(); 
     app.UseIdentityServer(); // it relies on the authentication cookie Identity creates, so it must be after. 
     app.UseStaticFiles(); 
     app.UseMvcWithDefaultRoute(); 
    } 
} 

答えて

0

私はAzureのアプリは、それが開発のエラーを表示することができるように、それは、開発環境の下だと信じていることによって、より詳細な情報を見つけることができました。 私はアプリケーションの設定で、このキーと値のペアを追加しました: ASPNETCORE_ENVIRONMENT Development

そして私はビューがパブリッシュオプションの追加していなかったので、私は、ビューのインデックスが欠落していたことを確認するために管理:

"publishOptions": { 
    "include": [ 
     "wwwroot", 
     "**/*.cshtml", 
     "appsettings.json", 
     "web.config" 
    ] 
    }, 
関連する問題