ef-db-diagrams icon indicating copy to clipboard operation
ef-db-diagrams copied to clipboard

System.IO.DirectoryNotFoundException

Open Ryan-J-D opened this issue 5 years ago • 5 comments

Full stacktrace:

System.IO.DirectoryNotFoundException
  HResult=0x80070003
  Message=C:\Users\xxxx\Documents\GitHub\xxxx\src\xxxx\EntityFrameworkCore.Diagrams\wwwroot\db-diagrams\
  Source=Microsoft.Extensions.FileProviders.Physical
  StackTrace:
   at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root, ExclusionFilters filters)
   at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root)
   at Microsoft.Extensions.DependencyInjection.EfDiagramsOptions..ctor()
   at Microsoft.Extensions.DependencyInjection.EfDiagramsServiceCollectionExtensions.AddEfDiagrams[TDbContext](IApplicationBuilder app)
   at ThePubInn.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env) in C:\Users\xxxx\Documents\GitHub\xxxx\src\ThePubInn\ThePubInn\Startup.cs:line 54
   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.ConventionBasedStartup.Configure(IApplicationBuilder app)

Configure method code snippet:

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.AddEfDiagrams<StoreContext>();
            }

AspNetCore 3.1 NuGet package version 3.1

Ryan-J-D avatar Dec 28 '19 05:12 Ryan-J-D

I've tried manually creating the directory in the target path provided in the stack trace with no luck. It looks like it's missing the actual running env directory? Its targeting the path where my solution file is located, not where my source code is (where the actual wwwroot folder is).

Ryan-J-D avatar Dec 28 '19 05:12 Ryan-J-D

@Ryan-J-D Did you find any workaround for this? Even I'm facing the same issue.

fingers10 avatar Jan 09 '20 09:01 fingers10

@Ryan-J-D Did you find any workaround for this? Even I'm facing the same issue.

Seems to be a AspNetCore 3.1 issue, apparently this library only works on 2.0 from what I've seen online.

I used this instead: https://www.devart.com/entitydeveloper/

Ryan-J-D avatar Jan 09 '20 09:01 Ryan-J-D

Wow, it's been a while. This error means that frontend app is not built yet. Building frontend app creates that directory and puts assets there. I will add an exception rethrow with this hint.

EvAlex avatar Jun 14 '21 15:06 EvAlex

Wow, it's been a while. This error means that frontend app is not built yet. Building frontend app creates that directory and puts assets there. I will add an exception rethrow with this hint.

Can you provide instructions how to build the frontend into the readme?

Toumash avatar Dec 07 '21 10:12 Toumash