Link remote site to visual studio 2010 - visual-studio

i developed a site in my local laptop. The site is quite in an dvanced stage so i'd like to test it in the remote server where it will be once finished.
I use visual studio 2010 and i was asking myself if it was possible to leave the site in the server and go on developing it in my machine without loosing syncronization.
I mean, suppose i find a bug while navigating the site from my laptop. I would like to fix it without copying the site locally, and then put it back on the server manually.
Is this possible with Visual Studio 2010?
Some more info:
The site is hosted locally in C:\Mysite\ and in the server in C:\Mysite\ (the same directory).
I can connect to the server with remote desktop but the connection is authenticated (of course)... I wrote this in case it's useful information.
Thanks in advance!

You can, by simply selecting Open -> Website and choosing from FTP or Remote Site in the directory browser.
However, just because you can doesn't mean you should! Keep a development and production copy separately.

Open VS2010 and then in File menu choose Open -> Website -> Remote site.
Then enter your remote address and it's done, you can work on your remote site as if it was local.

it is not a good idea to publish your code directly to your server. However if you would like to do it, you can think of setting up continuous integration process. Whenever you commit the code, you can run a msbuild or nant script which gets latest code changes from source control and push to the server. You can also sse something like webdeploy... which ideal for web projects...

Related

How to deploy a Web API to my web host?

I'm building a RESTful Web API on my local machine and it works nicely. I want to put it on my GoDaddy web host account now. I did this once by copy and paste file by file to the FTP site they gave me. That worked, but it is slow and painful to do and to update when I make changes. Is there a quicker way to publish (in Visual Studio) from my local copy to my FTP site? If not, can you tell me which files I need to deploy for the Web API to work? I don't think it needs all the .cs files, but I'm not sure what files it must have.
OK, I found this link about publishing a website in Visual Studio:
https://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k%28WebApplicationProjects.PackagePublishOverview%29;k%28TargetFrameworkMoniker-.NETFramework
It didn't really solve everything for me, but I started playing around with the controls in Visual Studio. I was able to publish my local website to FTP by right-clicking on the project node in Server Explorer and click Publish... or click Build -> Publish in the Visual Studio menu. Fill in your FTP connection information, enter the target folder under Site Path and leave Destination URL blank (don't know, don't care). I also unchecked "Include all databases..." in the Project Properties Page for Package/Publish Web because I didn't want to rebuild my destination database. It worked.

How to debug ASP site without port number on VS 2012 Express

I'm trying to debug an ASP.NET 4.0 web site using Visual Studio Express 2012. I've configured the project settings to use the local IIS web server which was installed with VS. I need to use IIS so that urlrewritingnet will work.
I need to run the site locally without a port number. Currently it runs as http://localhost:4652/ which breaks some of the routines since they reference Request.Url.Host. This results in attempts to access resources using http://localhost/.
There is a lot of code to this site and it would be extremely easier and quicker (I think) to just configure my local debug to run on localhost instead of localhost:4652. Is there a way of doing this?
Since it's IIS Express installed with VS there is no configuration manager for IIS. When I click PROJECT -> mysite Properties and change the Project Url (under Use Local IIS Web Server) to http://localhost/ I get a warning that reads:
The local IIS Express URL http://localhost/ specified for Web project mysite has not been configured. To keep these settings you need to configure the virtual directory. Would you like to create the virtual directory now?
When I click on Yes, I get another dialog box saying:
Unable to create the virtual directory http://localhost/
Does anyone know if this should or should not work and if it can work, how do I do it?
You can go to "user/documents/iisexpress/config" then open applicationhost with notepad or other relevant editor then go find "bindings" then change the value of bindingInformation into "*:80:localhost". Done
Its really simple. You need to attach the IIS process to the visual studio and browse the website.
Below article guides to achieve this.
http://www.codeproject.com/Articles/37182/Debug-your-ASP-NET-Application-while-Hosted-on-IIS
Its always a good practice to do a unit test of web apps to local iis while developing.

Prevent visual studio 2010 start a local IIS

I have a solution with many types of projects, and some of them are websites. Usually, I debug a non-website projects, but everytime I start to debug any project in the solution, the local visual studio IIS starts runnning.
Is there any possible way to stop running the IIS server ???
Thanks!
Open your project and go to the projects Properties. In web apps, you should see a Web tab/choice. Click that, then you can configure which/what server you want to start. I think that the default is that VStudio likes to use it's internal IIS Express, but you can configure it to use IIS locally on the box or to use a custom server.
You can actually set the project to not start anything in the Start Action section on that 'tab' as well, and to simply wait until it registers a connection.
Note that if you are trying to debug using a non-local server, then remote debugging will have to be on on the server, which isn't a great idea in production environments.

Deploying from VS 2010 using XCopy

I think this is a simple question, but I can't seem to find a clean solution.
I am working on a parallel program on my local (dual core) developer machine. I develop for a while, then I want to run it on a multi-core server somewhere else. I have a settings file that is different (paths, etc.) between the two instances, but otherwise it is a straight deployment.
What I would like to do is have a "publish" option where I can just deploy it to server when I am ready. I don't want it to overwrite the settings file on the server, but I do want it to update any other files. I publish a ASP.NET web site this way and it works great. However, when I publish a console app, it wants to actually create an installer, which I don't want. I really just want an XCOPY publish over FTP, but one that won't overwrite changed files on the server.
I've tried subversion, and some FTP syncing things, but those all require an extra step. Is there an easy way to do this?
Not 100% sure what you're after, but WinSCP (free) has a directory synchronisation feature, which monitors a local directory for changes, and FTPs updated files to your server.
You can't do the type of publishing you want with a console app in Visual Studio 2010. It will always try to build a click once deployment which isn't your goal. I think this thing was possible to do in previous versions of Visual Studio 2010.
I have a similar situation and I just resign myself to copying in windows explorer for local servers. With your destination being an FTP site you will need to find some sort of automated or batch FTP utility unfortunately.
You could launch the ftp batch from the "Run the post-build event" feature in the Build Events tab on the console app's property page. That would save you some extra clicks.

Visual Studio: testing on different a server than developing on

In dreamweaver, it's really simple to set up a site so when you test a page that you are developing that it deploys it to a different test server that you are developing on and then browses to that page at that location also.
Question: Can you set up Visual Studio so that when you "run" or "View in Browser" that it automatically pushes the pages out to the test server and then browses to that location as well?
You've got two options as far as I can see:
1) Create a local project and set it up to run from your own local IIS, (this is not exactly what you're asking, but it should be more of an apples to apples test, as opposed to the built-in visual studio web server).
2) Use Remote Debugging to attach your Visual Studio instance to a remote server, links here and here
With option two, you'll still likely need to publish/deploy your solution to the server each time, but you will be able to step through and debug your code running on the remote server.
I think you can use an FTP project (File>Open Web Site and then select FTP) - as far as I'm aware, when you save a file it's automatically uploaded to the specified server. Then you could just point your browser at that web server.
I don't think this is possible,but you can always set up a shared folder where you put your code, and that shared folder is in fact the folder where your web server expect the code to be.

Resources