I only FTP deploy the empty site with my single "hello" text in the index.cshtml. And I click the install to activate the application on my .NET4.0 Hoster site (discountasp.net). However, I get this error. What should I do?
Thank you.
Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
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.IO.FileNotFoundException: Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
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.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Stack Trace:
[FileNotFoundException: Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
Microsoft.WebPages.PreApplicationStartCode.Start() +0
[InvalidOperationException: The pre-application start initialization method Start on type Microsoft.WebPages.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..]
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +423
System.Web.Compilation.BuildManager.CallPreStartInitMethods() +306
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +591
[HttpException (0x80004005): The pre-application start initialization method Start on type Microsoft.WebPages.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8946484
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.1
I am not sure what is going on. I tried to upload to the root this time, and it was ok. I redo it, and it is not working anymore.
I am somewhat confused. Am I allowed to publish my application via ftp to a sub-directory? like root/blog? And I install the blog folder as application? So, which bin should I use? The root/bin or root/blog/bin?
Although both failed on me, I tried to to publish my site both to the root and the sub-dirctory, and they both returne the same error. What is going on?
Additionally:
I don't have System.Web.MVC when I publish my WebMatrix application. Is that the reason? My web-matrix didn't publish it, do I really need it? And where can I get the DLL?
magicalclick
Member
54 Points
50 Posts
Could not load file or assembly 'System.Web.Mvc,
Jul 10, 2010 06:49 PM|LINK
I only FTP deploy the empty site with my single "hello" text in the index.cshtml. And I click the install to activate the application on my .NET4.0 Hoster site (discountasp.net). However, I get this error. What should I do?
Thank you.
Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
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.IO.FileNotFoundException: Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Source Error:
Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.
Stack Trace:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
Vimpyboy
Contributor
3212 Points
651 Posts
MVP
Re: Could not load file or assembly 'System.Web.Mvc,
Jul 10, 2010 07:47 PM|LINK
Can you try to upload the dll to your bin folder? It should already be in GAC though.
http://weblogs.asp.net/mikaelsoderstrom
http://www.twitter.com/vimpyboy
magicalclick
Member
54 Points
50 Posts
Re: Could not load file or assembly 'System.Web.Mvc,
Jul 12, 2010 07:41 AM|LINK
Hello,
I am not sure what is going on. I tried to upload to the root this time, and it was ok. I redo it, and it is not working anymore.
I am somewhat confused. Am I allowed to publish my application via ftp to a sub-directory? like root/blog? And I install the blog folder as application? So, which bin should I use? The root/bin or root/blog/bin?
Although both failed on me, I tried to to publish my site both to the root and the sub-dirctory, and they both returne the same error. What is going on?
Additionally:
I don't have System.Web.MVC when I publish my WebMatrix application. Is that the reason? My web-matrix didn't publish it, do I really need it? And where can I get the DLL?
Thank you.
Vimpyboy
Contributor
3212 Points
651 Posts
MVP
Re: Could not load file or assembly 'System.Web.Mvc,
Jul 12, 2010 08:08 AM|LINK
All dlls must be in "~/bin" (root of application/bin) or in GAC (global assembly cache).
If you have this it doesn´t work:
~/folder - all files
~/folder/bin - dll
If you have it like that you need to turn "folder" into a virtual folder or a new application, which makes it to a new root.
http://weblogs.asp.net/mikaelsoderstrom
http://www.twitter.com/vimpyboy
magicalclick
Member
54 Points
50 Posts
Re: Could not load file or assembly 'System.Web.Mvc,
Jul 12, 2010 04:25 PM|LINK
Hello thanks,
I fix that problem by copying over the MVC DLL. The web matrix didn't have it in the bin folder, so I have to do that manually.
I still have errors, but, that's not the same issue.