VS 2015 w/ Xamarin: This item does not support previewing - c#

I'm using Visual Studio 2015 with Xamarin 4.1.2.18 and CocosSharp PCL 1.6.2.
When I try to access the Properties of the Android project by clicking on the "Properties" item in the Solution Explorer, this error pops up:
If I also right click on the project itself and select "Properties", it displays "This item does not support previewing".
It should be opening up to this page:
I have (supposedly) the latest build and Update 3. I have reinstalled it 3 times now.
Normal uninstaller. Reinstalled... nothing, still broken.
Uninstall again with cmd: /uninstall /force, use registry cleaners, manually uninstall components from Control Panel, manually delete folders. Reinstall... still broken.
Finally, I searched around and found this: Microsoft Visual Studio Uninstaller. After I, again, performed all the steps of 2, I used this tool and it found 52 additional things to clean up. I thought I finally had fixed it. Nope. The properties thing is still broken.
I have tried running as administrator. Nope.
I have deleted the ComponentModelCache in local AppData. Nope.
I have deleted the .suo file. Nope.
I know it has nothing to do with the project files because we have all the files synced with Git and my friend can view the properties page fine on his computer.
Does anybody know how I can fix this?
Is there some way to gather more information on the error?
Any Visual Studio error logs?
Also, on an semi-unrelated note:
When I try to build the Android project, I get errors saying that the $(TargetFrameworkVersion) for my references/dependencies is v4.2 and the $(TargetFrameworkVersion) of my project is v2.3. I checked my TargetFrameworkVersion property in the .csproj file and it's v6.0!
So, something is seriously wrong with this build of Visual Studio or something.
I've been considering just installing Visual Studio on a VM just to be sure.
Solution:
In the Android SDK manager, I had Android 4.0 (API 14) downloaded. Once I switched to Android 4.2.2 (API 17) everything started working.
I just gotta say, the error that it gave me is the most convoluted error message that I've ever received in the history of my programming career.

Related

Visual studio 2019 go to definition and Intellisense not working

I have noticed a weird issue with Visual Studio 2019 v16.0.1 the IntelliSense about "Using directive is unnecessary" normally grey is missing and type reference suggestion for missing using is not working.
I also tried with Visual Studio 2019 Preview but no luck.
I have tried the following:
deleted .vs folder and restarted.
Reinstalled Visual Studio
Reset settings via import and export setting under tools
Any other suggestions will be appreciated.
Close Visual Studio
Delete .vs folder (it is a hidden folder inside the folder which contains the solution *.sln)
Start Visual Studio
Solved my problem
Update From the comments
Deleting Browse.VC.db file within .vs folder worked for me. I did this to avoid deleting .suo which has information I want to preserve
NOTE 1: I am using Visual Studio 2019, but it may work on other versions
NOTE 2: This did not solve the OP problem, but it is a good candidate to solve your
Go to Tools -> Options -> Text Editor -> All Languages -> General. Make sure “Auto List Members” is checked. Also, make sure “Parameter Information” is checked.
If you are facing this issue with Unity projects then,
Check in your Unity settings whether it has Visual Studio configured as the external editor.
Click on Regenarate project files in the Unity settings.
Go to Assets => Open C# project.
This will restart Visual Studio with your project.
In my case, Resharper is the culprit. Disabling it immediately solved the issue.
I think these issues are discussed here and are resolved by an update and some worksrounds are bring discussed:
https://developercommunity.visualstudio.com/content/problem/505489/cannot-navigate-to-the-symbol-under-the-caret-3.html
For anyone who are searching for another suggestion, I just go throught this issue, as OP said, I've deleted .vs folder, I've update vs to last version, I've uninstalled and reinstalled vs to the last version, I've reset settings, delete all obj folders, I've installed Microsoft.Net.Compilers but nothing worked, at the end I just remembered that sometimes the projects required WindowsBase library, until now I don't know why, but after adding that dll Intellisense started to function again.
I use resharper (vs 2017) but had not installed it on 2019. After installing Resharper on 2019 the intellisense started working again. (yes, it was working in 2019, then stopped)
I don't have an explanation on why this would fix it. Just did for me.
First time I use VS 2019, I need to manually install Code Analysis. Make sure it is installed at your project properties.
And today, for the new class, the suggestion or namespaces not showing for VS 2019 Intellisense, and Go to Definition not working too.
I must do close solution, and re-open and VS 2019 doing scanning while opening project, and then worked again.
I think this is bug for VS 2019. Try to close solution and re-open it.
I have tried almost all the solution mentioned above but it doesn't helped me. Trying to restart my PC solved my problem.
I tried lots of things but nothing worked for me until I found this post. He mentions a few things I have already tried that didn't work, but his final solution worked for me...
At the root of our solution there is a packages folder. I deleted the
entire contents of this folder. Upon reopening Visual Studio,
Intellisense and Go To Definition were restored to full working order.
close visual stdio
For mac in your folder: do command + shift+ .
you will see hidden files -> delete .vs folder
open solution again
After working for a few months, Intellisense suddenly stopped. This cost me a lot of lost time! I've been worked with Visual Studio for about 10 years, and this problem happens occasionally in every version.
Here's what I tried for this iteration of the problem:
Closing Visual Studio and re-opening does sometimes make the problem disappear for a short time, but it certainly doesn't solve it
Likewise restarting my laptop
Installing the latest Visual Studio 2019 update didn't help (I'm on 16.8.3 now if anyone's interested)
Deleting the hidden .vs folder doesn't seem to solve anything (doing so also means you lose your current window layout, as well as any bookmarks you've set)
Unticking the Track Changes option in this menu: Tools-> Options-> Text Editor-> General.
I've updated my NuGet reference to the Microsoft.Net.Compilers library to the latest stable version, as suggested here, but sadly this made no difference
I thought I've finally solved the problem by following the advice from Homer. I deleted the packages folder at the base level of my project (somewhat nervously, as I wasn't sure if it was needed), and thought it had solved the problem, but no such luck.
However, one thing to watch out for - after doing this, Visual Studio recognised my classes but no longer recognised built-in ones (all the referenced namespaces at the top of my controllers were underlined in red). I then deleted the .vs folder (again), which seemed to solve the problem.
When I recompiled my solution, it gave a few CS0433 compilation errors with duplicate namespaces for the MinLength and MaxLength directives in some identity user name and password validation code. I got round this by removing the Microsoft.EntityFramework Nuget library (I had to also remove Microsoft.AspNet.Identity.EntityFramework too, since this depended on it), then adding them both back in, making sure to include at least version 6.2 of the former (otherwise I got another runtime error to do with the FirstOrDefaultAsync method called somewhere!).
My current situation: all existing Intellisense is working, but it's not recognising new classes I add unless I exit Visual Studio and go back in again. May have to live with this ... unless anyone can help me?
I've got that problem today with only one project. I got no Intellisense warnings (i.e. naming styles, "Variable not referenced", etc..) for files in that project. Not in VS 2017 Pro nor in VS 2019 Community.
Check, if your Project->Build->"Warning level" is set to 0...
If you have Visual Studio 2017 installed side-by-side with Visual Studio 2019, close VS2019, open the project in VS2017, wait until it is fully loaded, then close VS2017, and reopen VS2019 - fixed!
There must be a bug in the VS2019 intellisense stuff, but VS2017 seems to fix it with no need to keep deleting the .vs directory.

Visual studio 2017 Info.plist lose Distribution Destination after tab change

I've a problem when release IOS app with Visual Studio 2017 that i can reproduce doing the following opertions:
1) I need to change the IOS destination version to 9.0 because i must support olders device, so i edit the Info.plist like below:
2) I publish my ipa file as usual and my destination version of the builded ipa is 11 (i can see it uploading on diawi but even trying to install on a ios8 device that show me the error "Unable to download {app-name} at this time")... mh nice... i go back to Info.plist and i see that the Destination version is blank:
3) I try to edit it again but when i change "tab" or build .ipa file I come back to point 2.
I've just tried the standard things like delete bin/obj and rebuild or disconnect-reconnect the mac but nothing works :(
Some useful things:
On IOS 11 the ipa file works perfectly.
I'm using an Enterprise realease Certificate.
My Mac XCode Version is 9.2 (I've not enought free disk space to upgrade. Updated but no success.
I've Already change the data inside the info.plist but seems that it will be ignored:
<key>MinimumOSVersion</key>
<string>9.0</string>
I do a clean install on my mac of Hight Sierra + XCode + VS2017 at the last version but nothing has changed :(
Try to edit your info.plist outside of the IDE. I faced a bug in the past that VS2017 overwrote some settings with default values when I used the GUI editor, and because of this I started making all my changes to the plist file manually.
The setting name you need to set manually is probably "MinimumOSVersion" in the file.
<key>MinimumOSVersion</key>
<string>9.0</string>
Was a Visual studio bug.....
Installing the last released VS update fix my problem (Visual studio professional 2017 v15.8.7).
Thanks Evryone for your time :)

The referenced component Mono.Android could not be found

I have the same problem...pls help me...
I just installed the Xamarin and want to use vs2015 . When I create a new Blank App (Android) and I’m getting the following errors. How can I fix this? I reinstalled vs2015 and reinstalled Xamarin but I’m still getting the errors.
The referenced component ‘Mono.Android’ could not be found.
The referenced component ‘mscorlib’ could not be found.
The referenced component ‘System’ could not be found.
The referenced component ‘System.Core’ could not be found.
The referenced component ‘System.Xml’ could not be found.
The referenced component ‘System.Xml.Linq’ could not be found.
For me, I just ran into this trying to build a project pulled from TFS on a new VS 2015 Update 2 install. Not sure what exactly fixed it but this is what I did:
Download Android API 23 and 22 SDK from the SDK Manager and also updated all other items in SDK Manager (had to close and open it twice to get it totally up-to-date).
Nuget Restore packages (this did not fully fix it).
Followed these instructions where you go into all .csproj file in the solution and remove all mentions of nuget. Also do this in the solution file, but mine had nothing.
Use Package Console and run Update-Package -Reinstall (of if you know these package were building just fine before, I ran ``Update-Package -Reinstall -IgnoreDependencies`) and choose the project if you want.
Still had a couple errors from the Android Resource Designer file so did a build and everything was right in the world again.
For me it was a Mono.Android.dll version issue.
I removed the reference, and added a reference to the right version.
These errors most likely point to an installation with missing pieces (or a corrupt install). Try reinstalling Xamarin (again, yes) with admin privileges if you haven't done so already.
If you check your version information via "Help -> About Microsoft Visual Studio -> Copy Info [button]" and Xamarin isn't listed in the bottom, then your install didn't go through correctly.
Additionally, can you double check you have the Android SDK installed? Open up the start menu and type Android SDK Manager. Run it and make sure you've downloaded the build tools and one of the recent API levels.
For me i had to remove the pcl(portable class library) from the solution then added it back then the issue was resolved.

Visual studio doesn't support specific csproj file

I am getting this error when I try to open the solution file of my project. The solution is 2012 file (checked using notepad).
If I click on Ok, The solution opens up except for one csproject which does not load.
I get a migration report in UpgradeLog.htm file, with the following error for the project which failed to load. Could not figure out much from it.
Error:
The application which this project type is based on was not found.
Please try this link for further information:
http://go.microsoft.com/fwlink/?prd=12395&pver=11&sbp=ProjectTypeDeprecated&plcid=0x409&clcid=0x409&ar=MSDN&sar=ProjectCompatibility&o1=82b43b9b-a64c-4715-b499-d71e9ca2bd60
Does the upgrade report mean that it is a project from previous version of Visual studio? It does not open in Visual Studio 2010 either.
The error doesn't say that Visual Studio doesn't support .csproj files at all, it says it doesn't support a specific project type in that particular project file. This means this either isn't your project as you claim, or you are trying to build it on a different machine from the one used to create the project.
Visual Studio uses various elements in a .csproj file to determine its project type. See How do you tell the Visual Studio project type from an existing Visual Studio project and What is the significance of ProjectTypeGuids tag in the visual studio project file. It does this so it knows how to compile your project, what properties tabs to show, what context menu options should be available and so on.
Certain project types can cause this error. Usually they require some kind of SDK to be installed on the machine used to open or build the project.
You should search the web for the GUID mentioned in the error message you show (the value after o1=). You can also open the project file in a text editor and find the <ProjectTypeGuids> elements, which contains comma-separated project type GUIDs.
Then search the web for those GUIDs to find out which SDK or tool you need to install in order to be able to open or build the project.
If you paste the specific GUID from your error message in your favorite web search engine, you'll find Problem solved: Visual Studio / There is a missing project subtype. Subtype: '{82b43b9b-a64c-4715-b499-d71e9ca2bd60}' is unsupported by this installation., where it is mentioned you'll need to install the Visual Studio 2013 SDK. This means that in this case, your project is a Visual Studio 2013 extension.
This is what documentation is for. You should at least put a ReadMe.txt file in your project directory, explaining what the prerequisites for building a project are, especially when it won't open or build with Visual Studio out of the box.
I had this issue when I used Update 5 for VS 2013.
For me I had to click ok and read the next few steps, that popped up. I was initially clicking cancel.
On mine the project was missing Web Tools, so had to reinstall those and once done it was working.
Hope that helps someone.
This issue also appears when trying to import an ASP.Net project into Visual Studio 2015 Express for Desktop, and can be solved by simply downloading and installing Express 2015 for Web - or by using Visual Studio Community/Standard.
I am currently using VS 2017 v 15.7.4. This error came out of no where without any updates on my part. Usually when I have errors like this I just delete the .vs folder in my solution and that clears the problem. In this case that is what I did and the problem was fixed.
Close VS
Delete .vs folder
Load VS
Note: This was for a Xamarin based solution.
I solved this problem by downloading and installing (Microsoft Visual Studio Installer Projects). Close the project then install. After the installation, open your project then reload .csproj file
I had the same issue with VS 2017.
Eventually i solved it by just enable the SSIS in the following way:
1. In VS 2017 - Click on Extensions and Updates in the Tools menu.
Locate the Microsoft Integration Services Projects.
if you can't find it then you will have to install it first.
Click on the Enable button.
Close VS and start it again and SSIS projects are now available.
enter image description here
This (the error that states "Visual studio doesn't support specific csproj file") also occurs when the .vs folder is removed; however, closing and reopening Visual Studio will resolve the error.

Visual Studio 2013 dosen't recognize anything

I opened my WinRT (I'm using MVVMLight) project in Visual Studio 2013 this morning, and found out that all kind of types even system ones are not recognized saying Cannot resolve symbol 'bool' for example, note that the solution builds, executes and works all fine !
C# :
Even XAML :
I tried many things, closed and reopened the solution, cleared Resharper caches, I even restarted Visual Studio and the PC, but still the same problem, any solution to this problem ?
Update 1 : I tried to Suspend/Resume Resharper from Tools>Options and even delete files from AppData\Local\JetBrains\ReSharper\v8.0\SolutionCaches, and now Visual Studio causes errors too :
Update 2 : I uninstalled/re-installed visual studio, and I still have the same problems
If you have any Xamarin extensions for Visual Studio installed, it is a root of the problem. There are some compatibility problems.
As a possible workaround, you may try a workaround, mentioned in this ticket:
Select 'true' for 'Use msbuild to obtain project references' in
Project Properties (Click on project name in Solution Explorer | Hit
F4) for each project in the solution.
At least, it works for me.
If you can build the solution, but ReSharper marks your code in red - you can write the request here and you will likely get a help.
If you can't build your project then it is not ReSharper's problem. Then we need to find out why your build is broken.
It seems that your project to assembly references are broken.
To understand what's happening here with references during the build, go to Tools -> Options -> Projects and Solutions -> Build/Debug and set the verbosity to diagnostic. Then try to build your project and investigate the output windows in VS (or you can use MSBuild.exe from the command line instead). What you need to find in this large text block is "Resolve Assembly references" or "Expand SDK references" task. These tasks should obtain the valid paths to the assemblies your project depends on. Later on csc.exe should be executed with all these paths as parameters.
You can check whether the paths are correct, do they indicate to the existing binaries or not.
You can also create a new WinRT project template and check if it can build. If it cannot even for the clean project template then it is obviously a system problem, I suppose your platform sdk's are corrupted.
Hope this will help.

Categories