Unable to open portable projects in vs2013 - visual-studio-2012

I have a several (c#) solutions (originally created with VS2012) that include portable libraries that I have trouble opening with VS2013. Some of them fail to open with
Unsupported This version of Visual Studio is unable to open the
following projects. The project types may not be installed or this
version of Visual Studio may not support them.
The problem only happens on my home environment. At work or on other setups everything works as expected.
To get it to work on my home environment, I have to right-click on the projects and choose "Edit Project.csproj ..." from the context menu for any project that was not loaded correctly. If all projects are open as text files in VS, I close the solution and reopen it again. Now, the projects failed to open, since VS is unable to open a project in two different modes (as a project vs as a text file). If you choose now "reload" from the context menu, the project loads correctly.
I can now close the solutions, and if I am lucky, eveything works after I reopen it again.
After some time, some of the projects fail to load. Then, I try to do the edit/reload trick again, but when I reload the solution, other portable projects are doomed. So, I have no choice but to start over (deleting the suo file takes me back to square-one, all portable projects are unable to load).
Any idea what I have screwed up with my system? I have installed all service packs and extensions. I also have the newest resharper version installed.
Update:
Not sure if it is related but I just got the following compiler warning for one of the incompatible projects
Warning 1 The element 'PropertyGroup' in namespace
'http://schemas.microsoft.com/developer/msbuild/2003' has invalid child element
'MinimumVisualStudioVersion' in namespace
'http://schemas.microsoft.com/developer/msbuild/2003'. List of possible elements
expected: 'Property, .... Project.csproj 1
Update 2:
VS Output window shows The application for the project is not installed. for all those projects that cannot be loaded. "Repairing" VS did not help, I will try to do a clean reinstall now.

Related

Android Studio 2.2.3: Favorites, bookmarks and opened folders keep disappearing, project and .idea-folder are always rebuilt

I'm trying to use favorites and bookmarks with Android Studio 2.2.3 on Windows 7 in order to navigate through our code base.
I have openend one project, where the saving of favourites and bookmarks works fine. BUT when I open another project, while my first project is open as well and then close one of the 2 projects, the closed project loses all the favorites, bookmarks and which folders and tabs I had opened.
Also AS keeps asking me to add the VCS root everytime I start it.
Although I've searched I could not find any sources describing my problem.
I've copied all my projects into a new folder and gave myself all permissions to this folder, which did not fix my problem, so I think permissions are not the problem.
My assumption was, that Android Studio might have trouble if you use multiple instances.
So I went and tried to set it to only use one window:
But this setting keeps getting ignored and AS opens a new window for every project.
I reset all the settings for Android Studio by removing the folder C:\<username>\.AndroidStudio2.2.
Then I re-started Android Studio and didnt import any new settings.
With this configuration my problem still occurred.
In order to reproduce the 'bug' do this:
Open a project by File -> Open (NOT File -> Open recent!)
Add bookmarks
Open another project (while the first project is still open!) by File -> Open
Add bookmarks there as well
Close project 1 and re-open project 1 by File -> Open
All tabs / bookmarks / favorites should be gone at this point.
Vadim Kotov has confirmed that the problem happens with his Android Studio as well, so I suspect a bug in AS.
How can I fix the disappearing favorites, bookmarks, opened folders and tabs?
This problem seems to be a rather old bug in Android Studio:
https://code.google.com/p/android/issues/detail?id=172347
The bug is fixed in the Android Studio 2.3 BETA-release:
https://code.google.com/p/android/issues/detail?id=232670&thanks=232670&ts=1485023505
Basically Android Studio seems to overwrite the workspace.xml in the .idea-folder for a project with a default - workspace.xml everytime I use the Open - menu.
AS probably re-creates the whole .idea-folder and rebuilds the project, everytime I use the File -> Open-dialog.
Workaround:
Since I cant switch to another version of Android Studio due to company rules, I use the following workaround:
When you want to open a project for the first time, you have to use File -> Open
After that, ONLY use File -> Open recent in order to get into one of your projects
This will save the opened tabs, bookmarks, favorites and will open only one instance of AS in the forground instead of the background.
WARNING!
If you later click on File -> Open either because the recent-menu is filled too much, or you do it by accident, you still probably will lose your bookmarks, favorites etc...

Android Studio: Change inspection profile for one specific module in project

I have several modules in Android Studio project, and I would like to change inspections settings for one of these modules. More precise, I want to turn off all Android-related inspections in one module, but leave all general Java inspections in place.
I need this because I have a not Android-specific Java library module, and that module uses java.util.Properties, and it's load method was implemented in Android API level 9. Since that library is not Andoid stuff, I have not specified Android API level at all, and Studio warns me about that.
It offers adding Android annotation to ignore that inspection, but adding Android dependency to turn off Android warning seems bad.
I can edit the settings to shitch that warning off, but I don't want to turn API level warnings in the whole project.
As I found, in settings you can specify inspection setting either globally or for whole project, not for specific module.
Is there a way to change inspections settings for one module, or do some hack around?
I am using Android Studio 1.3.2.
The Studio should automatically understand that the Java module has nothing with Android, and stopped Android inspections (but they were not disabled, though): I went fix something in the code, rebuilt it several times, and when I returned to warning line, it was clean.
So, I don't actually know what's going on,
but I got some recomendations, that should help:
Sync your Gradle project, it will try to rebuild the project. Some dependencies and settings will only resolve after Gradle will do something internal.
If Gradle will fail, there might be errors in code that ruins interspections. Try to solve them.
If your project history is stored in VCS, try checkout the latest clear version and sync project again.
Check changes in .iml files manually. For some reason, Studio sometimes does weirds edits there, and if I rollback some of them, Studio works better.
Actually you can disable particular inspections being made by Android Studio. However this needs to be on all projects you have in Android Studio, and cannot be done in all modules you are currently developing.
To disable android inspections on your projects follow these steps:
Click on the File menu and Select Settings
Expand the Editor root node select Inspections
There you will have all the inspections which Android Studio checks when building a project (image below). You can expand the Android node and check what you wish to remove from your inspections.
Hope this helps :)

Visual Studio regularly freezes running Microsoft.VisualStudio.Web.Host.exe

Background
I maintain several web sites that are Visual Studio "Web Site Projects".
Problem
I've found that with a couple of these projects, Visual Studio regularly freezes while I'm working on the code. This doesn't happen for some of the web site projects, and I haven't seen it happen on any Web Application projects.
Symptoms
Each time it freezes, it takes about half a minute before I can use it again.
During a freeze, Windows Task Manager reports that Microsoft.VisualStudio.Web.Host.exe is maxing out one of the CPU cores.
Steps to Reproduce
Open a .cs file under the App_Code directory.
Make a change to the file.
Save the file.
Navigate somewhere else (eg switch tab, close the file, open different program in Windows).
Navigate back to the file (eg switch tab to it, open it, or go back to Visual Studio).
Other actions that sometimes seem to trigger the problem:
"Go to definition"
Opening a file
Previewing a file
Closing a file
Using a refactoring
"Find usages"
What I've Tried
Both Visual Studio 2012 and Visual Studio 2015
Changing the website project's build action
Disabling "Build Web site as part of solution"
Deleting web references and the Bin folder seems to minimise the problem, but obviously this breaks the web site. Maybe web site projects experience this problem when they contain a lot of C# code other than code-behind files?
Similar problems
I found the following potentially-related problems using Google, but none of them seemed to contain a workaround or solution.
Microsoft.VisualStudio.Web.Host.exe Time Theft
Microsoft.VisualStudio.Web.Host.exe
Visual Studio 2012 freezes for approximately 30 seconds after every build
I noticed that the problem happened less often when I suspended ReSharper.
The problem still happened occasionally when editing classes under App_Code, but restarting Visual Studio worked around it.
I was facing a similar problem. A single Web application project with dozens of class libraries, migrated over from VS 2010 into VS 2013.
I was able to solve my problem by disabling the "Hosting Process" option:
To disable the hosting process
Open an executable project in Visual Studio. Projects that do not
produce executables (for example, class library or service projects)
do not have this option.
On the Project menu, click Properties.
Click the Debug tab.
Clear the Enable the Visual Studio hosting process check box.
Full details on MSDN: http://msdn.microsoft.com/en-us/library/ms185330.aspx
Another option for people experiencing this on old web applications that don't have the properties page in the accepted answer above.
Disable "Allow this precompiled site to be updatable".
Open Site/Solution
Right click and view Property Pages
Go to MSBuild Options
Uncheck "Allow this precompiled site to be updatable"
This worked for me.
This problem stopped happening when the Web Site project was converted into a Web Application project.
Not an easy solution, but it did stop the problem.
They symptoms in the question of this post sound exactly like the nightmares I just had today:
Other actions that sometimes seem to trigger the problem:
"Go to definition"
Opening a file
Previewing a file
Closing a file
Using a refactoring "Find usages"
Plus intellisense wasn't working (even with CTRL + J) and
'Peek definition' was hanging as well.
I had to keep task killing visual studio (both 2015 and 2017).
My fix was to go into the project that I was having problems with, open the 'Package Manager Console' and uninstall and re-install the 'DotNetCompilerPlatform'
uninstall-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
and then
install-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
So far every problem I was encountering has not resurfaced (but this was just today so still need to give it time).
UPDATE:
It started creeping back again. I noticed also that whomever had installed to the solution had only done it to two of the various projects. Uninstalling the compiler platform (which means using the compilers that came with Visual Studio) has made life sane again.

Unable to locate package source : vcRuntimeDebug_amd64\cab1.cab visual studio

I tried to install Visual Studio 2012 . but it showing me "Unable to locate package source" I can select "Download from the internet" or "Provide a location to search for the packages" And this is path that comes up:
C:\Users\JA\Download\packages\vcRuntimeDebug_amd64\cab1.cab
(the 'packages' folder does not exists) When I select to download from the internet its showing up again after some time, I searched for "vcRuntimeDebug_amd64" folder but it doesn't contain "cab1.cab" file ;/
Note please, that i runned setup file as administrator and i disable firewall .
I had the same problem but with Windows Phone 8 SDK. I tried several things (which are detailed below, in my previous answer), and the best option was to download the ISO, found in the Install Instructions section:
http://www.microsoft.com/download/details.aspx?id=35471
After finishing, it said it couldn't download that runtime, but at least the emulator is running fine. I guess you could manually download that runtime
afterwards if you have any problems. Here's the link:
http://www.microsoft.com/download/details.aspx?id=30679
Previous attempts:
I downloaded the Visual C++ Redistributable for Visual Studio 2012 Update 4 to see if that way the installer skipped that step, but it didn't work.
Then I looked for cab1.cab in my disk and found it in several folders, being this one the one that worked:
C:\ProgramData\Package Cache\{CF2BEA3C-26EA-32F8-AA9B-331F7E34BA97}v11.0.61030\packages\vcRuntimeMinimum_amd64
Of course that GUID will be different in your case, so you should look for a vcRuntimeMinimum_amd64 folder.
Inside that folder was not only the cab1.cab but also a vc_runtimeMinimum_x64.msi file. When I told the installer to use that folder, it still didn't work. Then I chose "Browse" but when I opened that folder it didn't show any file because the installer was looking for vcRuntimeMinimum_x64 (without the underscore). I typed "." in the textbox so it showed all the files, I chose vc_runtimeMinimum_x64.msi and the installation continued. It took a while but it worked.
Later I had the same issue with sdk_tools35res.cab. I told the installer to use v3.11.50727\packages\sdk_tools35res\sdk_tools35res.msi and the process continued.
But in the end, I got three errors: Tools for .Net 3.5, MS VC++ runtime and .NET 4.5 SDK. So then I decided to download the ISO.

VS2012/2013 fails to display solution explorer

I have this problem with both VS2012 and 2013. When I load an existing or create a new solution I get a ProviderPackage error - An exception was thrown during package instantiation and was caught in the package manager. After I close the error dialog, the solution explorer window is empty, although there are solution files open in the editor.
The ActivityLog.xml file shows different modules loading when the error occurs, depending on the project type. Is there a way that I can determine the common thread between 2012 and 2013 that is causing this error.
There is probably a corrupted dll which I have to replace. I am dead in the water until I figure this out.
Help.
Clearing the Visual Studio Component Model Cache worked for me (details: Error message "No exports were found that match the constraint contract name")
None of the previous suggestions worked for me, but this one did:
http://www.hjerpbakk.com/blog/2014/7/25/no-content-in-solution-explorer-using-visual-studio-2013
This issue is because of a MEF cache corruption. Installing [or uninstalling any extension] will invalidate the cache causing VS to rebuild it.
I ran into the empty solution explorer with Visual Studio 2013, and fixed it with a repair install.
Solution: This worked for me.
I had the same problem in Visual Studio 2015 with the Solution Explorer always showing empty, even after deleting the ComponentModelCache folder. Looking at the Microsoft.VisualStudio.Default.err file, one of the errors was:
"----- Catalog construction errors -----
Error #1
Microsoft.VisualStudio.Composition.PartDiscoveryException: Failure while scanning type ......"
Doing a Google search on Microsoft.VisualStudio.Composition.PartDiscoveryException lead me to a Nuget package for Visual Studio MEF. Since I read so many posts of people have this same problem, I figured the problem was with Visual Studio and not necessarily any particular extension. So I installed this Visual Studio MEF Nuget package, restarted Visual Studio, and now the Solution Explorer is populated every time.
Nuget: https://www.nuget.org/packages/Microsoft.VisualStudio.Composition/
Deleting the .suo file worked for me.
Close VS, delete suo file of your project (is hidden), open your project again.
I had this problem with two projects, this fixed it in both cases.
Also, creating a new project (in my case a Console Application) also worked! That was probably the easiest fix i've found thus far and you don't have to delete anything! Nice...
Go To Window menu in visual studio and click reset window layout...it will work

Resources