updating .net 4 site - asp.net

Ive just made live a site for a client,
I need to now update it with both design and logic changes.
WHats the best way to do this? Never done it before.
I know I cant just overwrite the amended aspx and aspx.cs files, tried that and although the design changes take effect the coding doesnt.
Any info appreciated
thanks

You need to rebuild the binary in Visual Studio, and upload the DLL to the bin folder. The cs files don't even need to live on the server.

Related

After MVC3 publish, just update the views

.NET/MVC3 newbie, so please bear with me!
I've searched for this answer all over but cant find exactly what im looking for, so here it comes...
Lets say that i'm developing an MVC3 app with Visual Web Developer Express and i go about deploying the site using the built in publishing tool.
But now that my site is up and running i find that i need to make a minor adjustment in one of the views. I update the view and save the file, and use my FTP program to upload the new file.
The problem is that MVC3/.NET doesn't seem to refresh/change the view, because it's still using the old version.
Of course I have tried refreshing (in many different browsers even), but it still won't load the new view.
Is this normal behaviour, meaning that i have to publish every time i make some minor adjustments (kinda time consuming)? I really can't imagine that this is the case, so i'm wondering if you could shed some light over this?
Appreciate any replies!
/Mikael
If you upload the view (.cshtml) file and that is the ONLY part of the application that has changed, a refresh will reflect the change - you may have to ctrl+f5 to clear the temp cache. However! If you change ANY of the controller code or action code, or any c# (or vb if thats what you use), then you MUST re-upload the compiled .dll associated with the entire application in order for the changes to be reflected.

Is it possible to restore the source code (Models, Controllers) of an application, from the files on the website (when Publish has been used)

I have been working on a MVC 3 application on my laptop, which now has crashed. I have uploaded the newest edition of the site through the "Publish" method in VS2010. Is it possible to retrive the source code of the application? Because i cant see the Models or Controllers on the FTP.
Thanks
I have used a decompiler before to get back source code from a compiled website.
It doesnt give you the files all nicely ready to start developing again, it is a bit pain staking going through the decompiler and getting all the code you need out. But it can be done.
I cant remember which one i used, im sure a quick google will give you loads to choose from. I think there might even be one shipped with vs.

Creating multiple dlls for each web page in asp.net

The way we have to update our site now is to create a copy of the website project locally. Make changes. Then take the dll and any other new files and copy them to the project on the server. Sometimes they want us to work on something they need uploaded right away and other times work on something that needs to be uploaded in the future. So I have to do silly things to give them what they want now and exclude what I am working on for later. What is the best way to resolve this? I just wanna have to upload a piece of the project and certainly not the a whole new dll everytime.
source control w/ branching. Then you can keep the production branch clean while you work on your future enhancements. There are plenty of great free source control tools, see below.
Git
Subversion
Mercurial

Possible to turn off App_Code auto-compile?

Working with Visual Studio (I'm using 2008) I have started to notice that when you save a file in the /App_Code folder, the program will hang for a bit before returning control. After a bit of research, I have learned that there's an auto-compile feature at work, which I assume is what is slowing down my system.
So the question is this: Is it possible to turn off the automatic compiling of files in the /App_Code folder? Or, even better, is there a way to reduce the time that it takes, or make it work a little more smoothly in the background? Any thoughts/ideas are appreciated!
Sorry i don't know of any way of switching off compiling the app_code folder. If its an issue I would try to keep the amount of files in this directory down to a min or even move them out to a seperate library.
ScottGu has some good tips that you might find useful.
https://weblogs.asp.net/scottgu/Tip_2F00_Trick_3A00_-Optimizing-ASPNET-20-Web-Project-Build-Performance-with-VS-2005
No you can't turn off app_code folder.

Creating project from existing IIS/ASP.NET website, building stuff

So I'm left maintaining a proprietary codebase from a third-party vendor. The vendor is still sort of around, but support is limp. The site is ASP.NET.
I have made some changes but I am having a really hard time getting IIS to compile these changes in. The bin/ directory has what I believe is a precompiled dll for the core classes. I've changed these but it doesn't recompile. I have tried deleting the dll but then the app refuses to build saying that the Global.asax can't inherit the type anymore, so I don't really know how to rebuild with changes.
I spent all day Saturday setting up a build environment and trying to get a testing thing working. I have just been importing into VS2008 as a web site from the local IIS server. I got it to rebuild the app without changes, but it ignores changes I would place in it.
So I need to make a solution out of this website and/or directory structure so that I can do actual, big, full grown-up rebuilds and make changes to this codebase. Anyone know how I can go about this?
EDIT: A bit more elaboration. I've tried creating a blank project and just Add Existing File... on the whole website directory. This hasn't worked, it stops the import about 10% in.
Keep in mind there are two (actually, three) levels of 'builds' or compiles going on here.
1) The DLLs in the /bin directory should be pre-built, by visual studio or otherwise. The content of .ASPX, ASCX, ASHX, ASAX etc fiels are not included in those.
2) The ASPX, etc files I noted above are then compiled by IIS when the first request comes in (normally; there are ways to change that behavior). That is the source of the error with Global.asax you are seeing; With the DLL(s) gone, the class that Global.asax is supposed to inherit from does not exist.
3) Then there is the just-in-time compilation, which is not relevant for this discussion.
It sounds like you may be missing the source files for the project, or perhaps the web site is not getting properly set up as a project to compile that DLL
Try these links, I suppose this is what you are looking for.
http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/01/20/linking-files-in-visual-studio.aspx
http://support.microsoft.com/kb/306234
Not sure this question is really valid anymore. The source we were working with was rather different than it should have been. Not sure if someone got angry in the past and moved stuff around or what, but grabbing a new copy of the source fixed most of our issues. I am able to build now with an included csproj.
This doesn't really help many others with the same issue I suppose, but if you are getting weird build behavior like this, you might want to start with basics, like making sure that your source checkout is valid.
I am new in asp.net so I am not sure it is a professional way or not.
I have the project without .snl file. I just create a empty web site and then paste the files inside the folder where I created the project.
It worked for me.
I think pasting the files and folder directly by file manager will help you.

Resources