locked
Publish Selection not publishing all files RRS feed

  • Question

  • User1091983910 posted

    I am new to Visual Studio and Publishing to a website.

    I am using a File System method to publish.    I was able to get the initial web form pages and associated files published to the server.    But now that I have made changes to the code for the page in the CodeBehind file,  I cannot get that file to publish over with the changes.   I added some new controls to the page and I can see them now on the website.

    I am in Release Mode.

    I know that the aspx.cs file will be compiled into the DLL file that is in the bin folder.

    I have tried many ways of getting the updates in the code file to work on the live server. It does work on the Local comptuer in debug mode.  But not on the live web server.

    I have tried to delete the dll file on the server and manually move the dll file from the local source to the server.  And that did not work.    I tried cleaning the solution thus deleting the dll file ont he local source.  Then run in debug mode to create the dll.  then I manually moved that to the server.   That did not work either.

    The next thing I tried was changing the first statement in the main aspx file.  I changed the "CODEBEHIND"  to "CODEFILE"   Then I went to the webpage and got an error saying it could not find the aspx.cs file.   This did not surprise me based on what you had said in the initial part of this thread.  But then I manually put the aspx.cs  file on the server.     And now it works.   I know this is probably not the correct way to do this.  And when I move from our staging server to the production I know I will not be allowed to do this.

    it seem that the original problem is that the publishing is getting the original dll from some bin location that is initially created on the first build.   Someone suggested that I check in my User Profile and see if there was anything in MY documents.  I did see a folder for the project  but this is not where I have the project stored.  And other than the folder being created there was noting in the folder at My Documents.  

    I really would like to stay in the Codebehind mode  since I will not have to manually move the aspx.cs file when I do the publishing (that file does not get published.

    Any help would be greatly appreciated.

    Monday, March 17, 2014 11:14 AM

Answers

  • User-1454326058 posted

    Hi,

    Thanks for your post!

    For that scenario, you should build the project again, then publish that project again. After that you could use the newer published files on the server.

    On the other hand, you also could use Web Deploy publish method to publish the project. For more information please refer to:

    # Deploy a Web Project Using One-Click Publish in Visual Studio

    http://msdn.microsoft.com/en-us/library/dd465337(v=vs.110).aspx

    BTW: If you want to use the entire project on the server, you could copy the project folder to the server directly and configuer the website in the IIS with that file.

    Thanks

    Best Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 18, 2014 3:36 AM

All replies

  • User1091983910 posted

    Oh I forgot to ask  that maybe it is the way our server is set up?   It does not like the CodeBehind option.   COuld that be something too to look into?

    Monday, March 17, 2014 11:38 AM
  • User-1454326058 posted

    Hi,

    Thanks for your post!

    For that scenario, you should build the project again, then publish that project again. After that you could use the newer published files on the server.

    On the other hand, you also could use Web Deploy publish method to publish the project. For more information please refer to:

    # Deploy a Web Project Using One-Click Publish in Visual Studio

    http://msdn.microsoft.com/en-us/library/dd465337(v=vs.110).aspx

    BTW: If you want to use the entire project on the server, you could copy the project folder to the server directly and configuer the website in the IIS with that file.

    Thanks

    Best Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 18, 2014 3:36 AM
  • User1091983910 posted

    The rebuilding did not work.  But the link that you sent about Deploying a web Project has been really helpful.  Especially filling holes of knowledge.  THanks again.

    Friday, March 21, 2014 3:06 PM