Error when creating new Unity projects and in all existing projects - unity3d

I'm getting the following error in all of my unity projects and the new projects I create. I can not find a solution for this. I even tried uninstalling Unity, Unity Hub and Visual studio. Then reinstalling but still same issue. I'm using Latest unity 2020 LTS version. I tried different versions and issue stays the same.
Library\PackageCache\com.unity.ide.visualstudio#2.0.11\Editor\VisualStudioIntegration.cs(30,18):
error CS0246: The type or namespace name 'Messager' could not be found
(are you missing a using directive or an assembly reference?)
Any help highly appreciated.

Messager is a part of the Visual Studio Editor package
(Packages/com.unity.ide.visualstudio/Editor/Messaging/Messenger.cs).
It's likely the package Visual Studio Editor hadn't been installed correctly, re-install it through Unity's Package Manager. And check that you have Game Development With Unity package installed for the editor in Visual Studio Installer.

Related

Unity with Visual Studio 2019 : Assembly-CSharp (incompatible) in Solution Explorer

I'm new to Unity and can't find how to get it working with Visual Studio 2019 properly.
I just installed Unity 2020.3.13f1 (LTS) from the Unity Hub as recommended for Hololens developement.
I already had VS2019 latest version installed and working.
In VS2019, I installed: Tools => Get Tools and Features => Game development with Unity
When I double click a script in Unity, VS2019 open and I get the following error: Assembly-CSharp (incomptible)
Also in Unity, I have a warning: Visual Studio Editor Package version 2.0.11 is available, we strongly encourage you update from the Unity Package Manager for a better Visual Studio Integration
Update I fixed the warning (see below) but still have the error in Visual studio
In Unity, I updated the package: Window => Package Manager => Visual Studio Editor => 2.0.11
I also did: Edit => Preferences => External Tools => Regenerate project files
I now have all latest Unity package versions:
But I still have: "Assembly-CSharp (incomptible)", How to get valid solution in Visual Studio ???
Have had this issue for months... After numerous different posts/guides on this issue, I found just right clicking and hitting "Reload project with dependencies" for each project worked.
Now this was after fully updating Visual Studio and Unity, uninstalling the VS Unity tools, reinstalling, and reconfiguring visual studio tools in Unity... Figured I'd add this to to the list of things to try because it worked for me!
You should probably try right clicking the file and choose reload.
When I tried it Solved my issue
I deleted my project and created a new one and everything is fine now in Unity and Visual Studio (All references and scripts).

Reinstall Nuget Package Manager in Visual Studio 2019

I am facing a problem with my project.
The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?
This has happened before and I solved it by reinstalling the Nuget Package Manager using a command. Unfortunately, I am not finding that command again. I tried to find the solution online but everything I am getting is installing/reinstalling NuGet packages and not package manager.
Found this article: https://forums.asp.net/t/1776324.aspx?How+to+install+upgrade+VS+NuGet+Package+Manager+ but It's not applicable here.
NuGet Package Manager is preinstalled in VS2019 and no separate package to download and install. Also, there's not Extension Manage in VS2019 like older versions.
Please Let me know the command to reinstall NuGet Package Manager in Visual Studio 2019.
Such nuget restore issues can normally fix by deleting the obj folder where the nuget files like project.assets.json, projectname.csproj.nuget.g.targets, projectname.csproj.nuget.g.props, projectname.csproj.nuget.dgspec.json and projectnamecsproj.nuget.cache are stored.
If this still doesn't fix it, delete the hidden .vs folder inside the solution, where Visual Studio stores the user settings for the project.

Visual Studio 2017: Package Restore failed, Rolling back Package changes for 'Projectname'

Added the new Package using Package Manager console or manage nuget packages in Project it's not added project it's Throw below Error.
I was Check some Links Not give proper reason. why this problem in coming in vs2017
Anyone Know Share the knowledge.
Thanks in Advance
Visual Studio 2017: Package Restore failed, Rolling back Package changes for 'Projectname'
You could not install the package exceldatareader.dataset to the UWP project. That because this package only have the .NET Framework assemblies, which is not compatible with UWP project. You can download that package from nuget.org, then open it, you will find this package only have the assemblies for .NET 2.0 and .NET 4.5:
So this package is not compatible with UWP project, you can find the error message in the output window when you install it to the UWP project:
Hope this helps.

Nuget not restoring packages in visual studio 2015

I installed the Visual Studio 2015 yesterday on my work machine and map a project from TFS that i was working on the previous version (VS 2013). All the projects in this solution are build on top of .NET framework 4.5.1 . When i try to make a Restore Nuget Packages it says that all the packages in the packages.config files are downloaded already, but im getting a lot of compilation errors. The Microsoft.Exchange.WebServices.Data; reference for example, its declared on the packages.config file but im getting the 'red' error on the using clause of this reference in visual studio.
ThereĀ“s other package that the nuget says it is installed but in the references its possible to see an yellow triangle. And this package is on the packages.config too.
Is that something different in this new versio of nuget?
Ps. I already installed the update of the nuget program.

Could not install package 'NuGet.Client 3.2.0'

I'm working with RESTful webservice, getting error while adding package "System.Net.Http";
"The 'System.Net.Http 4.0.0' package requires NuGet client version '3.0' or above, but the current NuGet version is '2.8.5.0'. "
So, to resolve above error i'm trying to install "NuGet client" from "Add Package" option in xamarin studio, but this time I'm facing another issue that is;
"Could not install package 'NuGet.Client 3.2.0'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+MonoAndroid10+xamarinios10+MonoTouch10', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author."
please help to resolve this issue.
Xamarin Studio currently does not support NuGet 3. It is currently only supported in Visual Studio 2015.
It is not possible to upgrade Xamarin Studio so it supports NuGet 3 at this time. Installing the NuGet.Client NuGet package does not upgrade NuGet in Xamarin Studio.
I would instead look at using the Microsoft.Net.Http NuGet package which you can install into a portable class library project (PCL) and supports all Xamarin Android and Xamarin iOS projects.
I was able to grab a copy of System.Net.Http.dll from another project and manually add it as a reference to my Xamarin project. I put it in the packages folder and then browsed to it from the edit references dialog.
For people facing problem trying to add System.Net.Http...
I was able to solve the problem by using Microsoft.Net.Http instead of System.Net.Http. In Xamarin studio, Right click on your project > Add > Add NuGet Packages.. > search for "Microsoft Http Client Libraries" and click Add Package.