About the deployment of website to IIS - c#

I have created a website and deploy it on the IIS server. I want to change some code on the
the default.aspx. After I change the code on my own computer. I copy the default.aspx and default.aspx.cs file to the server. But seems don't work on the server. But the website work perfectly on my own computer. I would like to ask do I need to copy files other than the default.aspx and default.aspx.cs? Thank you

Depending on the project type, you need to deploy the assembly into which the changes were compiled. If this is a web application, the web project should have a corresponding DLL.

Is it a web site or a web application project in VS? It sounds from your brief description that it maybe a web application (code behind file) so once C# code has changed then you will need to compile it put the default.aspx and the newly compiled dll up on your hosting.
HTH

You also need to compile your solution and put latest dll of the project containing Default.aspx file, in server's bin directory, since you have made changes to code behind file Default.aspx.cs.

upload dll if you change code behind and aspx if you change design
load your page on browser,if nothing has change press "ctrl + f5" to clear cache and refresh your page

Related

Source file issue with File Upload Control

I have a problem with a web form project.
The project is set to use the local IIS web server to run the application.
In the form, I have a file upload control defined in the aspx markup page.
However, when I try to upload a file, the program always thinks that the file is located in the IIS Express folder, whatever the location of the file actually is.
I have tried to change the settings to make it use the visual studio development server but I hit the same issue. The program then always thought that the file to upload was in the development server folder.
How can I fix that?
Thank you.

updating published asp.net website

I just publish an asp.net website then i made changes in its source code i added two .aspx files and then publish it again
The question is what I need to make this changes take effect on server. Do I have to replace all files or i can just add specific file?
I'm trying to add two aspx pages to the site that already exist on the server
and want to know which file i have to add beside the ordinary aspx file to take effect on site
Thanks
This depends on how you are deploying your code. Are you using the precompile option before publishing or just publishing with pre-compilation.
If you are just publishing then you can just replace the .aspx and aspx.cs files and the site will dynamically recompile.
If you have pre-compiled it then you are probably only left with .dll files and .aspx files so you would have to deploy a new copy of the .dll file for your site and the .aspx files. MSDeploy replaces the entire site by default.
If you have only changed the aspx file and not the code behind it is enough to publish those two files and on the server. If you have changed the code behind as well you also need to publish the dll files, in that case it's probably easier to replace all of the files.

Dll of a single C# code behind page

I a using ASP.net website - 3.5 C#
I have a modification in a .cs page, I have to deliver only updates for this code behind file only to client. Is there any way to create dll for this page in the website ?
No, it is impossible to create an assembly from a single code behind page that is part of a website project.
The web project gets compiled into a single assembly - all code behind files become part of this assembly. An update to a single code behind file means that you need to recompile the project and deploy the updated assembly.
If you can change the project from a website project to a web application, this would be a different matter, as IIS would compile all code behind files on the fly, so updating a single code behind file is possible.
To create an assembly you will need to create a project class library project. In this project you will create your .cs class file. When you build this it will produce the DLL file.
Unfortuantely you cannot create web pages in this type of project.
Now to use this in your website you can either add a project reference to this class library project, or add a file reference to the DLL it produced
Select the highlighted part as mentioned in the screen shot and Publish it.

aspx unable to locate code behind

I am able to execute my application fine using the Visual Studio IDE but when I create a release package and put it on the web server it can’t seem to find the code behind. However, if I copy the bin folder (which has the dll files) from the root directory and put it into the “root/reports” directory, everything works fine. The reports directory has all the .aspx web page files. What is causing this problem and what can I do to properly fix this problem?
Since you have published your website, that means your code files were compiled into a DLL. To work properly you have to put your DLL's into the bin folder on your host server.
For Details, Check this link:
An Overview of ASP.NET Code Generation and Compilation

Error: Could not download silverlight application. Check web server settings

Developing a silverlight page in already existing web application for previewing video files. When I create a asp.net application locally and add silverlight application on the solution it works perfectly. But while I am trying to include into already existing project it throws this error. I have not deployed into the IIS. this happens while debugging.
Check the path to your xap file in your webpage. It should be something like:
/ClientBin/my.xap
Also ensure that your xap file is actually in the ClientBin folder. In the web application Properties, choose the Silverlight Applications tab and add the silverlight project to the list.
Although probably not applicable in your case, this can also occur if you are using iis and haven't registered the correct mime type for .xap files. It should be set to application/x-silverlight-app.
This is little same with another answer, but I give my detailed solution with image of setting.
In my case, one of my aspx page will load Zip and Xap files under ClientBin Folder, normally it'll load 20 Zip/Xap files under ClientBin\,
But I found that when building/publishing the project, the Zip/Xap files are NOT output to ClientBin\, that is ClientBin folder is nearly empty.
So my solution is to let the Zip/Xap files output to ClientBin\, to do this, the setting way can see this article:
https://social.msdn.microsoft.com/Forums/silverlight/en-US/d8e2c92a-4b31-4e4b-a440-4960a8d475b4/how-to-generate-xap-file?forum=silverlightstart
Besides here is the screenshot of my setting, that is Right click at your Silverlight project > Properties > Silverlight Application, and you can click the Add button to add content,

Categories

Resources