my webapi mvc4 not run in server with net.4.0 - asp.net-mvc

hello I made one applicattion(WEB API MVC4 which connect with SQL server) using framework 4.5, in my IIS express run fine but I try publish in other server which uses framework 4.0, my applicattion not run ?
I change in properties of my application works with framework 4.0 and in my IIS express run fine but other server not run.
I can't upload version framework in the other server.
thanks for the asnwers and sorry for my english I'm learning

Maybe you have changed target framework attribute in your web application that isn't sufficient to deploy. In your codes you may use libraries that require .net 4.5 while you only have changed the setting. About running this in your iis express must say that your system by default supports .net 4.5 while your app says i need only .net 4.0. So .net 4.5 related parts will be compiled and executed on local server and no ambiguous thing is here.

Running .NET4.5 based app on .NET4 machine is not supported. Simply because .NET4.5 is a super set of .NET4. Everything that's built for .NET4 works on .NET4.5 but not the other way around. If you are using Visual Studio 2012, you can change TargetFramework (in project properties) to .NET Framework 4, this will ensure that your app is built for .NET4.
--Varun
(.NET Framework Team)

Related

aspnet core 1.0 full .net framework on Linux

I have a few simple questions:
a) can I use mono on linux and osx to load the full .net framework like I would on windows by adding net46 to my project.json?
b) can I use mono as an alias like net46?
c) can I use mono with aspnet core 1.0 rtm projects on linux?
I have been looking at the dotnet docs, specifically the standard library and the table and the table with the platform support confuses me with the arrows and star under mono.
thanks
can I use mono on linux and osx to load the full .net framework like I would on windows by adding net46 to my project.json?
In theory, yes, that's exactly what you do: specify some version of net inside frameworks in your project.json and dotnet run will then use mono to run your application.
In practice, basic Hello World application works, but I'm not sure how well will more complicated applications work.
If you want to run dotnet build on the same machine, you will also need reference assemblies. The version I tested (mono 4.2.1) only contained reference assemblies up to .Net 4.5.1, so net451 works, but net46 doesn't.
can I use mono as an alias like net46?
I don't think you can, at least not without forking .Net Core SDK.
I don't understand why would you want to do that, but I believe doing so would require modifying DefaultFrameworkMappings in NuGet.Client.
can I use mono with aspnet core 1.0 rtm projects on linux?
I wasn't able to make a basic ASP.NET Core application run under mono. I don't know what the problem is, or how hard would it be to fix it. EDIT: I managed to work around the issue I encountered.
Mono is other thing. Yeah they developed mono like .net framework but you cannot use .net 4.6 on mono.
Read the following article. Click here
Micrsoft developed .net core a new framework to run .net on windows, linux, mac osx etc.

How can I deploy an MVC 4 application to IIS 6?

I'm working on my first MVC application (also my first web project) and want to deploy it to a test server running Windows Server 2003 with IIS 6. It's a simple CRUD app built with VS 2012 using .NET 4, Entity Framework 5. I built the DB first on SQL Server 2005 since my manager wanted to see the DB first. I used the EF Power Tools Beta 4 to reverse-engineer back to Code First. I customized the T4 templates to allow for Data Annotations.
The app works fine using IIS Express on my development PC, but I want to get an initial version out to our test server, which unfortunately, is running IIS 6. Nobody where I work has experience with MVC...just ASP.NET with VB, and I'm having trouble finding good step-by-step instructions on how to deploy it.
first setup extensionless urls based on Phil Haack's blog post: ASP.NET MVC on IIS 6 Walkthrough.
Second Source click here
I found this article to be helpful:
http://www.asp.net/mvc/tutorials/older-versions/deployment/using-asp-net-mvc-with-different-versions-of-iis-cs

.Net MVC Web Deployment

I have Visutal Studio 2012, MVC 4 & Razor. I am having trouble getting a website up and running with this technology.
The Web Server is a Windows Server 2008 server. I tried deploying using the Web Deploy method but am consistently getting something like 'set ACL" error.
I tried deploying using the File System. All files got deployed, but when I try and run the website, it fails because of missing ASP.NET MVC infrastruccture files.
Two things:
•If I use Web-Deploy, how do I solve the ACL error, because I assume with this method, everything needed will get deployed.
Note that the Web Deploy 3.0 service is on the server and started.
•If I use File System, where can I find the downloads needed to deploy on the server where MVC WILL work.
◦Note that I downloaded the 4.5 Framework and was successfully installed.
You need to be a bit more precise with what you need help with.
What's the exact error.
Often times you need to give the IIS users group access to at least read from the directory where you've deployed. Did you do this already?
Do you have .NET 4.5 and MVC4 installed on the server? If not, are you expecting those DLLs to be "packaged" with your deployment? They generally are not since they are "standard" assemblies. But if you want them to be included in your deployment you can do that by selecting the references in VS and saying "copy." This is not recommended because when you install patches to .NET and MVC on the server, those updates will not carry through to your app, since it'll use the local (old) copies of your assemblies.
This may be more of an IIS issue, but not sure based on the details in your question.
Check that the application pool that the site is running under is using .net 4.0.
Just a thought I would check.

Can I compile and run a MVC1.0 application under .NET 4.0?

We have an MVC1.0 application that is compiled against and runs with .Net Framework 3.5.
The application was scanned for security and the scanning organisation reported
Microsoft ASP.NET ValidateRequest Filters Bypass Cross-Site Scripting
Vulnerability
https://community.qualys.com/docs/DOC-3495
What versions of Microsoft ASP.NET are vulnerable? Microsoft has
confirmed that ASP.NET versions 1 and 2 are both vulnerable.
Additionally, Qualys has confirmed that ASP.NET version 3 is also
vulnerable, as it includes the vulnerable component from version 2 by
default. We have tested this in our Labs and confirmed the exploit
works on a fully patched version 3.
We are already upgrading our application to MVC3, but that takes some more time to finish.
Is there any chance I can run and compile a MVC1.0 application against .NET 4.0?
This may arise compatibility issues, Even though there are very few dependencies over the .net framework.
You can refer the following posts.
Is ASP.NET MVC 1 forwards compatible with ASP.NET MVC 2?
ASP.Net MVC 1.0 in Visual Studio 2010
From what I understand, anything that runs on .NET 3.5 should function and complile just fine in .NET 4.0, with perhaps some warnings about depreciated functions, but they will still work.
In case you are still curious/not comfortable, there are some tools available to help verify dependencies and other items such at NDepend
Best recommendation... try it! I can't think of any other reason than what Tommy mentioned about deprecated functions. Also, you can update most of your references with
Update-Package
without arguments.
If it compiles fine, do a quick test run over the views. If nothing seems broken, then it probably isn't.

Is there a certain IIS configuration required to allow a functioning .Net 4.0 ASP.Net MVC 2 Azure application?

I just installed the Azure 1.2 tools update and would like to get to work on an Azure project running locally using ASP.Net MVC and .Net 4, but I cannot get MVC pages to load.
If I just create a new Azure project in VS 2010, add a ASP.Net MVC web role, and run the application, pages never load. It appears that routing is somehow at fault as controller actions never get called, but if I add other pages to the project (like .htm or .aspx) they will load in the browser.
It all works fine with a new project using .Net 3.5, MVC 2 project in the Azure development environment; it all works fine with .Net 4.0 MVC 2 project that is not running in Azure; only the combination does not work.
Environment is Win 7 x64 (IIS 7.5), VS 2010, Azure tools 1.2
Is there some magic IIS setting I need to change or something? Any ideas?
Check if you have "HTTP Redirection" feature enabled.
See here

Resources