15

I have always used the express versions of Visual Studio for my Asp.Net projects. In the past, I would use a basic FTP synchronizer to push updated files (*.vb) to our server, then the changes would just show up on the website instantly. Now, for some reason, when I make changes to our *.vb files, they are not being reflected on the server after I synchronize over ftp, unless I build the project first. In addition, for our .Net 4.0 project, VS 2015 14.0.23107 is adding the following directories, with tons of stuff inside of them:

/.vs

/My Project

/Obj

There are loads of files within these directories which I have no idea what they do, and for some reason our project has taken on a completely different behavior. Now when we try to synchronize over FTP, there are a ton more files, and it seems that changing the actual underlying source doesn't work. We have to synchronize all the other files in the above directories, then we can see the changes.

Is this a new way they are doing things, or is this because VS is now free and we are getting a better version where we have to "publish" not "synchronize?"

Is there a way to go back to the simple way of doing things, where we just have a plain directory with our source files and sync them over to the server? Should we not do it this way? If not, what method should we be using and what files should we be pushing to the server?

4
  • 2
    and why dont you want to use the publish feature of Visual Studio? it works very nicely. Honeslty I don't get why would you upload .vb files anyway. What matters is the compiled dll's and resources, so basically all you need to copy you'll get after building. If you want to build it agin on the server, then well, copy all the source files, Obj you can ignore. No idea where you got the MyProject folder from, though :) Anyway as long as you use asp 4.0 nothing changes
    – mikus
    Oct 28, 2015 at 17:09
  • I've been doing it using the free version for the last 10 years, and there was no publish capability... Oct 28, 2015 at 18:53
  • time to change your habbits, use publish, if only the numerous files are your issue with previous method.. then well, dont synchronize them And honestly, synchronizing source files through ftp... that's pretty bad. If I had to, I would plug server into source control
    – mikus
    Oct 28, 2015 at 19:43
  • @Dude2TheN just because you've been doing something for 10 years doesn't mean it was ever a good idea. Exposing your code to everyone is a nice way to get hacked and causes delays because of compilation. That's why ASP.NET compiles the code to dlls Nov 4, 2015 at 12:24

3 Answers 3

13
+50

I'll just promote my comment to an answer. There are several aspects of this question:

  1. Use publish, this feature is already for long available in Visual Studio and works well. There is plenty of ways to customize it and it supports a lot of technologies, including FTP. It's also more convenient, systematic and reliable way of deployment than manually copying files to your FTP. You can also share your publishing configuration among developers and store several of them. No loss here.

  2. I don't quite get why would you like to copy the source (.vb) files to the server. What you would usually like to achieve is to get compiled DLL's + resources copied to your server, and source files 'secure' on developers machines. You can compile your sources on the server if you really need it, but then just plug it into a source control, use ms build etc. Anyway, build/publish actions are there to prepare the deployment files for you, manual copying is pure bad.

  3. For the new folders:

To sum up, as long as you use asp 4, 4.5 nothing changes. Only the 5.0 intruduces a bit different rules for deployment. Most of the problems you get are easily solved using the right tools (Publish). It will know what files to ship (binaries + resources included in project) and what to ignore (source files, caches, crap). It's convenient, less error-prone and can do much more for you.

1

Definitely, use "Publish" option (right click on your web application at solution explorer, under Run/Build options), thus you can update your server site with those files created on Publish. As Mikus mentioned, you DON'T need vb files on your published site, you just need dll's and resources (images, js, css, resx, e.g.).

Regards, hope it helps.

0

Use the Publish Option which is provided by Visual Studio.

This will compile your project and you can then host this in your reliant manner.

I personally host on IIS and considering I have no data stored locally I can publish directly to the published path on the IIS Server.

The Publish tool is very simple and only takes a few minutes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.