Error getting to Test Window in VS 2012 RC - visual-studio-2012

I have been using the customer preview of Visual Studio 2012 up until day before yesterday when the Release Candidate became available. After I installed the Release Candidate, I can't get to the Test Window (Test / Windows / Test Explorer).
I get the following lengthy error which I've copied manually here. (Since this is my first question, I couldn't post the picture, and the screen would not allow me to copy the text to the clipboard. Hopefully there are no typos.)
The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.
1) Value cannot be null.
Parameter name: testPlatform
Resulting in: An exception occurred while trying to create an instance of type 'Microsoft.VisualStudio.TestWindow.Model.ReqeustConfigurationFactory'.
Resulting in: Cannot activate part
'Microsoft.VisualStudio.TestWindow.Model.ReqeustConfigurationFactory'.
Element: Microsoft.VisualStudio.TestWindow.Model.ReqeustConfigurationFactory -->
Microsoft.VisualStudio.TestWindow.Model.ReqeustConfigurationFactory --> CachedAssemblyCatalog
Resulting in: Cannot get export
Microsoft.VisualStudio.TestWindow.Model.ReqeustConfigurationFactory
(ContractName="Microsoft.VisualStudio.TestWindow.Model.RequestConfigurationFactory")' from part
'Microsoft.VisualStudio.TestWindow.Model.ReqeustConfigurationFactory'.
Element:
Microsoft.VisualStudio.TestWindow.Model.ReqeustConfigurationFactory
(ContractName="Microsoft.VisualStudio.TestWindow.Model.RequestConfigurationFactory") --> CachedAssemblyCatalog
The error occurs regardless of whether I have opened a solution or not. A second attempt to open the window yields "Cannot create the tool window." After restarting Visual Studio, and attempting to get to the Test Window, I get the long message again.
At the time I upgraded Visual Studio to the Release Candidate, I had installed:
NUnit
SpecFlow
ReSharper (Beta)
Code Contracts -- the last thing I had installed before upgrading Visual Studio. I cannot guarantee that the test window was working after I installed this.
I have searched the web for key phrases out of the error message, but found no help.
I have also:
Repaired Visual Studio (which solved a problem I was having getting to the Extension Manager, but not the Test Window problem)
Uninstalled Visual Studio and reinstalled it
Uninstalled each of the Extensions/packages listed above (NUnit, SpecFlow, ReSharper, Code Contracts). Uninstalling didn't seem to help, so I have re-installed all of them,
one at a time. I've also confirmed that I can run tests in the ReSharper test window.
Deleted the currentsettings.vssettings file from C:\Users\\Documents\Visual Studio 11\Settings, hoping it contained the problem and would be recreated correctly. I got a message that "The IDE will use your most recent settings for this session". I don't know where to find those...
Reset settings from the Import and Export Settings option.
None of these actions has helped.
It looks to me like a config file somewhere is missing an element for testPlatform, but I have no idea where that would be (or in what format, or what Options page entry would set it.)
Any help would GREATLY be appreciated.

I didn't figure out exactly what was causing the error, but I did get it fixed. Here's what finally worked
I installed all VS 2012 one more time, plus the extensions, then looked for bits that might have been left behind by the uninstall. I found and deleted the following before reinstalling:
C:\Users\<my id>\Documents\Visual Studio
C:\Users\<my id>\AppData\Roaming\Microsoft\VisualStudio
C:\Users\<my id>\AppData\Local\Microsoft
Registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft
Upon re-installing Visual Studio 2012 RC, the original problem was resolved. Re-installing the extensions also worked successfully.

Related

How can I fix Microsoft Visual C++ 2017 X64 Minimum Runtime error during installing Redistributable packages (VC_redist.x64.exe, VC_redist.x86.exe)?

During installation I get "The feature you are trying to use is on a network resource that is unavailable" and prompt to specify some path to vc_runtimeMinimum_x64.msi. After providing some path to required file I get error states that this file doesn't match required version Minimum Runtime 14.14.26405.
I finally found the solution reading this question: Install vcredist_x64 with VS2017 installer project
I realized that specific VC_Redist.x64.exe files could be downloaded by links like https://aka.ms/vs/15/release/26405.00/VC_Redist.x64.exe, where 26405.00 is exactly the version I was required to fix. Note, that you need version from error text after clicking OK, not from window title.
And the last point is that this exe must be executed from cmd with argument /repair to help me with this issue. Regular execution by double click made no effect.
I found the solution elsewhere. It said to
Fix problems that block programs from being installed or removed
https://support.microsoft.com/en-us/help/17588/windows-fix-problems-that-block-programs-being-installed-or-removed
download troubleshooter button on the link.
Run it - choose option - have problem with installing - it lists programs - choose the missing / problematic visual c++ runtimes in the list
it will run and get fixed.
Repeat for each visual c++ you having problems with. I ran the program multiple times.
I have to thank this comment section for helping me with this problem, since I have not been able to work more efficently with my school, since I din't know what and if a single file somewhere deep down in the computer had to be deleted for this program to work.

Android Studio keeps running old code

The masterpiece called Android Studio is painful to work with: I can't help but seek your help with a following problem:
Once I ran some code, changed it a few times since then, but no changes were actually made and studio keeps running the old code (which does not even exist anymore). After I clean & rebuild the project, it sometimes works and the new code runs, but then after a couple of changes I encounter this trouble again.
Since building/rebuilding and compiling again takes more time than writing code, this is no option for me. I checked some related questions, one advice was to turn on Virtualization in BIOS. I did, but nothing changes.
My laptop is Lenovo G50
Virtualization is on.
Win10 x64
Android Studio 2.2
MainActivity as configuration (with red cross and "No main method found" sign).
Any help appreciated.
This is happening because there is error in your code and you have selected run without warning when error in program exists. In such a case the last successfully built code would get pushed! Try doing a clean (Build --> Clean Project), if the project now shows up errors you have your culprit, else make sure your XML files are all proper.
MainActivity as configuration (with red cross and "No main method found" sign).
this can happen in two cases:
Your MainActivity class isn't properly added in the AndroidMainfest.xml
Your MainActivity.java or activity_main contains error
make sure to check both of this thing,and then clean your project(Build --> Clean Project).This tells the IDE to delete any previously compiled binaries and rebuilds them. (The APK file).

Android Studio - Auto complete and other features not working

I installed android studio.. it was working fine. Now all the sudden, none of the auto complete features are working.. I can type anything anywhere no variable checking, no help with functions or checking anything. I can still compile the project and I get errors when that happens.
Can anyone please help me out with this issue.
#1 From Build menu (of your Android Studio), click Rebuild Project option.
#2 Then once rebuild completes, go to File > Invalidate Caches / Restart... and Click on Invalidate an Restart button.
This really works for me.
Source: https://code.google.com/p/android/issues/detail?id=61844#c4
#1 Rebuild is required, because Android-Studio does simply rely solely on Gradle's build-result (without static-analysis support, at least at time of writing, 2022).
#2 Clearing cache is required, because the previous build-result (before above rebuild) may be indexed, which makes Android Studio ignore latest Gradle build-result
(this is a very good speed optimization, but a very bad Developer-experience as well).
There can sometimes be other reasons too, which is why there are many other answers posted here.
You can also check if Power Save Mode on File menu is disabled.
Close Android Studio
Go to C:\Users\UserName\.android and rename the folder:
build-cache to build-cache_old
Go to C:\Users\UserName\.AndroidStudio3.x\system
OR (for Android studio 4 and Higher) go to C:\Users\UserName\AppData\Local\Google\AndroidStudio4.x
and rename these folders:
caches to caches_old
compiler to compiler_old
compile-server to compile-server_old
conversion to conversion_old
external_build_system to external_build_system_old
frameworks to frameworks_old
gradle to gradle_old
resource_folder_cache to resource_folder_cache_old
Open Android Studio and open your project again.
Originally use:
compileSdkVersion 32
targetSdkVersion 32
And an update to 33 appeared, I updated it and the suggestions in the XML no longer appeared, I went back to 32 and now the suggestions appeared.
Close Android Studio
Go to c_users_path_on_windows/.AndroidStudio3.5/system/
Delete the cache folder
Start Android Studio
This works for me.
Most of the times i have seen that the problem is that Power Save Mode is enabled, to disable go to Current inspection profile (lower right corner in Android Studio).
I have not run into this problem personally, but try checking the following settings (File -> Settings or Alt+F7):
Project Settings [name]
Inspections - ensure that Android and Android Lint is checked, or alternately just set it back to default using the dropdown box at the top.
IDE Settings
Editor -> Code Completion - ensure the Autopopup code completion is checked (and check the rest of the settings based on your preference.
Uncheck "Power Save Mode" in "File" tab
If nothing works (like happened with me ) go to your user profile in windows at %userprofile% . You will find folders there (hidden) named with the version of the android studio you are using and prefixed with a dot.
like .AndroidStudio3.1. Just delete that .
Solution: Try disabling "File -> Power Save Mode" in Android Studio (Beta) 0.8.14 - Mac OS X
On windows, the option can be at some other place.
I had the same problem then I recalled that while exploring the new android studio, I switched on the "File -> Power Save Mode" to see what it does?
I disabled the power save mode and all those intelligent features were back.
It turned out that in Power Save Mode, Android Studio switches off the modules responsible for features like Smart Code Completion and Code Analysis.
I had a similar problem where none of the other solutions worked.
Closing Android Studio and then deleting the .idea and build folders resolved the issue.
Disable Power Save Mode and Invalidate Cache and Restart.
For Artic Fox 2020|3.1 Version: Auto Complete Suggestion Problem.
Please Follow the Following Steps:
Close Android Studio
Locate caches folder in C:\Users{username}\AppData\Local\Google\AndroidStudio2020.3
and Delete it.
Open Android Studio Again.
Check your Android studio version and Target that version folder at below location
C:\Users{username}\AppData\Local\Google
Note : AppData folder is Hidden in Windows
This Solution also works if android studio mess up with xml files and java code. Don't! modify your code otherwise IDE won't able to change it to default. If you see such messy code just follow above steps and your code will be fine again.
It's Working
Disable Power Save Mode
Untick Power Save Mode Option ::
File -> Power Save Mode
There is a power saver mode in android studio if accidentally you click on that it will disable code analysis which will reduce the battery consumption and performance will also increase but it will not detect any errors and do auto complete operations.
To disable power saver mode
- Go to File Menu of Studio
- Uncheck The Power Saver Mode
In your IDE code analysis will be shown using an eye symbol at the right corner of your android studio.
If Green means it is enabled and there is no error in your code.
If Red Means It is enabled but there are few errors in your code.
If It is white or blur then code analysis is disabled
Just remove all the folders named AndroidStudioPreview
On Windows:
Go to your User Folder - on Windows 7/8 this would be:
[SYSDRIVE]:\Users[your username] (ex. C:\Users\JohnDoe)
In this folder there should be a folder called .AndroidStudioPreview
On Mac OS X
Remove these files:
~/Library/Application Support/AndroidStudioPreview
~/Library/Caches/AndroidStudioPreview
~/Library/Logs/AndroidStudioPreview
~/Library/Preferences/AndroidStudioPreview
There can be several things which cause this.
Make sure you've write the correct version in targetSdkVersion and compileSdkVersion.
Make sure targetSdkVersion and compileSdkVersion are same.
Other solutions can be:
Invalidate caches & restart Android Studio from File → Invalidate Caches / Restarts...
Clean your project from Build → Clean Project
Rebuild project from Build → Rebuild Project
Make project from Build → Make Project [this process may take some time]
Be sure to check for IDE errors by clicking the button at the bottom right of android studio.
In my case, there was a bad plugin, and the IDE Fatal Errors window prompted me to uninstall the plugin. (I wish I'd known about this feature before spending half a day invalidating caches, deleting folders, and reinstalling android studio with no luck.)
It worked for me.
From menu select:
File -> Power Save Mode
and make sure it's disabled
Go TO Left Side Top File Option
Then Click To Power Save Mode
Disable Power Save Mode That Fix This Issue
In my case, when I switch keyboard language to English, the auto complete works again.
if the autocomplete isn't working for you in Android Studio, just press File and uncheck the Power save mode, it should work fine after that.
if power save mode is already unchecked then first check then uncheck them.
If you have a library project included, make sure the library has the dependencies in build.gradle listed using the api configuration, not the implementation configuration.
Also make sure that the project that includes the library has all the dependencies listed (using the implementation configuration is fine here).
'The file size (2561270 bytes) exceeds configured limit (2560000 bytes). Code insight features are not available.'
Had this issue for days with none of these proposed solutions working before eventually getting this message in yellow under the tabs after adding a line of code. Removing the line of code eliminated the message but not the issue. There appears to be a code size window where you lose insight features but don't get this message, at least for me. Once you go over a certain point the message finally pops up. The suggested solution in a different thread for this issue was to edit 'Help/Edit Custom Properties' to increase the configured limit, but just opening this brought up a dialogue asking if I wanted to create an 'idea.properties' folder so I decided not to risk that approach over eventually cutting the file size.
If sometimes this problem can occur if you misspelled a file extension or make a file without adding an extension.
Check you have added the file extension correctly.
I think that answer may help you.
I'm using mac and suddenly the code completion (^space) not working. There are no errors. Turned out the android studio's shortcut was conflicted with system's shortcut. I don't know why it suddenly happen because it was fine before, maybe there was an update on my Mac.
See below setting for the conflicting shortcut
In my case, C:\Users\UserName\AppData\Local\Google\AndroidStudio2020.3\ just delete caches folder and restart android studio. after deleting this caches folder my problem was solved :)
I encounter with this problem while adding a kotlin library into my project on mac. Changing macbook language to english solved this problem. I also had some weird problems with auto-generated databinding codes, those are also solved.
Try Invalidate caches/Restart from File in Menu Bar from android studio.
Close Android Studio
Go to
C:\Users\YOUR_USERNAME\.android
and rename the following folder to:
build-cache to build-cache_old
then Go to (Android studio lower then version 4)
C:\Users\UserName.AndroidStudio3.x\system
OR (Android studio 4 and Higher) Go to
C:\Users\UserName\AppData\Local\Google\AndroidStudio4.x
or
C:\Users\UserName\AppData\Local\Google\AndroidStudio2021.2
depending on your version and rename these folders:
caches to caches_old
compiler to compiler_old
compile-server to compile-server_old
conversion to conversion_old
external_build_system to external_build_system_old
frameworks to frameworks_old
gradle to gradle_old (if exists)
resource_folder_cache to resource_folder_cache_old (if exists)
Open Android Studio again and the autosuggsion will be fixed.
and You can also check if Power Save Mode is disabled or not from the File menu.

"csc.exe" exited with code 1 in Visual Studio 2012

The Visual Studio 2012 Professional Edition installed on my PC keeps on showing in error list
"csc.exe" exited with code 1 in Visual Studio 2012
instead of the actual error (e.g. syntax error).
How can I fix this?
I turned on detailed logging in Tools -> Options ... -> Projects and Solutions -> Build and Run.
When you rebuild your solution, you can see the command that gives the error. Copy the command, open a cmd window, go to your project folder, paste and run the command. The output will give you the actual error.
It's some sort of bug in VS2012 I suppose. You could try cleaning your solution, restart Visual Studio and try rebuilding? The above solution should point you in the right direction for finding your error. When opening the file containing the error, the errors should appear in the error list.
This happened to me because I enabled the "treat warnings as error" switch in my project settings and had an unused class member in some file.
I agree that the output window's message is misleading and should be replaced by some message that shows which member cause the build to fail.
Maybe my unswer is too late, but I want to say, that such error could also happen if you copy that project from another solution. That project was sign with .snk file and you added it to TFS (for ex). VS does not upload .snk by default and when you will use your code in the other place, you will not have that file, but in AssemblyInfo.cs there will be mention that your project contains that file. So, c2c2.exe will not build your solution because of this. Quick solution will be just to commnet this line
[assembly: AssemblyKeyFile( #"....\sn.snk" )]
in AssemblyInfo.cs
I had the same issue.
I tried cleaning the solution, deleting the bin/obj folders, repaired visual studio 2013, dump out detailed build info, nothing helped, CSC still exited with error code 1, no more info than that.
In the end it was caused by two variables (a double and double[]) with the same name in the same code block. Strange error to cause it.
If this happened to a project that was working before, verify no devenv.exe is running after closing VS:
-Close all the instances of VS
-Open the task manager
-Verify all the devenv.exe actually get closed, or kill the processes
For me, I still had 3 devenv.exe working; I ended these processes, started VS again, and it worked correctly.

Output of building process, followed by Error List (if applicable) in Visual Studio

When I used Visual Studio 6 when that was the hot thing, one of the things I loved was that I would hit F7, compile, and watch the output of the build go buy and then be greeted with an error list when complete. I believed this changed in Visual Studio 2005, but I've had enough of it and would like my old way back. Is there a way to tell VS2012 to output the build output and then show the error list if it's applicable?
Sorry if this has been asked before, I checked and didn't see anything.
You can set the Tools -> Options -> Project and Solutions -> Show Output window when build starts
This seems to work for me.

Resources