2012-07-04 21 views
9

मैं विजुअल स्टूडियो एक्सप्रेस 2012 आरसी का उपयोग कर रहा हूं।निर्देशिका मौजूद नहीं है - पैरामीटर नाम: निर्देशिकाVirtualPath

  • एक एक रिक्त "हैलो दुनिया MVC 4.5 परियोजना"
  • बनाने अगर मैं 4.0 करने के लिए यह डाउनग्रेड तो यह मेरे मेजबान (Arvixe)
  • के साथ संगत मैं मेजबान पर प्रकाशित है।

और फिर मुझे यह त्रुटि संदेश मिलता है, मुझे ऑनलाइन इस पर कोई जानकारी मिल सकती है।

Server Error in '/' Application. 

Directory does not exist. 
Parameter name: directoryVirtualPath 

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentException: Directory does not exist. 
Parameter name: directoryVirtualPath 

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace: 


[ArgumentException: Directory does not exist. 
Parameter name: directoryVirtualPath] 
    System.Web.Optimization.Bundle.IncludeDirectory(String directoryVirtualPath, String searchPattern, Boolean searchSubdirectories) +357 
    System.Web.Optimization.Bundle.Include(String[] virtualPaths) +287 
    IconBench.BundleConfig.RegisterBundles(BundleCollection bundles) +75 
    IconBench.MvcApplication.Application_Start() +128 

[HttpException (0x80004005): Directory does not exist. 
Parameter name: directoryVirtualPath] 
    System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9160125 
    System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +131 
    System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +194 
    System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +339 
    System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +253 

[HttpException (0x80004005): Directory does not exist. 
Parameter name: directoryVirtualPath] 
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9079228 
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97 
    System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +256 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237 

इसका क्या अर्थ है?

कोड के रूप में अनुरोध ^^

public class HomeController : Controller 
{ 
    public ActionResult Index() 
    { 
     return Content("Hello world"); 
    } 
} 

केवल कोड मैं जोड़ा thats।

Application_Start कोड

public class MvcApplication : System.Web.HttpApplication 
{ 
    protected void Application_Start() 
    { 
     AreaRegistration.RegisterAllAreas(); 

     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 
     RouteConfig.RegisterRoutes(RouteTable.Routes); 
     BundleConfig.RegisterBundles(BundleTable.Bundles); 
    } 
} 

RouteConfig

public class RouteConfig 
{ 
    public static void RegisterRoutes(RouteCollection routes) 
    { 
     routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 

     routes.MapHttpRoute(
      name: "DefaultApi", 
      routeTemplate: "api/{controller}/{id}", 
      defaults: new { id = RouteParameter.Optional } 
     ); 

     routes.MapRoute(
      name: "Default", 
      url: "{controller}/{action}/{id}", 
      defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 
     ); 
    } 
} 

FilterConfig

public class FilterConfig 
{ 
    public static void RegisterGlobalFilters(GlobalFilterCollection filters) 
    { 
     filters.Add(new HandleErrorAttribute()); 
    } 
} 

BundleConfig

public class BundleConfig 
{ 
    public static void RegisterBundles(BundleCollection bundles) 
    { 
     bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
        "~/Scripts/jquery-1.*")); 

     bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
        "~/Scripts/jquery-ui*")); 

     bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
        "~/Scripts/jquery.unobtrusive*", 
        "~/Scripts/jquery.validate*")); 

     bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
        "~/Scripts/modernizr-*")); 

     bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css")); 

     bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
        "~/Content/themes/base/jquery.ui.core.css", 
        "~/Content/themes/base/jquery.ui.resizable.css", 
        "~/Content/themes/base/jquery.ui.selectable.css", 
        "~/Content/themes/base/jquery.ui.accordion.css", 
        "~/Content/themes/base/jquery.ui.autocomplete.css", 
        "~/Content/themes/base/jquery.ui.button.css", 
        "~/Content/themes/base/jquery.ui.dialog.css", 
        "~/Content/themes/base/jquery.ui.slider.css", 
        "~/Content/themes/base/jquery.ui.tabs.css", 
        "~/Content/themes/base/jquery.ui.datepicker.css", 
        "~/Content/themes/base/jquery.ui.progressbar.css", 
        "~/Content/themes/base/jquery.ui.theme.css")); 
    } 
} 
+0

आप अपने कोड पोस्ट कर सकते हैं –

+0

निश्चित रूप से करेंगे, लेकिन यह सिर्फ एक परीक्षण है। – BjarkeCK

+1

क्या आप application_start के अंदर कोड पोस्ट कर सकते हैं? –

उत्तर

15

ऐसा लगता है कि इस त्रुटि "अपने आवेदन की निर्देशिका में वांछित फ़ाइलों सहित नहीं" या एक निर्देशिका है कि वर्चुअल निर्देशिका, के रूप में या यहाँ तक कि गलत निर्देशिका में कॉन्फ़िगर नहीं है में अपने कोड को अपलोड करने से निकलती है।

+0

मुझे लगता है कि आप बहुत सही हैं :) इसका परीक्षण करेंगे, और एक मिनट में वापस रहें – BjarkeCK

+0

ठीक है मुझे अपना परिणाम बताएं। सौभाग्य। –

+0

वैसे मुझे लगता है कि इस मुद्दे को हल किया गया है, लेकिन अब यह एक नया है: http: ** temp.iconbench.com/ – BjarkeCK

5

इस पोस्ट Directory does not exist. Parameter name: directoryVirtualPath

के समान जवाब मुझे डिबग मदद की है। जाहिर है, लक्ष्य सर्वर पर गायब फ़ोल्डर्स हैं। मेरा आवेदन स्थानीय रूप से ठीक काम करता था, लेकिन जब मैंने प्रकाशित किया, तो कई script उप-निर्देशिका प्रकाशित नहीं हुईं। जब मैंने मैन्युअल रूप से उन्हें एफ़टीपी किया, तो ऐप ठीक काम करता था!

+0

यह मेरा मुद्दा भी था। विजुअल स्टूडियो डिफ़ॉल्ट रूप से रिक्त निर्देशिका प्रकाशित नहीं करता है, भले ही एप्लिकेशन उनका उपयोग करता है और वे परियोजना में शामिल हैं। –

3

यहां जानकारी का विस्तार करने के लिए।

मैं अक्सर इस तरह के फ़ोल्डर में सभी फाइलों को बंडल करता हूं: "~/Content/js/angular/modules/*.js", और जब तक फ़ोल्डर मौजूद है तब तक यह बहुत अच्छा काम करता है।

समस्या यह है कि यदि यह प्रकाशित होता है तो वह फ़ोल्डर खाली होता है, तो इसे प्रकाशित नहीं किया जाएगा और परिणामस्वरूप उपरोक्त अपवाद होगा। तो अब मैं या तो एक खाली.txt या कुछ प्रकार के फ़ोल्डर को मैन्युअल रूप से जोड़ता हूं यदि मैं चाहता हूं कि मैं उन्हें खाली रहूं।

+0

आह, जिसने मुझे घंटे बचाया :) धन्यवाद – Yulian

-4

निर्देशिका बनाएँ "/ सामग्री/विषयों/आधार"

0

जांच अगर तुम बिन फ़ोल्डर में dll और भी dll है GAC से GAC

निकालें dll में मौजूद

संबंधित मुद्दे