I created an ASP.NET MVC4 application using C# on Visual Studio 2012. But facing a hard time deploying it. I uploaded all the folders of my project onto my server (godaddy). But still cant view my website running.
My question: Is this enough to deploy my site ? Or anything else needed?
You can bin deploy an MVC4 app to GoDaddy.
Just copy the relevant MVC4 related DLLs that you need to your production bin directory.
Alternatively, you can set "Copy Local" equal to "true" in the Properties window for any of your MVC4 related project references as described in this blog post. Then when you do a Publish of your application, all of the needed assemblies will be included automatically.
You probably won't need all of these, but in an MVC4 app I currently manage on GoDaddy, I needed to manually include the correct versions of DLLs for:
System.Web.Abstractions.dll
System.Web.Helpers.dll
System.Web.Mvc.dll
System.Web.Optimization.dll
System.Web.Razor.dll
System.Web.Routing.dll
System.Web.WebPages.Deployment.dll
System.Web.WebPages.dll
System.Web.WebPages.Razor.dll
sure, you can deploy your MVC 4 application. Godaddy supports MVC 4.
What I have done to deploy my MVC 4 application is:
1. I included DLLs such as:
System.Web.Mvc
System.Web.Routing
System.Web.Abstractions
2. I edited web.config file. I put next strings:
<system.web>
<trust level="Medium"/>
.....
</system.web>
3. Then I used the File System publish method and then I used FileZilla to transfer the files to the GoDaddy. I copied all files to httpdocs directory. You must copy just to *httpdocs directory.*
That's all. Good luck.
Related
OK, I'm totally confused. I need to update an old ASP.NET Web Application but I'm totally unfamiliar with Visual Studio...
The updated web app uses some DLLs which are compiled as part of the solution and placed in the web app 'Bin' folder. Two of these DLLs require other files in the same folder.
My problem is that, even though I publish the web app (locally for now) with the option "Precompile during publishing", at run time these DLLs are copied to the "Temporary ASP.NET Files" folder without their supporting files.
Is there a way to have ASP.NET use the DLLs in the 'Bin' folder without copying them somewhere else? Or is there a way to 'attach' the supporting files to the DLLs so that they get copied as well?
And no, I have no idea what I'm doing at this point...
I found this unanswered question that is essentially the same thing (answers talk about properties I don't have).
We ended up adding an appSettings key/value to web.config that the DLL use to find the required files.
<configuration>
...
<appSettings>
<add key="sExeFolder" value="C:\Project\Support_Files"/>
</appSettings>
...
</configuration>
I have a site deployed on iis however I can't seem to edit any of the backend code when I export it from IIS as a zip file. Is there any way to do this?
This is a asp.net mvc3 application as far as I can tell
all you code-behind becomes in a dll after compile application and you can find its in the BIN folder.
I'm connected to a customer's site. There is a bug in an ASP.net MVC site i'm trying to solve.
As i make changes in the various .cs files, the web-server is not changing it's behavior. It seems that the web-site is determined to use the pre-compiled .dll files in the Bin folder.
How can i instruct IIS to recompile the web-site from scratch, in order to pick up the live changes?
I tried deleting my own .dll file:
\Bin\Contoso.dll
But then the web-site crashes.
Note: i am asking how to do this without access to Visual Studio; otherwise i would have changed the web-application into a web-site and redeployed.
You will need to recompile the dll with your changes from your development machine and deploy them. MVC ( I mean asp.net application) uses dll not source code. In short , what you are asking is not possible.
I understand that references are stored in the project (vbproj) file for ASP.NET web applications and the Web.Config (http://msdn.microsoft.com/en-us/library/37e2zyhb%28v=vs.71%29.aspx) for websites.
I have recently converted a website into a web application. I notice now that the web application will publish (using the Publish option) even if the version information is incorrect in the Web.Config, then when accessing the web application through a browser I get an error.
I was unable to Publish a website if the version of an assembly in the Web.Config was incorrect.
I read that web applications are precompiled (before publish) whereas websites are compiled the first time the website is accessed through a browser.
Therefore, I believe what I have said should be the other way around i.e. I should be able to publish websites with an incorrect version in the Web.Config (because they are not compiled) and I should not be able to publish a web application.
What am I missing?
After some further research; I have discovered that ASP.NET web applications are built using MSBuild and ASP.NET websites are built using ASPnet_Compiler.
ASPnet_Compiler looks in the Web.Config for referenced assemblies (add assembly tag) at build time, whereas MSBuild looks in the project file (vbproj) at build time.
Web applications are deployed without the vbproj. I believe the project file is used for linking. Therefore at runtime a web application uses the information in the Web.Config to identify assemblies to look for in the local bin folder and then the GAC (for aspx pages only)i.e. namesapces still have to be manually imported into the code behind partial classes.
If anyone has any comments or better answer then please post.
I have registerd my own domain name and web hosting space too on parallels
thay are having there plesk control panel.
I know that for html pages I need to copy my all pages into httpdoc folder
But what about by MVC WEBSITE?
HOW DO I HOST IT?
CAN ANYONE HELP ME?
To expand on the previous answers;
You need to ensure you are copying your websites 'bin' folder.
You may also need to ensure that the MVC assemblies are in it.
When you installed MVC on your local machine several assemblies are registered with the GAC.
It may be that your host does not have all the required ASP.NET MVC assemblies installed; if not then you will see a configuration error.
As these assemblies are registered in the GAC, the bin folder will not contain them by default.
Make sure your project explicitly references the following DLLs and make sure the Copy Local property is true.
System.Web.Helpers
System.Web.Mvc
System.Web.Razor
System.Web.WebPages
System.Web.WebPages.Deployment
System.Web.WebPages.Razor
Microsoft.Web.Infrastructure
Rebuild your project and check the bin folder. These files should now be present.
Upload the contents of this folder to your host.
you have to copy the whole mvc project into httpdocs folder to view it online.
You are getting the 500 - internal server error may be because the mvc version differs in the server(i mean may be you are using mvc v4 and the server has mvc v2).
So just contact your hosting provider, i am sure you will get a good solution.
I had the same problem with an MVC5 app using ASP .NET 4.5. To solve it, I used the Visual Studio publish Tool (Image1) right clicking in the solution explorer.
Then the Web App was published successfully.
you copy the whole project into httpdoc , then u must enable wildcard ASP .NET mapping for the website , ask your hosting system admin , usually they can do that
I'd suggest (from Visual Studio) using the Publish utility to actually upload your website. Plesk Hosting offers support for Web Deploy which is probably your best option, or alternatively you can pick FTP. When you use Visual Studio's publish, it should (I think) include the dependencies you have (in case you had anything in the GAC)
Select the following assemblies:
System.Web.Mvc
System.Web.Routing
System.Web.Abstractions
In the Properties window, set Copy Local to True.
then upload bin folder in mvc to the server. this may fix the issue