Visual Studio doesn't find my references and they are already here - c#

I'm coding a C# application. When I compile my code, I have hundreds of errors about some missing references and packages that I installed. Visual Studio indicate that it doesn't find them, but when I see the NuGet packages, they are all there!
This problem occurs after synchronising the project from git.

Related

Visual Studio 2017: References are mentioned not being built while they are already built

I'm working with Visual Studio 2017, enterprise version. I'm working on a C# project, depending on several NuGet packages.
One of my references is mentioned being missing (there's a yellow triangle above the icon in the solution explorer). When I double-click on it, in order to see its contents in the object browser, I get following error message:
This project cannot be viewed in the object browser because it is unavailable or not yet built.
Please ensure that the project is available and built.
You might think: "just restore the package (it's a NuGet package) and off you go", but the problem is that the message makes no sense:
In another project, I am using the exact same NuGet package as a reference, there everything is fine, and when I do a file/directory compare between that other project and my current one, WinMerge mentions both being equal. (Not only WinMerge, I also did a checksum comparison)
So my question is: what's the source of Visual Studio's This project cannot be viewed in the object browser because it is unavailable or not yet built. error message? What's the source of the yellow triangle in Visual Studio's solution explorer (for NuGet packages)?
Edit (added: Visual Studio version)
For your information, I'm working with Visual Studio enterprise 2017, version 15.9.36.
In the meantime I've found a workaround: I remove the references from the project and add them again, and it seems to work. Apparently there's some instability in Visual Studio reference handling.

This project(Visual Studio 2012 express) is incompatible with the current version of Visual Studio 2013 express

Am doing a back end project in C# in Visual Studio. My team mate had done it using Visual Studio 2012 express and everything seems to work there. But when i used git to clone it to my system where am using Visual Studio 2013 express, one part of the project says its incompatible with the current version of VS. I could clean and build the project, but was unable to run the project. I searched and found that one solution is to go to Programs and features, select VS, right click,select repair. But even after doing this, the problem persists. Is there any work around?
When I was learning ASP.NET MVC by Informit tutorials I was in the very similar situation. I downloaded the sample sources that was created in VS2013 but had VS2015 installed. It was some kind of bug \ magic, but VS didn't recognized some libraries in VS2015 even they were installed. What is more strange is the fact that when I decided to totally rewrite the project line by line it worked!
Of course, I tried to clean, rebuild, reinstall NuGet packages.
So, if you have an access to sources *.cs, then just try to create new project and copy-paste code.

Cannot create a sub project when using the Diagnostics solution template

I installed
Visual Studio 2015 RC
Visual Studio 2015 RC SDK
.NET Compiler Platform SDK Templates
.NET Compiler Platform Syntax Visualizer
However when I now try to create a "Diagnostic with Code Fix" I receive this error:
A problem was encountered creating the sub project. The imported project "C:\Program Files (x86)\MSBuild\Microsoft\Portable\v4.5.2\Microsoft.Portable.CSharp.targets" was not found.
Afterwards I receive two more error messages which seem to stem from this. These error messages occur as VS is trying to create the other projects in the solution template.
When I look at the folder in question, I see this structure:
I copied the contents of v4.6 and put it in a folder named v4.5.2 which indeed resolved the problem when creating the projects, but this causes build errors: System.Runtime isn't added to the projects and manually adding it causes Visual Studio to crash and the projects to become invalid.
I already repaired the entire installation, which didn't make a difference. Visual Studio 2013 runs alongside 2015.
I assume I must be missing a vital component but I can't find any indication as to what that might be. Any suggestions?
Try changing the target framework version at the top of the new project dialog to 4.5 before creating the project.
You say you are using these templates
.NET Compiler Platform SDK Templates
.NET Compiler Platform Syntax Visualize
Are they the RC templates
Or the Preview templates from November?
I ask because there was a bug that caused you to reference the wrong portable targets in the Preview templates, but that should be fixed for RC.

Every reference in Visual Studio Project is showing as invalid

I have a very strange issue where I have opened a known to be working Visual Studio 2010 project but it no longer builds and every reference is shown as not being valid as shown in the screenshot below.
I have no idea why or what to do.
I have installed Visual Studio 2013 Express so I'm not sure if this may have screwed up something somewhere, but as a test the project is open in 2010 and I'm seeing this issue.
In the error tab of VS it shows the following error:
Error 1 This project references NuGet package(s) that are missing on
this computer. Enable NuGet Package Restore to download them. For
more information, see http://go.microsoft.com/fwlink/?LinkID=322105.
The missing file is
....\ServerAdministrator\packages\System.Data.SQLite.Core.1.0.94.0\build\net40\System.Data.SQLite.Core.targets. C:\Users\Chris\Documents\Visual
Studio
2013\Projects\BoardiesITSolutionsLib\BoardiesITSolutions\BoardiesITSolutions.csproj 131 5 BoardiesITSolutions
The ServerAdministrator program that its mentioning is a totally different project, I've tried removing the references to System.Data.SqliteCore and tried telling NuGet to re-add them but no joy.
The warnings are:
The Referenced component 'WindowsBase' could not be found
The Referenced component `System.Xml.Linq' could not be found
All of the warnings are along the same lines as above for each references shown in the screenshot.
As requested, my comment as an answer:
If you look at the .csproj project file in a text editor (it's really just XML), do the references make sense?
Do you have that version of the .NET framework installed?
Typically the raw project file will give you a more detailed idea of what's going on than the IDE will.

Bulid SQLite-Net Extensions in visual studio professional 2013 but not successful

I am new to windows app and I am going to build the sqlite-net extension project to .dll file in order to make the models have the relationship attribute of one-to-many, one-to-one, many-to-many.
Link: https://bitbucket.org/twincoders/sqlite-net-extensions
This is the info that it shows when I open the project in visual studio 2013.
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. For more information
on enabling these project types or otherwise migrating your assets,
please see the details in the "Migration Report" displayed after
clicking OK.
- IntegrationTests.Touch-MvvmCross, "C:\Users\**\Downloads\sqlite-net-extensions\sqlite-net-extensions\IntegrationTests.Touch\IntegrationTests.Touch-MvvmCross.csproj"
- IntegrationTests.Touch-PCL, "C:\Users\**\Downloads\sqlite-net-extensions\sqlite-net-extensions\IntegrationTests.Touch\IntegrationTests.Touch-PCL.csproj"
No changes required These projects can be opened in Visual Studio
2013, Visual Studio 2012, and Visual Studio 2010 SP1 without changing
them.
- Tests, "C:\Users\**\Downloads\sqlite-net-extensions\sqlite-net-extensions\Tests\Tests.csproj"
- MvvmCross, "MvvmCross"
- SQLiteNetExtensions-MvvmCross, "C:\Users\**\Downloads\sqlite-net-extensions\sqlite-net-extensions\SQLiteNetExtensions\SQLiteNetExtensions-MvvmCross.csproj"
- SQLiteNetExtensions-PCL, "C:\Users\**\Downloads\sqlite-net-extensions\sqlite-net-extensions\SQLiteNetExtensions\SQLiteNetExtensions-PCL.csproj"
- SQLiteNetExtensions, "C:\Users\**\Downloads\sqlite-net-extensions\sqlite-net-extensions\SQLiteNetExtensions.sln"
I try to build it and it shows some errors. So I right click the project and download the missing packages. When I try to build it again, it shows these errors:
Does anyone successfully bulid it to .dll file or anyone can fix the problems like these?
Many Thanks!
The Integration test projects are MonoTouch projects, that won't open in Visual Studio unless you have Xamarin Business license installed in your PC.
However, the SQLite-Net Extensions project is a standard PCL project and you will be able to compile it from Visual Studio without Xamarin. The problem that you are describing is probably related to not having the SQLite-Net dependency downloaded.
Make sure that you have NuGet Package Manager plugin installed and restore NuGet packages for the project to restore the dependencies and it should work.
You can also download the pre-compiled DLL from the Download page in the project page.
I solved it with changing the build platform. Thx guys!

Categories