I am new to the Visual Studio 2013 IDE / Environment...
I have inherited an older (ASP.NET) web site that is currently being maintained using Microsoft Expression Web 4 (which is no longer supported by Microsoft). The test and production web sites are hosted remotely using IIS 7.5
I have two questions with regard to migrating from Expression Web 4 to Visual Studio 2013:
Is there any way to simply copy (FTP/download) the web site from the production server into Visual Studio 2013? i.e.: create a new empty web site in VS 2013 and then copy everything from the production web site. Will this retain “sub-web” folders, etc.? (I doubt it).
When using Expression Web 4 to publish pages to IIS – some of the files in Expression Web are marked as “Exclude from Publishing” (because some files like web.config differ depending if publishing to the test or production server). I have not found anything in VS 2013 for an ASP.NET web site project that allows me to set individual files so they are excluded from being copied to a remote web site. Does such functionality even exist?
Any insights would be appreciated.
Thanks in advance.
For #1 if you have Web Site project open in VS (not to be confused with Web Application project), you can right-click on it and choose Copy Web Site. This will bring up an window where you can connect to a remote site (e.g. with FTP) and sync files back and forth.
(Note: this feature is ancient and nobody knows about it anymore)
For #2, it depends. In the case of web.config, you can create a publish profile (right-click the project and choose Publish) that will let you use web.config transforms to modify the web.config file for each publish destination. Once your publish profile exists, you can right-click on it in Solution Explorer and choose Add Config Transform, which will only apply when you publish to that destination.
For other files you wish to exclude, you can modify the .pubxml file for your publish profile as described here using <ExcludeFilesFromDeployment> and <ExcludeFoldersFromDeployment>. (The blog post talks of editing the project file, but that's no longer necessary since VS2012; use the .pubxml files instead.)
Related
Any idea how to run ASP.NET 5 project in full IIS (not express) from within Visual Studio 2015 (via start debugging with F5 key)?
Atm I'm getting:
Couldn't determine an appropriate version of KRE to run.
I know it's not officially supported yet, but since IIS Express can do it, so should full IIS?!?
Let's say you created an ASP.NET 5 web application out of the template provided in VS 2015 Preview, then you can follow either of the approaches below:
Run the kpm pack command to create the deployable package with the appropriate options.
Example:
kpm pack --runtime KRE-CLR-x86.1.0.0-beta2-10690 --out "C:\MyWebApps\WebApplication1" --wwwroot-out wwwroot --configuration Release
Right click on the web application project and do a Publish to local file system directory.
Once the above step is done, in IIS, you can create a virtual directory application (or Website if you wish) to this deployable package's wwwroot folder. Example: "C:\MyWebApps\WebApplication1\wwwroot"
I just had a similar issue with beta4.
Note that the names have changed now so instead of a KRE it's now a DNX, although IIS was still showing the error calling it KRE despite this.
Anyway the solution for me was to:
right click the project in question in Solution Explorer
select "project name" Properties
tick Use Specific DNX version
tell it exactly which one you want to use, for me that was 1.0.0-beta4, .NET Core, x64
The project then ran in the browser for me.
I am trying to host a asp.net razor v3 website to IIS, but it is not working. I tried multiple options including first creating the website then publishing to IIS, or directly creating a new website under IIS using visual studio 2013. It gives me HTTP Error 503. The service is unavailable.
Methods to reproduce Error:
Option 1
1) Create a new asp.net web site (razor v3) in visual 2013, and click publish to publish to a directory. Then, add that directory as a website in IIS.
Option 2
1) On the new website window, in visual studio 2013, go to browse and select IIS, and create a virtual directory directory under IIS to save the site.
Then, go to the browser and try to access the hosted site: localhost/sitename, it always produces some kind of errors. Like 503. What am I missing? Please help, looks like I am missing some steps or some configuration changes.
Also, I am trying this with the default razor v3 webiste content and without modifying anything. So, I have not touched any files or anything, I am just trying to upload to IIS.
The correct answer I found was that for some reason you must use the IIS Express 8.5 to test/host that site.
Even the installations on the fresh copies of Windows with Full IIS prior to version 8 did not work on my test machines.
I have used VS 2010 and VS2008. When I used them with my WCF Service projects, my .PDB files were always copied when I did a Publish Web Site. Now, with VS2012, no PDB files are getting copied when I do a Publish Web Site. The PDB files ARE getting created for both Debug and Release but nothing happens when I do a Publish Web Site (for either Debug or Release).
I have searched this forum (and the Internet). My solution is as follows:
1) WCF Service Library project.
2) WCF Service Web Site
When I first did a publish, I had to create a profile and I did this.
When I right-click on the WCF Service Library project and select properties, I only get tabs for Application, Build, Build Events, Debug, Resources, Services, Settings, Reference Paths, Signing, WCF Options, Code Analysis. I do NOT get tabs for Package/Publish Web and other items that I used to get. I tried to right click on my WCF Service Web Site project and there is nothing in the Property Pages to indicate this.
I have even tried to add items to my .pubxml file and that does not work.
I wouldn't think I'd need to update my Debugging options to specify Symbols location. I would think that my Publish should just "do it" like it did in 2008 and 2010. Any advice?
Thanks In Advance.
In VS2012 Website publishing, symbols are always excluded by default. Why? It comes down to a design issue where website projects don't actually have a build configuration. If you look at the configuration manager in VS when your solution is in Release mode, the website project will always be in Debug mode; there are no other options. This is because website projects are not MSBuild based, and hence do not respect MSBuild configurations.
Instead, you can edit your .pubxml to tell it to include the symbols. Try adding this:
<PropertyGroup>
<ExcludeGeneratedDebugSymbol>False</ExcludeGeneratedDebugSymbol>
</PropertyGroup>
For me this worked (in the publishing profile):
<PropertyGroup>
...
<DebugSymbols>True</DebugSymbols>
</PropertyGroup>
Or using the publishing wizard:
I have just finished the development of a web service application in visual studio.
Is there an easy way to wrap it in an installer, so that I can just ship it off to technical support, and they can have a wizard based installer that will fully setup an IIS site for them, either in 6 or 7?
You can use Visual Studio's built in setup project. I've only tried this once on a test project, but it created all the necessary stuff in IIS 6 just fine.
I would suggest you export the IIS METABASE for your local instance of the service and then this can be imported into a new server to create the correct IIS configuration. Have a look at Copying IIS Configurations using iiscnfg.vbs The METABASE is just an XML file and you will easily see the specific values that allows you to edit them should the deployment be different in anyway.
sorry for possibly a very stupid question.
I have one of those Visual studio Web Sites ( ie not a web application) ,
is there any way I can automate the creation of the IIS Web Application that points to the web site within Visual Studio ( ie then when developers open the solution, the IIS site will be set up automagically?
Sorry, just not famiiar with the Web Site side of things
Thanks
AFAIK It's not someting Visual Studio will do out of the box. What you could do is create a batch file that creates the virtual directory then opens the solution. Store it in source control and your developers will be able to run it instead of opening the solution directly.
There are a few options for creating an IIS virtual directory automatically - see this and this.
Also - if you are using VS2005 or above you could change you application to use the development web server instead of IIS and then you won't need to mess around with virtual directories at all. Select 'Use default Web server' on the 'Start Options' section of the projects property pages.