Broken references when migrating from Visual Studio 2013 to Visual Studio 2015 - asp.net-mvc

When migrating packages from VS2013 to VS2015, all external and internal references for Data Access Layer Project were completely broken. References and packages for all other projects are fine. When uninstalling and re-installing/re-adding the references they still appear as broken.
Has anyone ever encountered this before? If so, what did you do to fix this?

I ended up removing the project from Team Foundation Server, opened it up with Visual Studio 2013 and mapped it to a different location. The program then rebuilt successfully and now when opening it with Visual Studio 2015 all references are building.

Have had the same issue. After analyzing project warnings I found that NuGet can't restore packages from solution's .nuget folder. In my situation enabling automatic package restore according to this answer fixed all errors.

Related

NuGet: Error HRESULT E_FAIL has been returned from a call to a COM component

When I try to add a new package with NuGet I get the error
Error HRESULT E_FAIL has been returned from a call to a COM component.
I've checked several posts about this and tried alot of solutions but can't seem to find the issue. It might be worthing noting that I moved and renamed my project at some point and the copy I left behind still functions with NuGet packages.
After looking into it some more I found this error:
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
at EnvDTE.SourceControl.CheckOutItem(String ItemName)
What I've tried already:
Deleting the user.csproj and/or .suo
Checking all project references and if they are located correctly
Deleting Temp files
Deleting bin & obj folders
Deleting the ProjectTemplatesCache
Checking the project web properties
Restarting VS, cleaning and rebuilding the project (always run in
admin).
Deleting the ComponentModelCache
Deleting packages folder content and restoring NuGet packages in
solution.
Check-in all pending changes to version control before attempting to
add a new NuGet package.
I just had this 01.08.2019 with both Visual Studio 2019 and Visual Studio 2017. I've tried the following solutions which did not work:
https://social.msdn.microsoft.com/Forums/officeocs/en-US/4eea5785-0a83-4389-89e3-209a5a4432c0/referencemanagerpackage-fails-to-install-vs-2017-community-edition?forum=vssetup
Error HRESULT E_FAIL has been returned from a call to a COM component on Add Reference
What worked for me is simply deleting the .vs folder and also deleting everything from the packages folder of the solution I was using. Then I ran Restore NuGet Packages on the solution level.
Checking in all pending changes and then performing a 'check-out for edit now' did the trick.
I had this problem with a log4net version on a build server. After backing up the local source folder I removed it, then started up visual studio, went to the Source Control Explorer, found my solution and went to Check out for Edit.
Once I had a new local copy of latest version, had to go to the directory on disk and replace the log4net package.
Then go back to visual studio, and build the solution, which built ok now. Then check everything in again, and the build server was fixed.
It can be happen when you create a Project in upper version Visual Studio and working in lower version Visual Studio.
Check which version Visual Studio you create your project and now working in which version Visual studio.
Try it on latest version Visual Studio.

Visual Studio Team Services doesn't get the packages folder for VS 2015 solution

Background:
I have an MVC application recently ported to Visual Studio 2015 Pro
All relevant references are set to Copy Local = True
We are using Visual Studio Team Services (previously Visual Studio Online) for our repository
I am able to compile, publish, and run the application locally without issues
All dlls contained in the \packages folder are not getting committed to Team Services and NuGet isn't fixing this on the other machines.
How do I fix this so everyone else can compile this application?
I have read many "solutions" to this problem, but none have worked. One that seems to fix the issue for many people doesn't work in VS2015 because Microsoft removed the option to automatically restore NuGet packages.
I have searched many other sites, and similar posts on Stack, but none are exactly this issue.
Please help me fix it.

Visual Studio 2015 Nuget Restore Problems for Version 1.0.3 of Newtonsoft.Json.dll

I have a solution which was working with Visual Studio 2015 Community in a machine. That machine was crashed and I can not access the source codes over there any more.
However the source codes were checked into TFS. After I got new machine, I got all latest source codes from TFS.
The issue is that this solution in new machine has a lot of compile errors.
Visual Studio 2015 could restore some of the references. However I have a complain like this -
Clicking button Restore will have this error -
I don't think I have used a version of 1.0.3 of Newtonsoft.Json.dll directly. I deleted the package folder and all project bin and obj folders. The recompile still can not fix it.
What can be done to fix this problem?
Have you also delete the NuGet.Config file in the packages folder? If you did it, Visual Studio will try to do the MSBuild package restore instead of Automatic Package Restore.
By default, the NuGet.Config file instructs NuGet to bypass adding
package binaries to source control. Automatic Package Restore will
honor this as long as you leave this file in place. Note that
NuGet.Config only has an effect when using Visual Studio to integrate
with Team Foundation Server (TFS).
You should also manually remove references in all your projects to the Nuget.targets file. The following article outlines in more details: https://docs.nuget.org/consume/package-restore/migrating-to-automatic-package-restore
If you still can't fix it, try to use the Command-Line Package Restore

Robert Giesecke's Unmanaged Exports and Visual Studio 2015 Build Error

We have been using Robert Giesecke's excellent Unmanaged Exports library for a while with our Delphi application. We just upgraded to Visual Studio 2015 and it doesn't seem to be working anymore--I can compile the exact same project in VS2013 and it works fine, can access the functions in the DLL, etc. I recompile in VS2015 (exact same code and project) and I get a build failure on the Unmanaged Exports library as shown below:
Task Parameter:SdkPath=C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\ (TaskId:44)
Cannot find lib.exe in 'K:\Visual Studio 2015\Common7\IDE\\..\..\VC\bin'. (TaskId:44)
Done executing task "DllExportAppDomainIsolatedTask" -- FAILED. (TaskId:44)
Done building target "RGieseckeDllExport" in project "BWSITwilio.csproj" -- FAILED.: (TargetId:73)
And as such the library will not export the functions in the DLL for me to access in Delphi. I can stay in VS2013 for a while but something seems amiss with the library in VS2015 (maybe looking in the NETFX 4.6 folder??)
I am open to ideas so I can use VS2015--I was about to uninstall 2013 but have to hold off now.
Thanks in advance for any input or advice--it is really this library that has allowed us to continue to use Delphi since we can access anything in .NET with it!
The release notes for version 1.2.7 (dated 16 August 2015) on Nuget include this:
no longer fails the build when it can't find lib.exe
I suspect you are using an older version and can solve your problem by moving to the latest.
You are probably using a version that was built before VS 2015 was released and I'm sure Robert's latest version now supports VS 2015.
For what it's worth, even if lib.exe still cannot be found that's not going to bother you since you don't need a .lib file to import into Delphi.
I was facing the same issue and was able to solve this by manually copying over some Visual Studio 2013 files into the 2015 folder. I searched for lib.exe on my computer and used Beyond Compare with the two application's program file directories.
Open C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\ in
Explorer, select all files, Copy.
Open C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\ in Explorer, Paste. When prompted to replace, choose Skip.
After doing this I was able to compile my projects that were using RGiesecke.DllExport in Visual Studio 2015 again.
I can't tell you what specific version of 2013 I had installed because I've since uninstalled, but apparently these files are leftover. I'm running MS VS Community 2015 Version 14.0.23107.0.
Not sure if its relevant at all, but the lib.exe I copied from the 2013 bin folder's version reads 12.0.21005.1.

Opening project for 2013 in 2012 Visual Studio for MVC gives error

I am getting an error when trying to open a MVC project in Visual Studio 2012. My team is running on 2013 that have been working on it, and I am waiting to be upgraded to 2013, but am trying to get some work done until then. When I open the project, it says it is missing some required Web components needed to run in Visual Studio. "ASP.NET Web pages with Razor 3.0.0.0". So I tried to do a NuGet install for AspNetMVC and did not work. I can open the project and what not, but the features such as adding a new View or Controller are not there. Do I have to wait until I am upgraded to 2013, or am I missing something? Thanks in advance.
Had to re-install WebPages package with NuGet manager. I have no idea why it was jacked, but it was and fixed the problem. Thanks #levelnis.
I had the same issue and had to update my NuGet package manager to the newest version in order to download the missing / corrupted package.

Resources