Installed nuget package depends on older version of System.Web.Mvc.dll after Publish - asp.net

I have an MVC4 application developed with Visual Studio 2010.
Project works fine on IIS Express.
When publishing it to IIS8 and trying to access it I get an exception saying the System.Web.Mvc, Version=3.0.0.0 assembly could not be loaded.
The calling assembly is AttributeRouting.Web.Mvc, which is a NuGet package I use.
The way I understand it, my project referes to version 4.0.0.0 of System.Web.Mvc, while the package I'm using depends on 3.0.0.0.
If Visual Studio/IIS Express can run it perfectly, how come the published version has this problem?
I read a lot only today, but still couldn't figure it out.
Is this what Binding Redirect used for?
I'm kind'a lost here, feeling like I don't really have any direction.
Any advice is welcomed.
Thanks in advance,
Shy.

SOLVED:
I simply (Well it wasn't so simple) installed MVC3 in addition to versions 2 and 4.
Problem disappeared without the need of any further changes.
Solution:
Download and install MVC3 from Microsoft's website.
In case installation failes:
Extract the setup file.
Open ParameterInfo.Xml in an editor.
Remove completely the <Exe> tag that refers to the vs10-kb2483190
file.
Run setup again.
Thank you very much for your help #Augusto.
Hope this helps someone someday :)

Related

Simple Website not building

I am new to ASP .Net programming. I know C,C++ and C#. I have got the book named ASP.Net 4.5.1 in C# and VB by Imar Spaanjaars.
I have got Visual Studio 2013 ultimate installed as well.
What is bothering me ?
I did exactly as the author told and I getting the errors when building
error. See screen shot.
Any help would be much appreciated.
It seems your project misses some dll in the project bin folder. Could you please check?
Otherwise it may be that you need to configure Nuget, in order to download automatically those missing packages.

Error while Publishing Web App in Visual Studio Professional 2013

I am trying to publish my Web App in Visual Studio Professional 2013 but getting the following error
I got the same question asked over here but no useful answer.
Can anyone please help
You probably will be using older version, that was having an issue. refer detail [here]
Install the newer web deployment tool, should work.
which .net version are you using.
check web deploy version. if vs has 2 web deploy version, the vs get confuse to take which version. If it has 2 version, just uninstall vs and then instal it along with web deploy. if the Vs has one 1 web deploy version, you uninstall and install the web deploy. It will rectify your problem i hope.
You can refer This link
Check if version 9.0.0.0 of the assembly is installed in GAC. (from the VS2013 developer command prompt) gacutil /l Microsoft.Web.Deployment. Issues like this have occurred in the past where things worked, then after installing an update (or trying to install one) then reports of missing dlls, like nuget, occur.
The usual course of action is to repair the Visual Studio installation.
There is a problem with your publish profile. Delete the pubxml file located bellow Properties folder in your project and then create a new publish profile.
I got the same problem when older project runs into the new .NET Framework, for that you have to do the following.
Right Click on your project name->select Property Pages -> Click Build from the menu-> then select Target Framework .Net framework 4.5 or your current using framework..
"Could not load file or assembly" means the required file (of that mentioned version) is not available in the assembly (nor in the registry). All you gotta to do is to ensure this same is installed properly that would allow you to proceed further. The other things to ensure is the latest framework installed on your system.
Think you have some errors happen when to install or update Visual 2013, so you can reinstall again and this error will be fixed.

VS2013 Scaffolding Error when constructing view

I'm getting a curious error when attempting to generate a view via the 'Add View' dialog. Simply leaving the dialog as is (ie creating view 'View') and hitting 'Add' yields the following error dialog:
Error: There was an error running the selected code generator: 'The Templates/PackageVersions5.0.1xml file is missing from the installed template folder.'
Which I'm afraid means little to me. I've googled the xml file to no avail.
Not really sure where to go now - I'm unable to add views to my project via scaffolding (though I can of course just by 'adding a new item' and building it myself).
How can I track down the source of this error?
Posting here because I ran into the same "file is missing" issue with Visual Studio 2019 and PackageVersions5.2.6.xml. This was one of the only pages I could find related to this scaffolding issue so I suspect others will find their way here too.
I found that upgrading the "Microsoft.AspNet.Mvc" package via NuGet to 5.2.7 was not sufficient to fix the problem. I also had to upgrade "Microsoft.AspNet.WebApi" and its related packages to 5.2.7. The Add View option started working again afterward.
Just make sure you have same version of MVC nugget in all projects, if you only have one project then upgrade/downgrade MVC to different version then revert back to the version you require and issue will get fixed.
I just changed version from 5.2.3 back to 5.2.2 and then reverted back to 5.2.3 and all worked. It appears some file got messed up or and then was restored by this.
I got same issue while using visual studio 2019 community edition, where I am able to create view using visual studio 2017.
After reading answers here, I tried upgrading Microsoft.AspNet.Mvc package, and it works for me.
I'm afraid the rather unsatisfactory solution I arrived at was to create a clean project and import the project elements in, recreating the project from scratch.
I assume that some deep-configuration had become corrupted and I was unable to work out how to fix it.
I ran into the same problem when using a project from VS2013 in VS2015. In my case it was PackageVersions5.1.3.xml that was missing. 5.1.3 seems to be the version of MVC this project was using. I updated MVC to the latest (currently 5.2.3) and this solved the issue.
The XML file should exist in C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web\Mvc\Scaffolding\Templates\
I had the same issue. The problem started after installing DevExpress to project. I found that DevExpress installation creates some DevExpress folders in D:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions but all necessary files for scaffolding lived in D:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Extensions. I copied the content of extension folder from vs professional to enterprise restart Visual Studio and Scaffolding works again.

Compiling ASP.NET

I'm compiling ASP.NET code for the first time ever and I'm stumped.
I downloaded MINGW-Get and just finished installing it. The client gave me the source code and I found a file called RSConfig.exe.
So I assumed that was the config file, ran it, and then tried "make" but got the error
No targets specified and no makefile found. Stop
Any idea what I'm supposed to do? I don't see anything that would resemble a makefile in the source code.
Thanks in advance!
Do yourself a favour and install Visual Studio Express:
http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express
It makes development easier and fast
It sounds like you might want to get familiar with the background concepts around asp.net and it's defacto development environment Visual Studio (there are many versions of visual studio).
As Andrei recommends, using Visual Studio Express is a good free way of getting started. The version most suited for web development is Visual Web Developer Express.
Attempting to compile .net code from a toolset such as MinGW isn't a typical route for using asp.net, however I've not used MinGW before and not sure it's possible to compile .net code from it.... Although it is perfectly possible to compile .net code from the command line (using the .net framework sdk) , I certainly wouldn't recommend it if you are getting started.
I'm going to make a guess that it is an ASP.net web forms project, it being the most prolific asp.net project type at the moment.
This official asp.net site http://www.asp.net/web-forms will guide you through what web forms are and how to get the development environment setup. Having this sort of background will aid you in solving your particular situation.

ASP.net and devexpress scheduler, works local, does not work live

Hi guys I got some code here thats buggin me.
ive managed to create a page and get it working on local host, but when i publish this to go live and nav to the web page it comes up with this error.
Could not load file or assembly 'DevExpress.Web.v11.1,
Version=11.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a' or
one of its dependencies. The system cannot find the file specified.
(E:\web\shafteccom0\htdocs\Calendar\web.config line 44).
Ive tried adding all the references, and i mean all of the dev express ones, including ones i dont even need.
my project is a web project using visual studio 10, asp.net,C# & .Net version 3.5
ive also tried changing the .net version to 2.0, 3.0 and 4.0 but no luck.
If you need my code let me know and ill edit this.
Many thanks
That error means that the library that your application is looking for does not exist on the server you are deploying it to (or it cannot load it with the variables provided). Does the live server have the VS2010 references installed to it?
Just making sure: Are you sure your references set to "CopyLocal"?
I think DevEx installs it's assemblies in the GAC, so your local copy may be working but not when you deploy. Have you tried looking in the bin on the publish location to see if they are actually there?

Resources