Visual Studio syntax highlighting / autocomplete not working correctly - visual-studio

My Visual Studio does not highlight or autocomplete any Unity3D commands any more. I created a new script when noticing that. I restarted VS, reinstalled VS, also reverted all script changes I made today in my project but the result is still the same. Also I now get errors when trying to open my project file. It says it needs a migration and isn't compatible with the current Visual Studio version installed.
The actual error reads "The application that is based on this project type was not found." [translated from German].
I found similar posts on the web where reinstalling VS resolved the issue. Unfortunately, it did not for me. This is how it looks:
Anybody knows how I can fix this?

Ok, I was able to resolve this issue using this trick:
"Do me a favor... if this is Visual Studio 2017... hit your start menu and find Visual Studio Installer... Run it... select "Modify" and select individual components... find Visual Studio Tools for Unity... if it's installed, untick it and uninstall it, then run the installer again and reinstall it. Otherwise, just tick it and install it."

Related

Cannot find UnityEngine.InputSystem

I am currently working on a new unity project and to be honest i am new at this.
I need to use the InputSystem package but Visual studio does not recognize it.
This is the version of my VS. Microsoft Visual Studio Community 2019 Version 16.9.3 and the version of Unity is 2020.2.1
As you can see by the picture, my VS already knows that I am working in a Unity project.
So the first thing that I tried doing is to regenerate project files but it didnt work. I also selected my VS as my default external script editor.
This is my external tools.
I re-installed VS using unity hub but nothing happend.
Do you have any suggestions? I followed some tutorials I saw over the internet but I am still getting no positive results and to be honest, I am getting out of ideas.
Just tested out the package installation. I installed the package in a fresh, empty Unity project. Here are the steps that I went through which worked in my case:
Locate the Input System package in the Package Manager
Click install
A warning prompt will appear, click yes
Unity Editor should now get re-launched on it's own, wait for that to happen
If Visual Studio is open, close it
Open Visual studio - right click on the Assets folder and select Open C# project
UnityEngine.InputSystem namespace should now be available, if not, re-open Visual Studio one more time
Let me know if it works for you.
For me works when I install .NET and .NET Core and reboot the computer. (made this on Windows)
https://dotnet.microsoft.com/en-us/download
https://dotnet.microsoft.com/en-us/download/dotnet/3.1

Cannot install any Visual Studio program

I have been trying to install Visual Studio for a couple of days now and none have operated. First I tried Visual Studio Community 2017 and the installer was installed and then the vs was installed but when I try and run it I got an error message that directed me to the ActivityLog file. I've tried uninstalling it then reinstalling it but that didn't work. I came across a solution that required me to try opening it using the Developer Command Prompt which I wanted to do but when I clicked on it from the Start menu it said that the link is missing. There was another Visual Studio program that had also installed and when I tried loading that one, it also directed me an ActivityLog file.
So I uninstalled the 2017 version and tried installing an earlier version hoping that it would work. I can reinstall for whomsoever would want to see the error message as well as the log file.
I then tried the 2013 version (since that is the one we use at school anyway). After downloading the file, I do not even get to an installation screen. A pop-up appears that says that the program requires the Microsoft .NET framework to work
Installation pop up window
The first time I tried it gave me options to accept and continue or cancel so I clicked on accept and continue and that was the end of it. Nothing happened after that. Now when I click on the installation file it just appears as in the picture above with no options. I tried to follow the instructions on Cannot install Visual Studio 2017 Community since that is the closet to my problem that I have found but it still didn't work.
Please help. I really need at least one Visual Basic to work.

Visual Studio 2017 crash

We are running into a problem opening our MVC5 solution in Visual Studio 2017. It will show a message saying loading projects, followed by "Preparing solution" and then it just freezes. Some preliminary research has lead to suggestions like
Remove the hidden .vs folder
Repair installation by running as admin
Updating to the latest released VS build
Remove any node.js type folders that have deeply nested folder structure within the solution folder
However, none of these have worked. Has anyone else run into a similar problem using VS 2017 with their solution? There are no special commands on packages loaded on startup.
I was able to finally get it to work. I updated to the latest Visual Studio build 15.0.0+26228.10, but that did not seem to help. After removing my .vs folder before opening the solution multiple times, it finally started to load. I have no 3rd party extensions or tools running.
I installed visual studio enterprise 2017 version 15.0.0+26228.10. and productivity power tool extension. the studio keep crashing when load project. I uninstall everything and reinstall vs only, the crash problem disappeared.
Deleted the vs folder, but it didn't work.
Looked for recently changed files in the project, saw Web.csproj.user — when I removed this the project works again.
Visual studio 2017 keeps crashing when i try to launch it,all i did was to launch visual studio installer go to more which is under the product am using then clicked on repair and that got me running again.
We saw some lockups, especially during the start of Batch Builds, until we set this experimental feature to False:
Tools > Options : Text Editor > C/C++ > Experimental : Enable Faster Project Load.
I don't know whether it could apply to your problem or not, but it is related to loading projects, so...
Good luck.
I had the same issue and uninstalled the ankhsvn subversion plugin then closed and re opened vs 2017 ad it worked.

How to fix missing file in visual studio cordova blank new app project

I am having a problem with my codova plugin and I can't really run anything or write code.
What happens:
None of the additional files are shown in the solution explorer when I open a new cordova project. (There should be several files and folders according to the manual.) -- see picture included.
I can not build/run (probably because of 1).
I am using Visual Studio enterprise 2015 with the latest updates.
I tried going through the manuals and re-installed twice, nothing helped.
Please help :)
Thanks,Isan.
Open developer command prompt and run devenv /setup. See if it can help to fix the issue.
If above doesn't work, please
go to control panel-> Programs and Features -> double click to launch the installation program of Visual Studio 2015.
Then select "Modify" and deselect the tools for Apache Cordova to remove it first.
After #2, repeat #1 & #2 but this time please select the tools for apache Cordova to reinstall it.

set property 'system.windows.resourcedictionary.deferrablecontent' threw an exception

I'm running Visual Studio 2012, when I add a new File/Reference to a project the message box appears showing the error message
set property 'system.windows.resourcedictionary.deferrablecontent' threw an exception
I read an MSDN article suggesting to run the command devenv /resetuserdata on visual studio command prompt to resolve this problem, tried it but didn't work for me. In fact the command prompt shows the Unknown Error message.
Some addins cause this issue for me so have had to workaround it whenever it occurs:
In Vis studio -
Tools > Options > Environment > Add-in Security, uncheck 'Allow Add-in components to load', OK
Restart vis studio
The error shouldn't occur anymore, so go back to
Tools > Options > Environment > Add-in Security and re-check Allow Add-in components to load, OK
To be specific, I get this error when trying to add files to projects and manage Nuget Packages.
Update
I now make a point of opening
'Tools > Nuget package manager > Manage nuget packages for solution'
whenever I open up a new instance of Vis studio, before loading a solution, just to make sure the window loads properly
That way I know I won't get this issue.
In my case it was a style with the same key defined twice in a ResourceDictionary (WPF)
I have Windows azure tools for Microsoft VisulStudio 2013- v2.2 and Windows azure tools for Microsoft lightswitch VisulStudio 2013- v2.2.
I uninstall only Windows azure tools for microsoft lightswitch vs 2013 .
It's working fine...
I fixed it. The resolution was to remove the Windows Azure Tools for Visual Studio 2012 which I was not actually using, and the error went straight away.
In my case it was to first launch Visual Studio in safe mode. You can create a shortcut for visual studio with a target like this:
'"F:\Program Files\Visual Studio\VS2013\Common7\IDE\devenv.exe" -safemode'
Once launched in safe mode, you can remove the problematic extension via the Addin Manager. However, this wont work for some extensions, as the uninstall option might be disabled for certain extensions when running in safe mode, particularly if you have already uninstalled another extension in the same session.
In My case the problem was caused by Paradox Game engine, in which I had uninstalled it via 'Programs and Features' - which in return did not remove the extension which was originally installed via Nuget package. Uninstalling Paradox via "Programs And Features" left the extension itself still registered in Visual Studio, presumably causing a hidden NullReferenceException.
This issue can be caused by any extension that may have an error in it, or by extensions that were not properly uninstalled.
Also, see this article...
The mentioned issue can be resolved by simply restart the Visual Studio. :P
Also seem to be able to get around this by closing the project and vis studio instance, re-opening, then when the start page/open project screen appears selecting Tools > Extensions and Updates..., then pressing Close
Now open the project and the error doesn't get thrown when trying add files or manage nuget packages, weird.
Just annoying you have to remember to open Extensions and Updates each time...
Other wise make sure given Resourcedictionary.xaml path is correct or not
I had to remove Xamarin from Add/Remove Programs in Control panel and restart Visual studio to fix this.
I had this problem with My Devexpress Project in VS 2015
What finally worked for me was.
Close my solution,
Close Visual Studio,
Open Visual Studio,
Create a New dummy project,
Add a form to it,
Close and save the new project,
Reopen original project and all was ok.
for everyone else who are working in silverlight sdk environment with windows phone8 sdk.
The versions of sliverlight which are compatible with visual studio versions -
vs2012- sliverlight sdk 4
vs2013- silverlight sdk 5
I was integrating in vs2013 and as soon as I updated it with silverlight sdk 5, The errors went away.
In my case it was the Line Endings: you can have different formatting and by copy pasting some code one file got a different Line Ending. It was enough to File > Save As and then click the little arrow next to the save button.
Then click on save with encoding and choose the one you are using in all other files.
See Andrew Truckle's answer.
I hope this helps

Resources