MVC :: VS2010 IIS7 Publishing Problem - Not All Files Transferred?
Jan 18, 2011
I've been building an MVC 2 site on my local machine which I then hoped to FTP to my companies IIS7 server.
When I first started using the MVC in VS2010 I published in VS via FTP and everything was fine, asp.net was properly installed and the mvc library was there.
Now I'm faced with a problem that I can hardly define, let alone get around:
When I attempted to publish, the controller folder wasn't being transferred, so I manually copied it across thinking it was just an FTP problem, but then I got errors complaining about an assembly reference in my web.config file:
Parser 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.
So I'm guessing that whatever it is that is preventing VS transferring the controllers folder is doing the same with some of the MVC configuration stuff.
Another oddity is that thought the initial settings worked, I've since scrapped the orignal project and started again, I've had a look back at it and tried to use the original settings to FTP across but they now don't work and have the same problem, as does my bosses machine(previously unused version of VS) when I tried to FTP across the default MVC2 project.
VS reports that the FTP publish has succeeded and the controller files aren't listed in the Publish.XML file on either machine.
there is probably a really simple answer to this, but I have the flu and can't think straight. I am taking advantage of being out sick by downloading VS2010RC and playing around with it. I created a simple WCF service (my first in this foundation, but not my first service). Its a redo of an existing asmx service I created a while ago. I commented out all the processes, and am simply trying to publish the service to my local IIS7 to see the discovery working. I have setup a new site to host the service ( I tried using Default as well, with the same results). I right click the project in VS and select publish. It is prompting me for a login even though the site is setup for anonymous access. If I try to use WebDeploy, it can't find my site, and if I use FileSystem, it give me a simple "Publish failed" with no details. Can someone point me to a tutorial or something that describes the publish process in VS2010 or give me some leads as to what setup needs to happen either in VS or ISS to let me publish?
I have a web application and when I decided to test on IIS 7 i have this Exception when trying to load a couple of pages that uses Entity Framework 4. I use EF 4 with my own CRUD assemblies but sometimes using the EntityDataSource. I have noticed that the problem is not appearing in all my Web Pages but I think in those that I use the EntityDataSource.
Here's the log from a Page:
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) at System.Reflection.RuntimeModule.GetTypes() at System.Reflection.Assembly.GetTypes() at System.Data.Metadata.Edm.ObjectItemConventionAssemblyLoader.LoadTypesFromAssembly() at System.Data.Metadata.Edm.ObjectItemAssemblyLoader.Load() at System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, ObjectItemLoadingSessionData loadingData) at System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, KnownAssembliesSet knownAssemblies, EdmItemCollection edmItemCollection, Action`1 logLoadMessage, Object& loaderCookie, Dictionary`2& typesInLoading, List`1& errors) at System.Data.Metadata.Edm.ObjectItemCollection.LoadAssemblyFromCache(ObjectItemCollection objectItemCollection, Assembly assembly, Boolean loadReferencedAssemblies, EdmItemCollection edmItemCollection, Action`1 logLoadMessage) at System.Data.Metadata.Edm.ObjectItemCollection.ExplicitLoadFromAssembly(Assembly assembly, EdmItemCollection edmItemCollection, Action`1 logLoadMessage) at System.Data.Metadata.Edm.MetadataWorkspace.ExplicitLoadFromAssembly(Assembly assembly, ObjectItemCollection collection, Action`1 logLoadMessage) at System.Data.Metadata.Edm.MetadataWorkspace.LoadFromAssembly(Assembly assembly, Action`1 logLoadMessage) at System.Web.UI.WebControls.EntityDataSourceView.ConstructContext() at System.Web.UI.WebControls.EntityDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) at System.Web.UI.WebControls.DataBoundControl.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at System.Web.UI.WebControls.FormView.DataBind() at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() at System.Web.UI.WebControls.FormView.EnsureDataBound() at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
I think its the EDM problem but I can't get through. I should mention that in my development pc is working all perfectly!!!
My controls are DevExpress but I dont think this should play any role!
[EDIT]
Forgot to mention that I use Self tracking Template with the Entities.tt in a separate assembly!
[EDIT 2]
On my local Windows 7 IIS works OK! It's Windows Server 2008 I can't get it done!
I use VS2010,IIS 7.5,just created simple ASP.NET WebForms Application,created ASP.NET 4.0 pool with .NET 4.0 setting and trying to Publish this site IIS.
Successfully published, but when I open this site in a browser, see error: XML Parsing Error: no element found Location: http://localhost/wa1/Default.aspx Line Number 1,Column 1:
Who knows where is error?I was looking on this site for an article about publishing in ASP.NET 4.0 and VS2010,but seems like there is no sperate article about it.I am installing VS2008 and going to try the same.
After seeing the Hanselman "You are doing it wrong" video I start to use the Web Publish feature of VS2010.
What I'm really missing is that the websites sometimes gives errors while the site is publishing because the feature does not copy the app_offline.htm file to the server.
I do not want to start using MSDeploy scripts, because I have several sites and want to keep it simple.
Maybe there is a simple tweak to tell the wizard to copy and then delete the file.
I am Publishing a MVC project which contains a folder with a few CSV files.These files are included on the project.However, when I publish it these files are not copied
I am Publishing a MVC project which contains a folder with a few CSV files.These files are included on the project.However, when I publish it these files are not copied. They are ignored.
As this files are unwanted, are not required for application to run properly, i put delete command on post build event to remove them :
<code> del "$(TargetDir)Microsoft.SQLServer.Replication.dll" & del "$(TargetDir)Microsoft.SQLServer.BatchParser.dll" </code>
The problem is, as i understood the publish process does: 1. Build, 2.Publish, 3. Post build, so these files are alwasys published on server and causing problems on every publish to our QA server. Is there any way to avoid removing files manually, except for first publishing on the local fs, then use some sort of ftp deployment script that would first delete files, and then push them to server.
i have developed a web site first time when i build and publish web site i got precompiled pages.. but when i have made few changes on that n again try to publish it not giving pre compiled pages at destination folder.
I published my website on my local IIS and after a while felt like making some changes in it.
When i opened my website in visual studio i noticed there were no Page Code files (aspx.cs files) and not even my App_Code folder where i wrote custom code files.
I have a couple files that are missing after a I publish a web application project in VS 2008. I know that the files need to be included in the solution and they are. I have tried excluding them and including them to hopefully reset whatever is missing these files in the first plac but that had no effect.
Ultimately, I need this to work on the command line with msbuild.exe, but I get the same results when I publish through VS.
Knowing that the files are already included in the project, what else do I need to do to get these to files to be copied over in the publish/build?
I created a new project in both computers, i build it, i copied the 3 dll's files in the bin folder (System.Web.Mvc, System.Web.Routing, system.Web.Abstractions), and i publish them...., i go to my website [URL] both same problem "Page Not Found"
I tried many blogs...many advices...nothing yet...
In a webapplication we have a lot of images and some of them are not used/referenced anymore. Is there way (tool or something) to get a list of all these unused files or/and delete them?
I have a website on IIS 7. This website has a HttpModule with an AuthorizeRequest event handler. This event does not fire for CSV files and I can access the file without logging in, I guess this is because IIS7 is not configured to require form autentication for CSV files.
We are working on a web application that creates more web applications.Each web application will have to get a Url Rewrite rule (URL REWRITE MODULE 2.0).As far as I know, there's no way to add such rules without modifying the web.config file (am I right??).So my plan was to work with multiple web.config partial files. One main .config file, and lots of .config files per application (every file will contain it's web application url rewrite rules).This way sounds a little bit messy, but I can't think of anything else, and suggestions will be welcomed.
I have an ASP.NET master page which references a #include file as follows:
<!--#include virtual="/includes/scripts.inc"-->
I have modified the file /includes/scripts.inc but the changes do not show up in pages. What needs to be done so modifications will be reflected? I need to avoid the following: restarting the server restarting IIS modifying web.config (doesn't appear to have any effect) pretty much anything that causes the app domain to restart Any other options? Is there a setting which affects how long IIS caches #include files?
We'd like to restrict the maximum upload file size in our web site. We've already set the appropriate limits in our web.config. The problem we're encountering is if a really large file (1 GB, for example) is uploaded, the entire file is uploaded before a server-side error is generated, and the type of the error is different whether the file is huge or not. Is there a way to detect the size of a pending file upload before the actual upload takes place?
Here's my relevant web.config settings that restrict requests to 16 MB:
[Code]....
Update:
I know that client-side technologies like Flash can detect file sizes before upload, but we need a server-side workaround because we're wanting to target platforms that have no Flash/Java/ActiveX/Silverlight support. I believe that IIS or ASP.NET has a bug that's allowing large files to be uploaded despite the limits, so I've filed a bug here.
Would an ISAPI extension give me more control over request processing than HTTP modules and handlers, such as allowing me to abort an upload if the Content-Length header is seen to be larger than the allowed limit?
Update 2:
Sigh. Microsoft has closed the bug I filed as a duplicate but has provided no additional information. Hopefully they didn't just drop the ball on this.
We've got a process currently which causes ASP.NET websites to be redeployed. The code is itself an ASP.NET application. The current method, which has worked for quite a while, is simply to loop over all the files in one folder and copy them over the top of the files in the webroot.
The problem that's arisen is that occasionally files end up being in use and hence can't be copied over. This has in the past been intermittent to the point it didn't matter but on some of our higher traffic sites it happens the majority of the time now. I'm wondering if anyone has a workaround or alternative approach to this that I haven't thought of. Currently my ideas are:
Simply retry each file until it works. That's going to cause errors for a short time though which isn't really that good. Deploy to a new folder and update IIS's webroot to the new folder. I'm not sure how to do this short of running the application as an administrator and running batch files, which is very untidy.
Does anyone know what the best way to do this is, or if it's possible to do #2 without running the publishing application as a user who has admin access (Willing to grant it special privileges, but I'd prefer to stop short of administrator)? Edit Clarification of infrastructure... We have 2 IIS 7 webservers in an NLB running their webroots off a shared NAS (To be more clear, they're using the exact same webroot on the NAS). We do a lot of deploys, to the point where any approach we can't automate really won't be viable.
I'm using ASP.net 3.5 to run a .exe with Process.Start(). It works fine if I use the host that's built-in to VS2008, WinServer 2003 but if I use IIS7 it no longer runs. I am using the following code.
Process proc = new Process(); proc.StartInfo = psi; proc.StartInfo.FileName = "cmd.exe"; proc.StartInfo.Arguments = args; proc.Start();
I have an asp.net web page to serve large file downloads to users.
The page is hosted on IIS7, Windows Server 2008.
The strange thing is that users can download at good speeds (2MB/s) when I don't add a content-length response header but as soon as I add this header, download speed drops to somewhere around 35kbps/s.
This is the code:
[code]...
Of course I can leave the content-length out but the user will not know how big the file is and how long the download will take...which is annoying.
I have a simple web site with two pages. One displays a list of files, and the other streams a file when it's clicked in the list. All was fine in production for 6 months, but now I have to move the site to Windows 2008/IIS7. I have it mostly working, but the files don't open properly (in Firefox) because my content-type header is being ignored. On the production site (IIS6) the headers are (using Fiddler):
HTTP/1.1 200 OK Date: Tue, 09 Feb 2010 16:00:51 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Content-Disposition: attachment; filename="myfile__foo.pdf" Content-Length: 236841 Cache-Control: no-cache, no-store Pragma: no-cache Expires: -1 Content-Type: application/octet-stream
I have a problem with large respones and IIS7, the server runs out of memory. I've written the test code below that works pretty much like my real code... When i start to download the file i can se the memory usage rise until it hits 100% and Firefox complaints about lost connection to server, looks like IIS7 does not release cache or something.. Works in IIS6 by the way