Exactly as asked in Moved project, now references are broken -- having moved a project to another folder, now all of my references are broken, however, the answer there is incorrect, as we can see that it is not only the NuGet Packages are broken, but all of them, even including System, Microsoft.CSharp, etc:
How to properly fix it?
This is
Microsoft Visual Studio Enterprise 2017
Version 15.3.5
VisualStudio.15.Release/15.3.5+26730.16
Microsoft .NET Framework
Version 4.6.01038
UPDATE:
Find a case that is even don't need moving anything -- I tried to include a project from another solution, whose references are perfectly fine within that solution, but all are broken when included in my new solution, despite the fact that all the references, accessible (specified in the .csproj file) via relative paths or no path at all:
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Management" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WebDriver, Version=3.4.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\..\packages\Selenium.WebDriver.3.4.0\lib\net40\WebDriver.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="WebDriver.Support, Version=3.4.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\..\packages\Selenium.Support.3.4.0\lib\net40\WebDriver.Support.dll</HintPath>
<Private>True</Private>
</Reference>
Starting from today, a WPF project that belongs to a solution with 20 projects, set all my references to missing
I've just checked the MS suggestion and the other answers on Stackoverflow but none worked...I've tried to re-get solution from SVN, with no luck, other colleagues haven't got this problem.
I've also tried to remove and re-add the references (System.Xml for example) .
But no way to make it work...
Any suggestion?
Thanks
UPDATE #1
Here's the csproj
<ItemGroup>
<Reference Include="Catel.Core, Version=4.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Catel.Core.4.2.0\lib\net40\Catel.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Catel.Extensions.Controls, Version=4.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Catel.Extensions.Controls.4.2.0\lib\net40\Catel.Extensions.Controls.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Catel.Extensions.FluentValidation, Version=4.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Catel.Extensions.FluentValidation.4.2.0\lib\net40\Catel.Extensions.FluentValidation.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Catel.Fody.Attributes, Version=2.8.0.0, Culture=neutral, PublicKeyToken=1c8163524cbe02e6, processorArchitecture=MSIL">
<HintPath>..\packages\Catel.Fody.2.8.0\lib\portable-net4+sl4+wp7+win8+wpa81+MonoAndroid14+MonoTouch40\Catel.Fody.Attributes.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Catel.MVVM, Version=4.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Catel.MVVM.4.2.0\lib\net40\Catel.MVVM.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MethodTimer, Version=1.15.7.0, Culture=neutral, PublicKeyToken=cb1364609f40a1dc, processorArchitecture=MSIL">
<HintPath>..\packages\MethodTimer.Fody.1.15.7.0\Lib\portable-net4+sl5+wp8+win8+wpa81+MonoAndroid16+MonoTouch40\MethodTimer.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop, Version=1.0.168.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="ServiceStack">
<HintPath>..\packages\ServiceStack.4.0.46\lib\net40\ServiceStack.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ServiceStack.Client, Version=4.0.46.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ServiceStack.Client.4.0.46\lib\net40\ServiceStack.Client.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ServiceStack.Common">
<HintPath>..\packages\ServiceStack.Common.4.0.46\lib\net40\ServiceStack.Common.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ServiceStack.Interfaces, Version=4.0.0.0, Culture=neutral, PublicKeyToken=e06fbc6124f57c43, processorArchitecture=MSIL">
<HintPath>..\packages\ServiceStack.Interfaces.4.0.46\lib\portable-wp80+sl5+net40+win8+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ServiceStack.Text, Version=4.0.46.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ServiceStack.Text.4.0.46\lib\net40\ServiceStack.Text.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.IO, Version=2.6.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.IO.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Management" />
<Reference Include="System.Net" />
<Reference Include="System.Runtime, Version=2.6.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.Runtime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Threading.Tasks, Version=2.6.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.Threading.Tasks.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Catel.MVVM.4.2.0\lib\net40\System.Windows.Interactivity.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="Telerik.Windows.Controls, Version=2015.2.728.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
<HintPath>..\packages\Telerik.Windows.Controls.for.Wpf.40.Xaml.2015.2.728\lib\net40\Telerik.Windows.Controls.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Telerik.Windows.Controls.GridView, Version=2015.2.728.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
<HintPath>..\packages\Telerik.Windows.Controls.GridView.for.Wpf.40.Xaml.2015.2.728\lib\net40\Telerik.Windows.Controls.GridView.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Telerik.Windows.Controls.Input, Version=2015.2.728.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
<HintPath>..\packages\Telerik.Windows.Controls.Input.for.Wpf.40.Xaml.2015.2.728\lib\net40\Telerik.Windows.Controls.Input.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Telerik.Windows.Controls.Navigation, Version=2015.2.728.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
<HintPath>..\packages\Telerik.Windows.Controls.Navigation.for.Wpf.40.Xaml.2015.2.728\lib\net40\Telerik.Windows.Controls.Navigation.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Telerik.Windows.Data, Version=2015.2.728.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
<HintPath>..\packages\Telerik.Windows.Data.for.Wpf.40.Xaml.2015.2.728\lib\net40\Telerik.Windows.Data.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="UIAutomationProvider" />
<Reference Include="UIAutomationTypes" />
<Reference Include="WindowsBase" />
Yes I use Nuget, the other 19 points to the same assemblies ...nothing has been moved
UPDATE #2
Since I was not able to proceed I've copied the project from a colleague and now it works.... think something went wrong in the filesystem...have compared the solution and they were identical
The resolution to this issue is.
Whenever you import a project to VS 2015 it modifies your .csproj. So, in order to fix it. Right click on .csproj and open it in notepad or any editor and delete the following
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>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 {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
Then build your solution and it should work.
In the root directory of the solution, delete everything inside of /packages/ folder, then do a re-build.
It can help to force rebuild the nuget packages. Go to the nuget console and use the following commands: (TOOLS > Options > Package Manager > Package Manager Conbsole)
Update-Package -reinstall -ProjectName "MyProject" -safe
The safe parameter will actually not update the packages, but only reinstall them. If that didn't help, you can try to actually update them (but make sure you have a copy of the project somewhere, just in case.)
Update-Package -reinstall -ProjectName "MyProject"
To force update just one package, use:
Update-Package -id Microsoft.Package.Name -ProjectName "MyProject"
I had this once, caused by a broken .targets import. Check if you accidentally enabled nuget package restore (which includes a .targets file) and then deleted the .nuget directory.
I had similar issue. The solution, which worked for me was to pop the nuget package manager for the solution and refresh the packages.
Another case involved missing packages and nuget package manager for the solution showed updates and dependencies, which needed to be installed and this was the fix.
Another case was exactly as pointed above - delete packages folder fixed it.
Editing manually the project is an option, but there is a chance if you poke where you are not supposed to, your project may not open. If you can, avoid doing that is my opinion.
I've just experienced exactly this in VS2015 on a solution with around 20 projects. Only one project was affected and it lost all references including to the standard .NET assemblies.
The only way I could resolve was to switch to a different GIT branch and then back, this cleaned up the issue and it is all now working.
I also experienced exactly this in VS2015 on a solution with around 10 projects. Only one project - the main MVC project - was affected and it lost all references including to the standard .NET assemblies.
The problem was in my web.config. I had commented some lines, resulting in an invalid xml-file.
This error may occur if you miss .targets file in nuget packages folder. In my case it was
packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets
Usually it happens when I'm adding packages to git repository (common .gitignore file is ignoring build folder everywhere) and checkout on another computer.
Tip: you can modify .gitignore file to include all files in packages folder. Append these lines to the bottom:
# Include all files in NuGet packages directory
!/packages/**/
For me I had mistakenly removed the following line from .csproj file:
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
So I closed Visual Studio. Opened myprojectname.csproj file and added the line.
then I reopened the solution and by that I was able to resolve my issue.
Unload project, then edit project
look for the following and delete.
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 {0}.
Does anyone know how I can remove links from the top menu using local.xml.
In the default checkout.xml there is:
<reference name="top.links">
<block type="checkout/links" name="checkout_cart_link">
<action method="addCartLink"></action>
<action method="addCheckoutLink"></action>
</block>
</reference>
And I would like to remove the addCartLink from the top menu. One way would be just edit the checkout.xml file, but it think it would be a much better solution just to add the remove to my local.xml file, but I can't seem to get the right name to remove. If I do a
<layout>
<default>
<remove name="top.links" />
</default>
</layout>
That does remove the entire menu, but how do I remove just a single item from the menu using locale.xml?
I am using Magento 1.6
You can do this in local.xml:
<default>
<reference name="top.links">
<action method="removeLinkByUrl">
<url helper="checkout/url/getCartUrl" />
</action>
</reference>
</default>
It was also my question How can i get the full path in local.xml file
<default>
<reference name="top.links">
<block type="wishlist/links" name="wishlist_link"/>
<action method="removeLinkBlock"><blockName>wishlist_link</blockName></action>
</reference>
</default>
Add this part to your local.xml. Writing this under default will remove it from every page. So adjust it accordingly. I hope this will help you.
It should be:
<layout>
<default>
<reference name="top.links">
<reference name="checkout_cart_link">
<remove name="top-link-cart" />
</reference>
</reference>
</default>
</layout>
But you can always copy the checkout.xml in your local theme and edit it.
<default>
<reference name="top.links">
<remove name="wishlist_link"/>
</reference>
</default>
Add this part to your local.xml. That works for me. Just use "remove". That's it.
You can remove a link via layout update either
by its name | calling removeLinkBlock($blockName)
by its url | calling removeLinkByUrl($url)
overwriting the file were it was added
The functions live in Mage_Page_Block_Template_Links
Option 1
The removeLinkByUrl() function needs an url as parameter which will usually provided by a helper function in the respective extension. Just grab it there and you can use something like
<reference name="top.links">
<action method="removeLinkByUrl"><url helper="customer/getRegisterUrl"/></action>
</reference>
In above case customer is the extensions name while getRegisterUrl is the function in the helper class.
If your extension isn't providing any function which is returning a link you can try following
<reference name="top.links">
<action method="removeLinkByUrl"><url>ADD_THE_DYNAMIC_LINK_HERE</url></action>
</reference>
Option 2
If the link was added with a name, like
<reference name="top.links">
<block type="wishlist/links" name="wishlist_link" />
<action method="addLinkBlock"><blockName>wishlist_link</blockName></action>
</reference>
you can just use
<reference name="top.links">
<remove name="wishlist_link"/>
</reference>
or
<default>
<reference name="top.links">
<block type="wishlist/links" name="wishlist_link"/>
<action method="removeLinkBlock"><blockName>wishlist_link</blockName></action>
</reference>
</default>
Option 3
If your link wasn't added with a name and a hardcoded url doesn't work for some reason you can just go ahead and copy the modules layout.xml to your custom theme folder and remove the lines where the link was added.
Hi This removes both the cart and checkout links from top.links in 1.9.3
<reference name="top.links">
<action method="removeLinkByUrl">
<url helper="checkout/url/getCartUrl" />
</action>
<action method="removeLinkByUrl">
<url helper="checkout/url/getCheckoutUrl" />
</action>
</reference>
based on the best accepted answer above but just in case anyone wants to remove both
I've read the blog posts on deploying MVC3 projects to shared hosting environments that do not have MVC3 installed:
http://www.iwantmymvc.com/2011-03-23-bin-deploy-aspnet-mvc-3-visual-studio
I'm opening an MVC3 project in VS2010 on a machine that does not have MVC3 installed. I have added the references to my *.csproj file:
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\lib\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Web.Helpers">
<HintPath>..\..\lib\System.Web.Helpers.dll</HintPath>
</Reference>
<Reference Include="System.Web.Razor">
<HintPath>..\..\lib\System.Web.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages">
<HintPath>..\..\lib\System.Web.WebPages.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Deployment">
<HintPath>..\..\lib\System.Web.WebPages.Deployment.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Razor">
<HintPath>..\..\lib\System.Web.WebPages.Razor.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Infrastructure">
<HintPath>..\..\lib\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
I'm still getting the following error:
The project type is not supported by this installation.
I'll open up the project on a machine with MVC3 installed and browse to the references, which correctly points to the local lib file. What am I missing?
Please take a look at this blog post http://weblogs.asp.net/leftslipper/archive/2009/01/20/opening-an-asp-net-mvc-project-without-having-asp-net-mvc-installed-the-project-type-is-not-supported-by-this-installation.aspx
I'm trying to build a Visual Studio add-in.
For long-winded reasons (to do with using disassembled assemblies courtesy of .NET Reflector) I removed the reference to the EnvDTE assembly, then re-added it. My project still builds without any problems but when I run my project I get the following exception.
System.IO.PathTooLongException occurred
Message=The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
Source=mscorlib
StackTrace:
at System.IO.PathHelper.GetFullPathName()
InnerException:
None of my references have particularly long paths - they're all the GAC and roughly the same length. I'm not trying to do anything different from before I had trouble with the EnvDTE assembly.
Does anyone have any ideas what might be causing this and how it can be resolved?
UPDATE:
My csproj file shows the following reference paths:
<ItemGroup>
<Reference Include="BoneSoft.CSS">
<HintPath>bin\BoneSoft.CSS.dll</HintPath>
</Reference>
<Reference Include="EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Extensibility, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="HtmlAgilityPack">
<HintPath>bin\HtmlAgilityPack.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.Shell, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="microsoft.visualstudio.shell.interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
Try opening up your .csproj in notepad and look at the Reference entries for all of your assemblies. What's almost certainly happened is they got added with a weird relative path that caused it to extend past the 260 character limit in the HintPath node.
To fix just delete the HintPath element, reload your project and the issue should go away. It isn't necessary for EnvDTE.
I had this problem too after updating references to Telerik assemblies in my Silverlight 5 project. After deleting the HintPath nodes as JaredPar suggested, my issue was resolved. I'm providing a screen shot here to show the broken version (on left) and the fixed version (on right). Thanks JaredPar... sorry I can't vote your answer up yet.