Web application serves a DLL after setting up MVC 3 application in-side Sharepoint 2007 using IIS 7.5? - asp.net

I am currently working on an sharepoint 2007, web application and I am trying to create an MVC 3 site inside the same website which runs on .Net Framework 4.0 (Integrated Mode).
Initially we had issues to get it working as web.config (for the main site[Sharepoint 2007]) had dlls registered for .net framework 2.0, even for the MVC 3 application. We got this problem resolved by updating the web.config in the .Net Framework, so right versions on dlls where registered for .Net 2.0 and 4.0.
The problem was solved and I was able to get to the MVC and main site without any issues, now all of a sudden, after restarting my VM, when I visit my the main site, a DLL is served (yes, browser downloads a dll file !!).
This is the case with 3 other colleagues of mine. Any expert advice would be very helpful.
Thanks

Uff ! After a days of staring at IIS and extensive googling, it turns out giving 'Execute' permission to handler mapping for _vti_bin folder resolves the problem. I am surprised no one had this issue before, or may be it could be something to do with out rake script (deployment package- script).
Anyways thanks to all those who viewed my question. Hope this answer helps someone !

Related

ASP.NET MVC 6 using IIS to develop without publish

Is there any way to develop an ASP.NET MVC 6 beta 8 application on IIS without having the need to publish the application?
After install the httpPlatform module I am able to point IIS to a published application.
But how can yo point IIS to say your visual studio solution wwwroot so you can develop and see the changes you make without having the need to publish?
Is this no longer possible like how it you could develop asp.net MVC 5 apps?
For development is IIS Express and Kestrel the preferred way now?
Update:
I've tried to run both commands like the vs.net debugger shows but I still get bad gateway
You should read this.
I am currently using Visual Studio 2015 for developing MVC 6 (beta8) applications, and do not have the problem you describe. An MVC 6 application has a file that by default points to wwwroot folder (I do not remember now the filename), so you should not have problem in change code and hit F5 to see the changes, without publishing.
For anyone that is interested to get this working so that you have an edit and continue experience and don't have to manually build or publish your site and work against your source code:
https://github.com/tuespetre/dnx-watch-iis

Running IIS .NET4 Application under a .NET2 Site

Is it possible to host a .NET 4 application under a .NET 2 site?
For several reasons we have to run the main site on .NET 3.5, but there is an application written in entity framework 4, which hosted under the same domain/port.
When I try to add an application under the site (using a different .net 4.0 application pool), i get an error stating duplicate content in web.config. I have searched the net for fixes, but none of them seems to be working for me.
I am running a Windows Server 2008 R2 with IIS7.5
Any help would be appreciated.
It is possible to fix, if you carefully read Microsoft's document,
http://msdn.microsoft.com/en-us/library/a99txfy5.aspx
and
http://www.asp.net/whitepapers/aspnet4/breaking-changes#0.1__Toc256770150
No, that's not possible. An assembly compiled against .NET 4.0 must be run inside CLR 4.0. It is possible the other way around: run an assembly compiled against .NET 2.0 inside CLR 4.0.
No, the nested application will not be able to set a seperate framework version. I would suggest changing the version on the main site to v4. I don't think you should experience problems running a 3.5 app on version 4. What are your reasons for running it in 3.5?

Moving an ASP.NET project to .NET 4

I'm moving an ASP.NET project from .NET 3.5 to .NET 4.
Everything works beautifully if I'm debugging under web.dev (ie. in Visual Studio [2010]) but as soon as I try and run this under IIS7[.5] the debugger fails to attach. Running the project directly under IIS just causes it to throw back 403s (no subcode, so not much help there).
I setup the site by taking the current (and working!) .NET 3.5 site, and changing the AppPool to one with the .NET 4 runtime. I've confirmed that all file permissions are kosher (at least from the .NET 3.5 perspective). I feel as though I'm missing some configuration step here...
The error message when trying to attach the debugger is just "Unable to start debugging on the webserver." Not the most useful error message in the world.
Directly attaching to the associated w3wp process strongly suggests that the application is never spun up successfully.
The basic question is, how would I affect this change over from .NET 3.5 to .NET 4 for a project running under IIS?
Figured it out.
.NET 4 had not been installed for IIS purposes. Don't ask me why that was the case.
Running asp_net_regiis -i in the .NET 4 install directory (\Windows\Frameworks\v4.0.xxxx) under the Visual Studio Command Prompt (x64 in my case) solved the problem.
You cannot mix .NET frameworks in the same app pool. So ensure that only .NET 4.0 web sites are in your app pool.
Remember to set the web site/virtual directory to .NET 4 as well.
IIS7 has two options within a "website". In IIS6 you'd add a sub-app as a "Add Virtual Directory..." in IIS7 doing so forces you to keep the same AppPool and thus .NET framework version as the website.
But, IIS7 now has an "Add Application..." options, which allows you to essentially do what IIS6 had allowed, so that you can explicitly state the AppPool to run in and it can differ from the parent website.
Start a fresh project from scratch and just use the web.config there. Copy all your 3.5 pages in there and manually move over web.config elements that you need. The pages themselves don't require any converting, it's all in the web.config. The web.config for a .net 4.0 page is actually significantly smaller due to the fact that .net 4.0 is not just an extension of .net 2.0 like 3.5 is.

.net 3.5SP1 on a .net 3.0 Server - Is it possible to use the /bin Folder in ASP.net?

One of my Websites is on a Shared Hosting Provider, running either .net 2.0 or .net 3.0, but not 3.5 SP1.
I wonder if it would be possible to still use 3.5 SP1 by simply deploying all the 3.5 assemblies into the /bin Folder, since technically it's all still the 2.0 CLR.
I know that if my Host ever updates I have to remove them or else weird stuff can happen, and that I am driving into Unsupported-Territory at full speed, but is there any really big road sign that says "DON'T DO IT!" or even "That is not possible because of X"?
Primary reason is because I want to use ASP.net MVC and possibly ADO.net Entity Framework, but I do not want to make a contract with yet another Hosting provider.
Thanks!
In theory it can be achieved, but it's definately not recommended.
Scott Hanselman did a post on how to run ASP.NET MVC onto a server with other .NET 2.0 installed, see - http://www.hanselman.com/blog/DeployingASPNETMVCOnASPNET20.aspx
It's very much a "works on my machine" certified post though.
All DLL's on an ASP.NET site can reside within the /bin, provided they are correctly referenced. My suggestion - create a virtual machine (MS Virtual PC is free), install just .NET 2.0/ .NET 3.0 and then copy the DLL's you require from a .NET 3.5 install (tip - you'll find the DLL's in %program files%\Reference Assemblies).
I take no responsibility for the damage you cause to your provider from this answer
I'm pretty sure you can't do this, but googling on the following blogs may get you the definitive answer:
ScottGu
ScottHa
BradA
The problems would be, I think:
You want to load system.dll. Where does it look? does the GAC take precidence? (I think it does), therefore you get 2.0. So you have system.dll v2.0, and you try to use a DLL (eg system.web.mvc) which is bound to system.dll v3.5, but is only in you /bin.... it should explode loudly, not having the same contracts and the like.
Personally, I wouldn't try it, especially on production. But if you can take the site down for a while, give it a go. Worst case, you have to delete the files and re-upload the old site.
YMMV :)
I've successfully run some EntityFramework websites on hosts that only had .net 3.5 installed. I copied the System.Data.Entity.dll and the System.Web.Entity from Program Files%/Reference Assemblies. I also had to modify my web.config and remove the references to the System.Data.Entity and System.Web.Entity.
Update: this technique will not work for DynamicData or the EntityDataSource web control. I belive it has to do with the System.Web.WebExtensions.dll which already exists in the GAC from 3.5

.NET VirtualPathProviders and Pre-Compilation

We've been working on an application that quite heavily relies on VirtualPathProviders in ASP.NET.
We've just come to put the thing on a live server to demonstrate it and it appears that the VirtualPathProviders simply don't work when the site is pre-compiled!!
I've been looking at the workaround which has been posted here: http://sunali.com/2008/01/09/virtualpathprovider-in-precompiled-web-sites/, but so far I haven't been able to get that to work, either! (Well - it works fine in visual studio's web development server - just not on our IIS box - again!).
Does anybody here have any more information on the problem? Is it fixed in .NET v3.5 (we're currently building for v2.0)?
Unfortunately that is not officially supported. See the following MSDN article.
If a Web site is precompiled for deployment, content provided by a VirtualPathProvider instance is not compiled, and no VirtualPathProvider instances are used by the precompiled site.
The site you referred to is an unofficial workaround. I don't think it's been fixed in .NET 3.5 SP1

Resources