How to update web-installed Microsoft Visual Studio 2017 offline (saved layout)? - visual-studio

I have Visual Studio 2017 which was installed from the web.
Meanwhile, the corporate firewall rules changed and it's no longer possible to update the installation (download.visualstudio.microsoft.com is blocked).
At home I was able to download a complete Visual Studio 2017 layout to an external drive.
Now, how can I instruct Visual Studio Installer to use the external drive layout instead of trying to download from the web?

After googling a bit, I found some clues here and there, but never got a direct answer. I had to do some experiments until I found a very simple solution:
Open folder C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances (or equivalent in your machine). This folder should contain a subfolder with the VS2017 instance GUID (from now on referred to as VS_GUID). Note: ProgramData is a hidden folder.
(Optional) Create a backup of file C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances\{VS_GUID}\state.json in another directory of your choice.
Edit file C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances\{VS_GUID}\state.json (note: VS_GUID is the sub-folder name found in step 1)
and change layoutPath to your local layout folder and installChannelUri to the full path to ChannelManifest.json (which should be present in the layout folder root).
Example (when layout path is D:\vs2017layout):
(...)
"layoutPath":"D:\\vs2017layout",
"installChannelUri":"D:\\vs2017layout\\ChannelManifest.json"
(...)
Save state.json and launch vs_professional_xxxxxxxxx.yyyyyyyy.exe (or equivalent) which is located in the layout folder. If it detects the updated installation files then the "download" progress should move to 100%.
This worked for me.

Related

How to make Visual Studio Installer remove file during installation?

I already had trouble finding out where appSettings get stored when the app is installed in program files directory.
Now the next thing is finding out how to make the app installer update that location too. Because obviously, Microsoft Windows doesn't do it.
When the app is installed in program files and you try to update its settings file the setting file actually got saved to another location: C:\Users\user\AppData\Local\VirtualStore\Program Files (x86)\company\app
How to make Visual Studio Installer remove this file during installation?

Visual Studio 2008 Solution has wrong "Opened URL" path for Web Application

I have a project solution I am migrating from another computer, and the project opens the wrong "Opened URL".
When viewing the Properties for the Web Site, the following path is correct and working on the old computer.
file:///C:/Collection/Server Workspace/store.domain/Main/store.domain
When the same solution is transferred via TFS to my computer, the Opened URL path adds an additional "store.domain" at the end of the path:
file:///C:/Collection/store.domain/Main/store.domain/store.domain
Editing the path inside Visual Studio isn't an option, its greyed out and not editable. Editing the text of the solution file shows no duplicate "store.domain"s either.
I'm sure I'm missing something simple, perhaps with IIS?
You need to check in the web site from the old computer to have the correct URL stored in TFS Version Control. Then get latest version for that web site on your dev machine.
Solution: The solution file on the old computer only worked when inside the folder with all of the files. The same solution file on the new computer, needed to be in the parent directory.
So the fix was to move the solution up one directory, for whatever reason. This allowed the phantom /store.domain folder to line up correctly.

Exporting a Visual Studio Add-in

Anyone had a need ( or more importantly, know how ) to move a Visual Studio Add-in from one machine to another? Of course it would be easy if I had access to the .vsix, but that's in a bit bucket somewhere. I tried poking around the registry and File Explorer, but didn't see anything likely.
Doing a Tools / Import and Export Settings got part of it - there's a placeholder on the toolbar that has the add-in's name, but none of the buttons show, and, unlike the original machine, the new machine's dropdown to Add / Remove buttons shows nothing.
First you need to find an .AddIn file that declares an add-in for Visual Studio. Usually it is located in the "c:\Users[user_name]\Documents\Visual Studio 2013\Addins\" directory, but can be in any Add-in File Paths listed in Options - Environment - Add-in Security.
In the .AddIn file there is an Assembly entry that contains a .dll name that implements the add-in.
You need to copy both files (.AddIn and .dll) to a new machine, plus optional auxiliary add-in files.
(BTW .vsix is not used to deploy add-ins.)
I recommend using the guide - Syncing Visual Studio Extensions and Settings with Dropbox :
http://www.larswilhelmsen.com/2012/01/08/syncing-visual-studio-extensions-and-settings-with-dropbox/
and complete it as you did with the Import and Export Settings (as noted in the guide too).
Other than that, there is not VS2013 extension for exporting VS extension, the only extention which work well is for VS2010 - ExtensionSync.
Source: https://visualstudiogallery.msdn.microsoft.com/dbaf0ac9-fb7b-4fb3-b34d-ea2269276d3c

Visual Studio 2013 InstallShield Limited - Installing files into MyDocuments

I am using Visual Studio 2013, InstallShield Limited. One of the 'Predefined Folder' options available in InstallShield Limited, is "[MyPicturesFolder]". I need to be able to install to the user's MyDocuments folder (per company requirements). How can I accomplish this?
As noted by #JonathanHansen in the comment under the question, the [PersonalFolder] is indeed the My Documents folder. See: Personal folders overview
To set this as an output location, in Visual Studio, under Solution Explorer, navigate to the installer project, then under 2 Specify Application Data > Files, right-click the Destination Computer (under Destination computer's files on the left), and select Show Predefined Folder. Then, select [PersonalFolder]. Any files added here will end up under My Documents.
I tested this on Windows 7. A file that I put there ended up on the destination computer under: C:\Users\USERNAME\Documents\
Also see Destination Folders for more information.

IISExpress 8 Cannot read configuration file redirection.config

I'm running Windows Server 2008 R2 (x64) with IISExpress8 and when navigating to
c:\Program Files (x86)\IIS Express>iisexpress.exe
it says:
Filename: redirection.config
Error: Cannot read configuration file
Any ideas where to start?
I can't find anything...
I had a similar issue to #Myles J but renaming %userprofile%\Documents\IISExpress\config\applicationhost.config didn't work. What I had to do was the following:
Close Visual Studio.
Rename the %userprofile%\Documents\IISExpress\config directory.
Start Visual Studio again. The %userprofile%\Documents\IISExpress\config directory will be recreated with the default config files.
Copy the original applicationhost.config file over the autogenerated one.
Before anyone asks: the permissions on the folders were identical, the read-only flag was not set on the folder or its files, and I didn't modify applicationhost.config in any way.
After installing IIS Express, copy all files from
C:\Program Files\IIS Express\config\templates\PersonalWebServer
to
%userprofile%\Documents\IISExpress\config
Right click on your project file and Edit the project file and remove the URL from IISUrl and reload your project then it will work
I have just resolved this. It is a strange solution but it worked for me. Here are the steps I took:
Navigate to the folder containing the local IISExpress config files (normally My Documents>IISExpress>config on Windows7).
Find the applicationhost.config file. Rename it to something different e.g. applicationhost2.config.
Navigate to your web project in Visual Studio (I was using VS 2012). Right click on the web project and select Use IISExpress. Run the project. It should fail due to the renaming of the config file.
Change the name of the configuration file back to application.config. Ensure "Use Local IIS Web Server" is selected in the web project settings. Run the solution.
This worked for me.
If you do:
C:\Users\”username*****”\Documents\IISExpress\config
You find these file
applicationhost.config
aspnet.config
redirection.config
Delete above 3 file and then open the project.then the problem is solved. I tried, its working fine.
I have the exact same issue with Visual Studio 2013 on Windows 8.1
I map My Documents folder to SkyDrive, so the IISExpress folder was marked as "Online-only". Once I marked it as "Available offline" everything worked.
Visual Studio will only report the filename it looks for, not the full path. The problem for many users is that the IISExpress with the redirection.config can exist in multiple paths, including a OneDrive path which may not be synced.
To figure out exactly what file Visual Studio attempts to open, use the Microsoft (SysInternals) tool ProcMon. It lists all files and resources Windows tries to access. Add a filter for "Path contains redirection.config" and reproduce the problem in Visual Studio. Now you will see the actual path it tries to use.
In my case, I have multiple IISExpress folders. One that was synced to OneDrive and another one that was local. Visual Studio tried to access the OneDrive folder which was not synced to the local disk, and thus it failed.
In some situations simply renaming/deleting the applicationhost.config file isn't enough since VS won't always recreate it for you. I believe the following will fix it under all circumstances:
Close Visual Studio.
Make sure there are no IIS Express processes running, then delete C:\Users\XXXX\Documents\IISExpress\config\applicationhost.config (where XXXX is your Windows username).
On command line, execute c:\Program Files\IIS Express\iisexpress.exe. This will recreate the necessary configs. Press 'Q' straight away to end the process.
Open Visual Studio again and Start/Debug your web project. Everything should now be working.
Backup files at local IISExpress folder. It can be found at: C:\Users\”username*****”\Documents\IISExpress\config
Go to the location:
C:\Program Files\IIS Express\config\templates\PersonalWebServer
Copy the required files from this directory to the local IISExpress folder.
It worked for me after I copied over the files:
applicationhost.config
aspnet.config
redirection.config
In my case the 'My documents' folder for my work laptop was mapped to a network share. So when the work network was not available I was not able to open my solution.
Change:
These will have the value of my docs in network share. Change this to local
I. Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal
II. Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Personal
For eg:
Old value: \networkdrive\c$\Users\profile\Documents
New value: C:\Users\profile\Documents
See:
https://blogs.msdn.microsoft.com/chiranth/2015/04/01/error-while-runningstarting-a-website-under-iisexpress-in-visual-studio/
The issue is that the files in C:\Users\"Your Username"\Documents\IISExpress\config are encrypted.
Open this folder, Select all the files, Right click and select properties,
Click advanced, deselect "Encrypt contents to secure data, Click okay, click apply.
That will fix it.
Using Visual Studio 2013
I had to stop visual studio rename the whole config directory, Documents > IISExpress> Config then start a new web project, which fails but it recreates the config directory, then I rebooted and launched visual studio and everything worked!
I noticed this problem after copying a project between 2 computers, perhaps it was caused by a duplicate IISExpress port or something trivial.
Using VS2013 / Windows 7
Close solution. Open Windows Explorer and right-click on "My Documents\IISExpress\config" directory and select "Decrypt". Be sure "Apply changes to this folder, subfolders and files" is selected. Reopen VS solution.
In my case it happened when IISExpress was still active from a previous VS session and new instance of VS was run.
The solution was to stop (or kill) IIS Express instance.
Fix was really simple for me >> Restart Visual Studio
My setup:
Visual Studio 2015
Web projects use local IIS 8.5
I occasionally experience what I believe to be a VS bug where it converts some projects to use IISExpress (this is fixed by deleting the folder created in /This PC/Documents). This might be related.
You don't need to close Visual Studio or rename anything.
Open properties for %userprofile%\Documents
Select Security > Advanced, change owner to yourself (again if you are already owner).
Select "Replace owner on subcontainers and objects" and "Replace all child object permission entires with inherited permission entires from this object".
Ok.
For me, It's a simple lack of permission either give everyone permission
to "%userprofile%\Documents\IISExpress\config" this folder or Open VS in Admin mode
for me was removing the file Documents\IISExpress\config\applicationhost.config
Closing visual studio > Open > Debug
Thanks for the previous answer help go straight to the issue
After trying to solve an issue with a quick fix of changing IIS express inside visual studio from integrated to classic pipeline , I ended up not being able to use IIS express at all. I tried all techniques above...
I could not rename , copy the file. Uninstall of IIS express and re-install did not work.
I FINALLY downloaded the latest version of WebMatrix and installed IIS express 8, that did not work, but at least then i was able to finally delete the old directory and then I recreated itself.....
NOT FUN AT ALL.
I resolved this (with vs2013 and windows 7) by going to Documents > IISExpress> Config and renaming the application.config. After that, I restarted visual studio and opened my project and it worked.
I ran into this issue while trying to open another developer's solution after installing VS2013 (Update 3 RC). After following the advice here and deleting/renaming/etc. the config folder, VS re-created the files in the wrong location. It created nested config folders:
C:\Users[user]\Documents\IISExpress\config\config
I moved everything from ...\config\config into ...\config, and it worked as expected.
I found that deleting one of the sites from the applicationhost.config file resolve this problem for me.
I used the following command from the %ProgramFiles(x86)%\IISExpress directory:
appcmd list site
then
appcmd delete site rogueSiteName
Especially there was a site name with a bracketed number suffix (e.g. "MySite(1)") that I deleted. I'm not sure yet if VS2013 just had an issue with the brackets or that two sites pointed to the same directory. Either way deleting it made VS happy again.
Background
I had been struggling with this issue for a couple of days and nothing seemed to help - not even the instructions given in the top answers here.
I had also tried moving the config folder as mentioned in http://www.iis.net/learn/extensions/introduction-to-iis-express/iis-80-express-readme. But although VS2013 recreated the directory structure and files in the new location the errors continued and running appcmd showed that it was still pointing at the old location by default.
Credits
Credit for where I found the commands to use goes to http://gyorgybalassy.wordpress.com/2013/12/02/cleaning-up-iis-express-configuration/
For ASP.Net Core just access your Properties section, then make a modification and save it.
Example: I modified the SSL port
You will get a notification that your launchsettings.json was modified. Accept that and you're good to go.
If it is ASP.NET Core project
Just try to change iis port in file launchSettings.json by path iisSettings:iisExpress:applicationUrl
It's 2020, I am reporting the same problem in Visual Studio 2019.
Cause: Multiple VS instances open with different web app (Blazor in my instance).
Solution: Close all VS instances and re-open the solution that you want to run.
On IIS 10 Express. Make sure that Visual Studio (VS) is turned off.
I first found out that %userprofile%\Documents\IISExpress\config\ was not working.
I first thought IIS Express had clashed with IIS from the windows OS.
I uninstalled it, yet no changes, then I uninstalled IIS 10 Express that was installed with VS 2019 through the control panel.
Then I went ahead to discover that this file is saved at the C:\Users\username\OneDrive\Documents\IISExpress, associated with one drive storage, so I advise you copy %userprofile%\Documents\IISExpress\config\ and paste in your windows explorer navigation to find directory.
go to one directory higher, and/or rename the config folder. Restart your VS and run the project again.
Mine was caused by OneDrive. Apparently my documents folder is being synced to it.
What I did is changed the location of the documents folder through regedit and navigated to this path:
HKEY_CURRENT_USER > Software > Microsoft > Windows > CurrentVersion > Explorer > User Shell Folders
and then changed the value of Personal
from: C:\Users\my username\OneDrive\Documents
to C:\Users\my username\Documents
After that I restart my computer and I was able to create a VS project.
I have the same issue,
First time, i think Visual Studio not permission access to %userprofile%\Documents\IISExpress\config so i run Visual Studio with Administrator, but it not working.
I try all answer above but still the error!
Finally, i look internet, i see my onedrive is stopping, i enable and sync data. Restart computer and worked.

Resources