Questions on Deploying on IIS Web Hosting

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 года назад
Hi everyone,
I started developing my first website on nopCommerce.
Everything works fine locally, but I'm having some problems when publishing to IIS server.

First of all I tried to publish the clean nopCommerce test website, the site starts correctly but I encounter two problems when accessing from external url:
- Images still refer to localhost and not the external url.
- The use of https is forced but is not yet available by the external url

Instead I've tried to publish my own site with my actual changes, and I get the HTTP Error 500.30 - ASP.NET Core app failed to start
and at log the message is:

"crit: Microsoft.AspNetCore.Hosting.Diagnostics[6]
      Application startup exception
      System.AggregateException: One or more errors occurred. (Input string was not in a correct format.)
       ---> System.FormatException: Input string was not in a correct format.
         at System.Text.ValueStringBuilder.ThrowFormatError()
         at System.Text.ValueStringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
         at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
         at Nop.Services.Plugins.PluginService.InstallPluginsAsync() in C:\Users\Francesca\Documents\Visual Studio 2019\Projects\nopCommerce\src\Libraries\Nop.Services\Plugins\PluginService.cs:line 522
         --- End of inner exception stack trace ---
         at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
         at System.Threading.Tasks.Task.Wait()
         at Nop.Web.Framework.Infrastructure.Extensions.ApplicationBuilderExtensions.StartEngine(IApplicationBuilder application) in C:\Users\Francesca\Documents\Visual Studio 2019\Projects\nopCommerce\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationBuilderExtensions.cs:line 62
         at Nop.Web.Startup.Configure(IApplicationBuilder application) in C:\Users\Francesca\Documents\Visual Studio 2019\Projects\nopCommerce\src\Presentation\Nop.Web\Startup.cs:line 47
         at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
         at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
         at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
         at Microsoft.AspNetCore.Hosting.ConfigureBuilder.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder)
         at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass15_0.<UseStartup>b__1(IApplicationBuilder app)
         at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
         at Microsoft.AspNetCore.Server.IIS.Core.IISServerSetupFilter.<>c__DisplayClass2_0.<Configure>b__0(IApplicationBuilder app)
         at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
         at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
Unhandled exception. System.AggregateException: One or more errors occurred. (Input string was not in a correct format.)
---> System.FormatException: Input string was not in a correct format.
   at System.Text.ValueStringBuilder.ThrowFormatError()
   at System.Text.ValueStringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at Nop.Services.Plugins.PluginService.InstallPluginsAsync() in C:\Users\Francesca\Documents\Visual Studio 2019\Projects\nopCommerce\src\Libraries\Nop.Services\Plugins\PluginService.cs:line 522
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationBuilderExtensions.StartEngine(IApplicationBuilder application) in C:\Users\Francesca\Documents\Visual Studio 2019\Projects\nopCommerce\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationBuilderExtensions.cs:line 62
   at Nop.Web.Startup.Configure(IApplicationBuilder application) in C:\Users\Francesca\Documents\Visual Studio 2019\Projects\nopCommerce\src\Presentation\Nop.Web\Startup.cs:line 47
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.ConfigureBuilder.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass15_0.<UseStartup>b__1(IApplicationBuilder app)
   at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Server.IIS.Core.IISServerSetupFilter.<>c__DisplayClass2_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Nop.Web.Program.Main(String[] args) in C:\Users\Francesca\Documents\Visual Studio 2019\Projects\nopCommerce\src\Presentation\Nop.Web\Program.cs:line 29
   at Nop.Web.Program.<Main>(String[] args)"
  
   Thanks for the support
2 года назад
Is  the config file dataSettings.json being published i.e. are you still connecting to the development database ?

Have you customised the core website app or just added plugins to your development and tried to publish everything
Looks like there is an issue with a plugin

Typically you would publish the core site and get it running then install plugins later.

I publish to a local directory and then copy files (or you can ftp) files from the local publish to your server
2 года назад
Yidna wrote:
Is  the config file dataSettings.json being published i.e. are you still connecting to the development database ?

Have you customised the core website app or just added plugins to your development and tried to publish everything
Looks like there is an issue with a plugin

Typically you would publish the core site and get it running then install plugins later.

I publish to a local directory and then copy files (or you can ftp) files from the local publish to your server


Hi, thank you for the answer.
- I published to a local directory and then copied the files on the server.
- The Database is the same that I use locally
- I had thought about the plugins too, I have created some but they are not yet installed
2 года назад
Hi,
by editing manually the file plugins.json on App_Data I've resolved one of the issues, about the Plugins.

Now, the configurations for the store actually have SslEnable set to True and the Url parameter set with "https://".
I've tried to remove the SslEnable and set the Url to "http://", I reach the site correctly but there is a issue with css/js files, also starting locally the site I receive a "Too many redirect" error message.
There are other options or another file to be edited manually?

Thank you
2 года назад
Small Update:
I've found the way to fix everything but is not the best solution.

I've removed the SslEnable from the store configuration and put to true the "UseHttpXForwardedProto" on local web.config. Now both local and deployed site works correctly, but I guess there is a way to do in a better way.

Then I found that the deployed site can't load the custom theme. Copiyng the custom files to the default theme it works fine. But again there should be a way to run the Custom Theme
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.