Developer forum

Forum » Dynamicweb 10 » Cannot start DW10

Cannot start DW10

Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

I'm trying to istall DW10 with Swift but get an error. I have installed the .NET Core 6.0 runtime. 

The Event Viewer displays this error:


Application: w3wp.exe
CoreCLR Version: 6.0.1122.52304
.NET Version: 6.0.11
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentNullException: Value cannot be null. (Parameter 'path1')
   at System.IO.Path.Combine(String path1, String path2)
   at Microsoft.AspNetCore.Builder.DynamicwebApplicationExtensions.AddFileProviders(IServiceCollection services, IWebHostEnvironment environment, IConfiguration configuration) in E:\dw10agent\_w\2\s\Dynamicweb.Host.Core\DynamicwebApplicationExtensions.cs:line 90
   at Microsoft.AspNetCore.Builder.DynamicwebApplicationExtensions.AddDynamicweb(IServiceCollection services, IWebHostEnvironment environment, IConfiguration configuration) in E:\dw10agent\_w\2\s\Dynamicweb.Host.Core\DynamicwebApplicationExtensions.cs:line 35
   at Dynamicweb.CoreUI.Host.Startup.ConfigureServices(IServiceCollection services) in E:\dw10agent\_w\2\s\Dynamicweb.CoreUI.Host\Startup.cs:line 22
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& 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.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass9_0.<Invoke>g__Startup|0(IServiceCollection serviceCollection)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass8_0.<Build>b__0(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType, HostBuilderContext context, IServiceCollection services, Object instance)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass13_0.<UseStartup>b__0(HostBuilderContext context, IServiceCollection services)
   at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at Dynamicweb.CoreUI.Host.Program.Main(String[] args) in E:\dw10agent\_w\2\s\Dynamicweb.CoreUI.Host\Program.cs:line 14

Any ideas?

Regards / Aki

 


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

IIS or Kestrel?

Looks like you are missing a path to /Files

If you are using Kestrel, you need to ensure the filespath in the appsettings:

{
  "FilesPath": "C:\\Data\\dw9.local.dynamicweb.dk\\Files"
}

If you are in IIS you need a web.config something like this:

<?xml version="1.0" encoding="utf-8"?>

<configuration>

 <location path="." inheritInChildApplications="false">

 <system.webServer>

 <handlers>

 <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />

 </handlers>

 <aspNetCore processPath="dotnet" arguments=".\bin\Debug\net6.0\Dynamicweb.CoreUI.Host.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess">

 <environmentVariables>

 <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />

 <environmentVariable name="DW_FilesPath" value="C:\Git\Swift\Swift\Files" />

 </environmentVariables>

 </aspNetCore>

 </system.webServer>

 

 </location>

</configuration>

 

 
Aki Ruuskanen
Aki Ruuskanen
Reply

OK, added the "environmentVariables" to web.config and got a different error. 

System.IO.DirectoryNotFoundException: E:\dw10agent\_w\2\s\Dynamicweb.CoreUI.Rendering\wwwroot\
   at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root, ExclusionFilters filters)
   at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root)
   at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.<>c.<UseStaticWebAssetsCore>b__1_0(String contentRoot)
   at Microsoft.AspNetCore.StaticWebAssets.ManifestStaticWebAssetFileProvider..ctor(StaticWebAssetManifest manifest, Func`2 fileProviderFactory)
   at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssetsCore(IWebHostEnvironment environment, Stream manifest)
   at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssets(IWebHostEnvironment environment, IConfiguration configuration)
   at Microsoft.AspNetCore.WebHost.<>c.<ConfigureWebDefaults>b__9_0(WebHostBuilderContext ctx, IConfigurationBuilder cb)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass9_0.<ConfigureAppConfiguration>b__0(HostBuilderContext context, IConfigurationBuilder builder)
   at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at Dynamicweb.CoreUI.Host.Program.Main(String[] args) in E:\dw10agent\_w\2\s\Dynamicweb.CoreUI.Host\Program.cs:line 14

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

What would be your guess that "System.IO.DirectoryNotFoundException: E:\dw10agent\_w\2\s\Dynamicweb.CoreUI.Rendering\wwwroot\" means :-)

 
Aki Ruuskanen
Aki Ruuskanen
Reply

My guess is that line 14 in class "Program" in the dll Dynamicweb.CoreUI.Host expects to find a folder in that path. 

/Aki

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Yes, kindof - it is the default directory for static files in asp.net core:

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-7.0

If missing, Dynamicweb will try to create the wwwroot folder. Maybe missing write permissions for the iisuser? You can try to switch to either using kestrel (dotnet run) directly or change the iisuser to be networkSystem.

We will look into a more solid startup that will try to accomodate missing folders and files.

Are you using the latest nuget package?

 
Aki Ruuskanen
Aki Ruuskanen
Reply

No, I'm using the October Beta release. 

 

 
Aki Ruuskanen
Aki Ruuskanen
Reply

This is my IIS with the "wwwroot" folder. On the top folder I have set "Everyone" to Full Control (it on my local machine). Still get the "DirectoryNotFoundException: E:\dw10agent\_w\2\s\Dynamicweb.CoreUI.Rendering\wwwroot\" error. 

I have the FilesPath set in the appsettings.json

And the web.config

If I run it with "Dotnet" I get this : 

Regards / Aki

 

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Got i working now. 

Basically just redid everything from cratch and it worked. Fantastic. :) 

Regards / Aki

 

You must be logged in to post in the forum