Skip to content

Commit ebbee96

Browse files
committed
Trying to create the folder automatically for plugins.
1 parent 8105840 commit ebbee96

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

eFormAPI/eFormAPI/App_Start/WebApiConfig.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,17 @@ public class EformAssembliesResolver : DefaultAssembliesResolver
5252
{
5353
public override ICollection<Assembly> GetAssemblies()
5454
{
55-
var path = System.Web.Hosting.HostingEnvironment.MapPath("~/Plugins");
56-
if (path == null)
55+
var path = System.Web.Hosting.HostingEnvironment.MapPath("~/plugins");
56+
try
57+
{
58+
Directory.CreateDirectory(path);
59+
} catch
5760
{
61+
throw new Exception("Unable to create directory for plugins");
62+
}
63+
64+
if (path == null)
65+
{
5866
throw new Exception("Plugin path not found");
5967
}
6068
var assemblies = new List<Assembly>(base.GetAssemblies());

0 commit comments

Comments
 (0)