EvAlex / ef-db-diagrams

Visualize model created with EntityFramework Core
https://db-diagrams.firebaseapp.com/
MIT License
61 stars 26 forks source link

System.IO.DirectoryNotFoundException #48

Open Ryan-J-D opened 4 years ago

Ryan-J-D commented 4 years ago

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 commented 4 years ago

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).

fingers10 commented 4 years ago

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

Ryan-J-D commented 4 years ago

@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/

EvAlex commented 3 years ago

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.

Toumash commented 2 years ago

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?