How to fix '"CheckAttributes" task could not be loaded'-error after installing Visual Studio 2013 Update 4 - visual-studio-2013

After installing Update 4, I now find myself unable to build (or even clean) any solution. I keep getting:
Error 1 The "CheckPathAttributes" task could not be loaded from the
assembly C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.Tasks.dll.
Could not load file or assembly 'file:///C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.Tasks.dll'
or one of its dependencies. The system cannot find the file specified.
Confirm that the declaration is correct, that the assembly
and all its dependencies are available, and that the task contains a
public class that implements
Microsoft.Build.Framework.ITask. HandlePageNotFound
Does anyone know how to resolve this please?

Well, here's "my solution".
First the horrific "prompt of death" (plus the same "licensing issue" annoyance) in this post:
What I've attempted (and result) based on info from the interwebs:
Close VS 2013 and rename the folder:
C:\Users\[your user name]\AppData\Local\Microsoft\VisualStudio\12.0\ComponentModelCache
Result: No effect/errors persist (VS will re-create that folder on startup)
Rerun the Visual Studio Update 4 installer and Repair
Result: Successfully "fixed" whatever it was.
This will take about an hour which is slower than when I originally installed the update so that was a clue, or rather, more like "well, I hope that means it found what it did wrong or forgot/missed out on" (and not, "oh crap, now I'm really screwing things up even more")
A quick summary of my environment so that hopefully will guide you to your solution:
I did install Office Developer Tools Nov 2014 prior to the Update so in my case, that wasn't the issue (I did not remove/uninstall)
I have Resharper, and I did not disable it, so this too doesn't seem related (some have pointed this out)
I did update to Web Essentials 2013 for Update 4 after the initial Update (it will prompt you to after installing VS Update 4). I didn't do anything after the Repair (didn't remove/re-install/etc Web Essentials after the Repair).
I have VS 2012 as well, just mentioning this though that was never affected in any way (and was my fallback while this issue was stopping me from using VS2013)
Hth...

Found the solution via this
TransformXml task could not be loaded from Microsoft.Web.Publishing.Tasks.dll
In my case, I had Visual Studio 2012 installed on an E: drive already, so I found a copy of Microsoft.Web.Publishing.Tasks in
E:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web
So I copied that file, and Microsoft.Web.XmlTransform to here:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web
and now all is well :)

Uninstalling "Office Developer Tools for Visual Studio 2013 – November 2014 Update" helped me. Now all works as before.

If you have VS 2012 installed on your machine. Copy Microsoft.Web.Publishing.Tasks.dll and Microsoft.Web.Publishing.targets from C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\web\ into C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web (the path for VS 2013). Restart visual studio.

I have only VS2013 (now with Update 4) and I solve this problem as follows: Close VS, copy "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.Dll" into the "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web" directory and start VS (folder v11.0 no contains Web subfolder). Now I can rebuild website projects without any error again.

My problem cleared thanks to the same TransformXml link and the suggestion to install Windows SDK for Windows 7 and .NET Framework 4

Copying "Microsoft.Web.Publishing.Tasks.dll" and "Microsoft.Web.XmlTransform.dll" from "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web" to "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web" also works

Related

Found .NET SDK, but did not find dotnet.dll

I recently installed Visual Studio 2022 preview.
Today I was in a workshop and there was some feature that didn't work, and it turned out it was because I had the preview version of .NET 6 installed.
So I then uninstalled Visual Studio 2022 preview.
Now, when I type dotnet --version (or other command like dotnet --info) in a command window, I get the following message:
Found .NET SDK, but did not find dotnet.dll at [C:\Program Files\dotnet\sdk\6.0.100-preview.7.21379.14\dotnet.dll]
I have tried to repair, and then reinstall DotNet SDK 5.0.400. Restarted machine a few times as well, to no avail.
I am guessing the uninstaller removed the files, but failed to restore the registry to the previous version.
How do I fix this?
So right after posting my question, I discovered that the uninstaller had left some leftovers on my disk. There was a folder with some files, called 6.0.100-preview.7.21379.14. After I deleted it, the command "dotnet --version" now returns "5.0.400".
As Mak wrote below, the folders mentioned reside inside this folder:
C:\Program Files\dotnet\sdk
I also ran into the same problem recently. I had to go to the below path in Windows and delete all 6.*.* folders.
C:\Program Files\dotnet

The "GetReferenceNearestTargetFrameworkTask" task was not found

I have a problem with autocompletion in VS 2017 Community.
Previously I had VS 2017 Enterprise from school, but the key expired so I moved to Community.
Before, everything works great, but now it doesn't work at all.
I found a solution on Stack Overflow here but it doesn't work, so found another solution at GitHub here.
And I got this:
Build FAILED.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1601,5): error MSB4036:
The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following:
1.) The name of the task in the project file is the same as the name of the task class.
2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface.
3.) The task is correctly declared with in the project file, or in the *.tasks files located in the
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin" directory.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.11
Do you know what to do next?
I had the same error message but for a different problem.
So, I'm using MSBuild to automate build/deploy process for Azure Functions. Everything was working fine until I updated both Visual Studio 2017 and Visual Studio Build Tools 2017 at which point I started getting this error. To be precise I got this error only when using MSBuild, building project manually from VS was working fine.
In my case I already had everything set as per #Programmer's answer.
But as I was using MSBuild it turned out that I also had to install NuGet targets and build tasks which are part of Visual Studio Build Tools.
Follow these to fix that error. This applies to VS 2017:
Fix 1:
1.Install Nuget PackageManager from here.
2.Restart Visual Studio.
If the problem is still there, continue below
Fix 2:
1.Download and start/run the Visual Studio Installer again.
2.While the Visual Studio Installer is still running, go to the "Individual Components" tab
3.Tick the "NuGet package manager" check-box that is under "Code tools" option.
4.Click Install to install it.
Screenshot of where this is located:
That should fix the error you see in this question. Restart Visual Studio and test the auto-completion function. If it's not working, see the answers from this question as that is a whole different issue.
I was seeing this issue with msbuild 15.6.82 on a build environment that does not have VisualStudio 2017, only VS Build Tools.
Here's a PowerShell script that resolves this issue, it pretty much does the equivalent of previous answers in the VS Installer, but silently and waiting for completion.
Start-Process "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" -ArgumentList 'modify --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools" --quiet --add Microsoft.VisualStudio.Component.NuGet.BuildTools --add Microsoft.Net.Component.4.5.TargetingPack --norestart --force' -Wait -PassThru
I'm working with a headless build server on server core, resolved by installing chocolatey package choco install visualstudio2017-workload-webbuildtools from here:
https://chocolatey.org/packages?q=msbuild
I'm reporting an answer from a Microsoft techician
This usually indicates one of two things:
A failed VS installation. If that's the case, I would recommend running a repair on your VS install.
You have msbuild assemblies in the GAC. If that's the case, please ungac them.
Livar Cunha [MSFT]
I got the same problem in Visual Studio 2019, I solved it by simply install unity package

The 'Visual Studio Explorers and Designer Package' package did not load correctly

Every time I open solution in Visual Studio 2015 I get following message:
Here are last entries from ActivityLog.xml:
<entry>
<record>827</record>
<time>2015/12/23 11:26:13.919</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [Visual Studio Explorers and Designers Package][Object reference not set to an instance of an object.]:{ at Microsoft.VSDesigner.VSDMenus.Initialize(IServiceProvider serviceProvider)
at Microsoft.VSDesigner.VSDesignerPackage.VSDesignerPackage.Initialize()
at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)}</description>
<guid>{8D8529D3-625D-4496-8354-3DAD630ECC1B}</guid>
<hr>80004003 - E_POINTER</hr>
<errorinfo>Object reference not set to an instance of an object.</errorinfo></entry>
I followed suggestions found in a similar question but with no success.
Unfortunately re-installing NuGet via Extensions and Updates doesn't solve the issue.
If #batressc solution doesn't work, you have to delete the .VS folder in the solution folder also.
So:
Close all VS Windows
Delete folder C:\Users\<username>\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
Delete Folder [Solution Folder]\.vs
Delete the file Microsoft.VisualStudio.Default.Cachein the folder C:\Users\<username>\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
This one helps with VS 2017:
https://developercommunity.visualstudio.com/content/problem/160124/failed-to-load-package-monoandroiddesignerpackage.html
1) Start VS
2) File->New->Project->Xamarin app (either iOS or Android)
3) Now click the Toolbox
4) Close VS
Deleting this folder did the trick for me.
C:\Users[USERNAME]\AppData\Roaming\Microsoft\VisualStudio\15.0_14b774ca
What did the trick for me was removing "Microsoft .NET Core 1.0.1 VS 2015 Tooling Preview 2"
Run the following command prompt help me solve the problem on VS 2017 Community. I never tried on other VS version though. Let me know if it works in other version:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe" /resetskippkgs
I had this error on .netcore 3.1 only:
The 'windows forms remote designer hosting package' package did not load correctly
Resolved with the help of all of the answers here.
Remove the entire contents of the directories:
The .vs - in the project
c:\Users\User\AppData\Local\Microsoft\VisualStudio\16.0_1cac4d16\

Microsoft ASP.NET and Web Tools 2015 - Visual Studio 2015 : Package failed

Visual Studio 2015 filed to install asp.net and web tools 2015
I tried more than one time also tried to repair Visual Studio i faced the same error.
also i tried to install the same ISO file on another machine and it worked fine
What a ridiculous ordeal. I was finally able to resolve this error by manually installing the webtoolsextensionsvs14.msi using msiexec and specifying a targetdir of c:\temp. For some reason is was trying to create temp install files directly in c:\
msiexec /a webtoolsextensionsvs14.msi /qb /l* log.txt SKIP_SETUP=1 TARGETDIR=
c:\temp
Thank you for reporting this. I will try to help you resolve this and do have a few questions.
Was this a clean installation or did you upgrade from a previous release such as RC?
Have you tried to repair Visual Studio?
Would you be able to share the installation logs? There should be two log files in your %temp% folder. The first file is an overall summary of the VS installation and should be have a name such as vs_professional_yyyymmddhhmmss.LOG. The second log is for the Web Tools package itself and should have a name such as vs_professional_yyyymmddhhmmss_nnn_WebToolsExtensionsVS14_1040.LOG
Thanks,
Jacques

The 'Provider Package' did not load correctly

VS 2013 Professional - Version 12.0.31101.00 Update 4
All of a sudden, whenever I try to open a project (MVC project or Python project), I get:
The 'ProviderPackage' package did not load correctly.
The problem
may have been caused by a configuration change or by the installation
of another extension. You can get more information by examining the
file
'C:\Users\xxxx\AppData\Roaming\Microsoft\VisualStudio\12.0\ActivityLog.xml'.
In my AppData\Roaming, there is no 12.0 folder! In AppData\Local, there is a 12.0 folder but there is no ActivityLog.xml file.
When I ignore the message and press F5 to run, after lots of disk movement, Visual Studio simply closes and disappears.
I have repaired a few times and the exact same behavior persists.
When I try to run devenv.exe /setup or devenv.exe /resetuserdata, absolutely nothing happens. No error, no process is launched, nothing. Running devenv.exe without any parameters does launch VS.
What can be wrong? I hesitate to uninstall and reinstall if there is some other solution.
1 day later: Uninstalled VS 2013 and reinstalled, and then applied Update 4.
Problem is still the same for the MVC project: ProviderPackage did not load correctly, and when running project VS closes and disappears.
Last record in ActivityLog.xml says:
<entry>
<record>1120</record>
<time>2015/03/17 06:38:43.882</time>
<type>Error</type>
<source>VisualStudio</source>
<description>An exception was thrown during package instantiation and was caught in the package manager [ProviderPackage]</description>
<guid>{5F2E5E42-4192-4D79-A0D8-1D881E808829}</guid>
<hr>8000ffff - E_UNEXPECTED</hr>
<errorinfo></errorinfo>
</entry>
Deleting ComponentModelCache from
C:\Users\YourUserName\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
works fine for VS 2015.
Note: You will need to close the VS before deleting this folder. Also replace 14.0 with 12.0 in folder path for VS 2013
Delete folder ComponenModelCache
C:\Users\XXXX\AppData\Local\Microsoft\VisualStudio\XX\ComponentModelCache
that worked for me
Open Command Prompt and use the following commands (if necessary, change the directory according to the installation folder):
cd c:\
C:\>"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe" /resetskippkgs"
Make sure the paths are correct at:
Computer\HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0
Mine for example the VisualStudioLocation key changed from "C:\Documents\Visual Studio 2015" to just "Visual Studio 2015" which was problematic.
I can't leave a comment on Murat Yıldız's answer so this is the next best thing. His solutions works great. I opened the Visual Studio Command Prompt as an administrator and ran from the command prompt:
C:\WINDOWS\system32>devenv /resetskippkgs
It worked like a charm.
I also faced the same problem and solution for me was to run Visual Studio as an administrator.

Resources