I have a web application. The platform is Asp.NET 4.0 and I've used web forms. It's not MVC.
I'm getting an error.
System.IO.FileLoadException: Could not load file or assembly 'System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Access is denied.
I've searched and the error is about MVC. I couldn't find any answer why it's happening at webforms. Also the project is working well at localhost. But when I publish it, I am getting that error.
Thanks...
Looks like you have a broken reference to a DLL in production - the DLL may not be in the GAC on the machine you pushed to. To verify, you can compare the bin folder locally to that on the production machine.
If it's not available on the deployment machine, right click the reference in your "References" folder and set "Copy Local" to true - then redeploy.
Related
I am trying to run an website that I have hosted an IIS server using localhost, however, the MVC 5 project I have created uses .NET 4.5.1 and in IIS App pool I have selected v4.0 - Is this right?
The reason why I have asked is when I browse to the site, I get this error
Server Error in '/' Application.
Could not load file or assembly 'Microsoft.Web.Infrastructure,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. The system cannot find the file specified.
I realise this is a reference problem but I have a feeling its to do with IIS and the app pool.
Any ideas?
Please note I am deploying the site onto a different server
Thanks
OK, found the answer,
Even though the Microsoft.Web.Infrastucture is referenced in the project (if not, get it using NuGet) you need to change CopyLocal to equal true when you click on the reference. Do this when deploying onto a server when Visual Studio isn't installed
I just updated my website from MVC 4 to MVC 5.
Now when I want to run it on my web server instead of my development machine it does not work.
It think it is because I need to install the MVC 5 libraries on the server but I can't find them.
I downloaded WebMatrix 3 hoping it would provide a way to install it but it only gives me the ability to install MVC 4.
What should I install to be able to run a ASP.NET MVC 5 application?
(without installing Visual Studio 2013)
EDIT:
I disabled custom errors and eror what I have:
Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
EDIT 2:
I found out that the problem was due to one of my dependencies which was using the version 2.0.0.0 of razor.
When you deploy your app just make sure that all the assemblies are being deployed to your production environment in the bin folder. ASP.NET MVC is an xCopy deployment, so you don't have to install anything.
You might want to check that your Production environment has ASP.NET 4.0 and 4.5 registered.
MVC5 and future version of MVC doesn't require to installed on Windows Server. MVC5 app have everything as packages. You didn't need anything to install it.
What is required on server is copy of every library and assembly that you have used in your app. For fix this, Just make sure that everything on your bin folder is called same on server instead of server is looking for it's own GAC for assembly used in your app.
If you didn't found all the packages then you can install nuget packages on server by cmd.
The best is to do a Publish, right click on your project in Solution Explorer and select 'Publish'. Basically it will compile your solution and dump all the assemblies/artifacts to either your webserver, ftp or a local folder.
Make sure all your assembly references are being copied to the deployment directory. To do this you can change the <Reference...> tag in your .project file. Optionally, you can use visual studio's property setter to set the "Copy Local" property of each dll reference to "True".
I'm trying to debug a web application that I inherited from a previous developer, it was written using Visual Studio 2008 with the .Net 3.5 framework (hence using asp.net 2.0). I can see temporary asp.net files show up in the 2.0 folder (C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files)
Unfortunately every time I try browse to the login page on my local IIS server I get the following error:
"Could not load file or assembly 'System.Web.Mobile, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)"
The assembly is not referenced anywhere in the application, I have no idea why it's trying to load it when I browse to the page. I tried explicitly referencing the the 3.5 version as follows in the web.config using the 2.0 framework dll:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Web.Mobile.dll
No matter what I do however it seems to try to bind to the 4.0.0.0 version and fails to load the page.
I'm developing an ASP.NET MVC 4/Web Api application in VS 2010 on my 64-bit dev machine. I have IIS installed and am running the project under IIS. Because I need to interface with a third party component, I have to change the project build configuration to x86 (I'm currently in the Debug build).
In IIS, I configured the application to use an application pool that allows 32-bit processes. However, when I ran my site, I noticed that code changes I was making were not showing. It turns out that the assemblies being used were those found in the \bin folder. After changing the configuration, the compiler's assembly output goes to the \bin\x86\debug folder; it didn't look like IIS was looking there.
I temporarily switched the configuration back to "Any CPU", right-clicked the project node, and selected the Clean option. This removed all the stale assemblies in the \bin folder. I then switched back to the x86 configuration -- rebuilt the project for good measure -- and tried to run the project again. Now it wasn't finding any assemblies at all. I'm getting errors like:
Could not load file or assembly 'System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies
System.Web.Providers -- and all the rest of the assemblies -- reside in \bin\x86\debug.
Is IIS supposed to know to look there?
Is Visual Studio supposed to copy the assemblies up two levels to the \bin folder?
If the latter, that is clearly not happening. Thanks for any insight.
The solution was simply to set the Output Path to bin in the Build tab of the project properties. :-)
I am getting error as below
Could not load file or assembly 'CrystalDecisions.CrystalReports.Engine,
Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304'
or one of its dependencies. The system cannot find the file specified
I think the error is self-explanatory.
first probe: Is the DLL already in GAC (with given name, version)?
i.e Are the Crystal Report assemblies deployed, specifically those that were targeted while in development?
Crystal Reports components must be installed on the web-server, as they have COM dependencies.