Build Task Failed Unexpectedly - asp.net

I have error in my project
that is
The "ResolveComReference" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Build.Tasks.v12.0' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Build.Tasks.v12.0'
Can anyone help me regards this. I got stucked
I am using VS2012 and microsoft office 2007

This problem usually occurs as a result of a multi-program corruption involving Microsoft Visual Studio 2012, other Visual Studio versions, and Microsoft Web Tools for Visual Studio 2012.
Reinstalling Visual Studio is known to fix it, but however many victims of this issue have said that this doesn't fix the issue.
Instead copying the files from
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web
over to
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web
seems to fix the problem in the majority of similar cases.
Other possible fixes:
Uninstall Web Tools 2013 and reinstall the Web Tools and Web Tools Extensions from here

Related

Creating ASP Web App fails in Visual Studio 2013

I'm trying to make new ASP.NET Web Application project in Visual Studio 2013 but it immediately fails with this error:
Could not load type 'Microsoft.VisualStudio.Web.WindowsAzure.Contracts.AzureResourceCreationType' from assembly 'Microsoft.VisualStudio.Web.Internal.Contracts, Version=2.3.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a'.
I used to be able to create web apps. Visual studio updated to update v4 a while back. Also I made sure all extensions are updated.
Any help would be greatly appreciated, thank you.
After a lot more searching I found the answer from this post:
Visual Studio 2013 Premium solution load errors after Update 3
I had to run the following commands and everything works again afterwards.
gacutil -i "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Microsoft.VisualStudio.Web.Publish.dll"
gacutil -i "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Microsoft.VisualStudio.Web.Internal.Contracts.dll"
I had the same issue after removing VS2015RC and installing full VS2015.
Side note: The above fix (changing path to point at "Microsoft Visual Studio 14") fixed the above error in VS2015.
Looking through the control panel and program updates, VS2013 update 4 was installed around the same time as VS2015 so I ran a repair on update 4 and it had no affect.
Repaired KB2932965 a VS2013 update, still no luck

Is there any solution to Visual Studio 2013 not correctly generating .designer files for ASPX pages?

We have been encountering more and more frequently the Visual Studio error of being unable to generate the designer file in a web project. This problem has been occurring for a few months now, in several of our ASP.NET projects.
The errors occur when saving a file or when building the project, and are variations of errors like this:
Generation of the designer file for [filename] failed: Error HRESULT
E_FAIL has been returned from a call to a COM component.
Generation of the designer file for [filename] failed: Unspecified
error (Exception from HRESULT: 0x80004005 (E_FAIL))
Generation of the designer file for [filename] failed: An entry with
the same key already exists.
Generation of the designer file for [filename] failed: Value cannot
be null.
Sometimes, additional error messages are displayed for valid, previously-working code/markup; errors such as:
The name 'Eval' does not exist in the current context
This is with Visual Studio 2013 (Premium), with "Web Application Projects" type projects using the .NET 4.5 framework. Some of the projects were originally created in Visual Studio 2010 or Visual Studio 2012, but one of the projects was a new project created in Visual Studio 2013.
We have a few Visual Studio extensions installed, such as "Web Essentials 2013", but I have tried disabling all the installed Visual Studio extensions and the same designer file errors still occur. We do not have Resharper or CodeRush installed. We are also using a third-party components package (DevExpress) for ASP.NET. We are using IIS Express for the local development web server.
All available updates (including Update 1 for Visual Studio 2013) have been installed for Visual Studio, the operating system (Windows 8.1), .NET, Visual Studio extensions, and DevExpress.
I have searched StackOverflow and the web for this issue, and have found some suggestions but no solutions, and I have also seen that the issue has been reported to Microsoft several times, dating back some years.
Many indications are that the problem with generating designer files is caused by some invalid syntax (in an ASPX file), or multiple elements with the same ID in the same scope, or collisions in namespace or class names, etc. I have searched through our projects as best as I can for issues like this, but haven't found any.
I found the Redesigner project on Sourceforge (thanks very much to the author), and I tried using that to verify the designer files, but unfortunately it can't handle the DevExpress components (it reports that DevExpress elements are using invalid child tags when the tags are valid and correct for DevExpress).
I have also tried clearing the Visual Studio development cache on my workstation (that is, deleting everything from the folders "\Temp\IISExpress", "\Temp\Temporary ASP.NET Files", and "\Microsoft\WebsiteCache" folders in the %localappdata% folder, rebooting and restarting Visual Studio.
I also found a website that explained how to turn on additional logging for Visual Studio to help with tracking down designer file generation issues. For Visual Studio 2013, this requires adding a key HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\WebApplicationProjects\Debug and then adding values under that key for "Enabled" (set to 1), "LogFieldGeneratorFailures" (set to 1), and "LogFile" (set to a path and filename that you have permission to write to).
When I added this key, Visual Studio 2013 did write to the debug log file, but it only included error messages similar to the error messages above plus a small stack trace plus the entire content of the ASPX file for which the designer file could not be generated (with no apparent indication of where in the ASPX page there might be an error or invalid syntax).
I think I have tried essentially all suggested approaches in this topic:
How do you force Visual Studio to regenerate the .designer files for aspx/ascx files?
None of these have worked for me. The "Convert to Web Application" option for the ASPX file is not available for me in Visual Studio 2013 in these projects.
Does anyone have any suggestions for potential causes or fixes for this desinger file issue or for any other troubleshooting approaches?
The latest that we have discovered with this issue is that it's related to the Source Control option in Visual Studio to "Get everything when a solution or project is opened".
Having this option UNCHECKED seems to have resolved the problems for our team so far (for the past few days).
There is also this issue posted at Microsoft Connect: http://connect.microsoft.com/VisualStudio/feedback/details/760443/visual-studio-2012-ide-loses-intellisense-and-reference-resolution
The comments at the link above suggest that the bug is caused by asynchronous retrieval of files from source control or the asynchronous solution load when Visual Studio is opened. The choices suggested for fixing the problem are to either turn off the asynchronous solution load or to disable the "get everything on open" option.
There are also suggestions that deleting the .suo (Solution User Options) file in the project directory resolves the problem, but this seems to be only temporary.
The only solution that I've found to work is to delete the Visual Studio cache # C:\Users\<>\AppData\Local\Microsoft\VisualStudio and then running Visual Studio with the /resetuserdata switch. It's a horrible solution that deletes all of your local settings, and resets Visual Studio.
(You can try exporting and importing your settings before and after the surgery.)
Links
(Delete the 2013 cache)
http://blogs.msdn.com/b/willy-peter_schaub/archive/2010/09/15/if-you-have-problems-with-tfs-or-visual-studio-flush-the-user-cache-or-not.aspx
(Fixing the error in 2010, which is slightly different)http://rathodkrunal.blogspot.com/2011/11/visual-studio-2010-error-hresult-efail.html
It's also an open item on connect, if you want to bug MS into fixing it.
https://connect.microsoft.com/VisualStudio/feedback/details/799832/constant-call-to-com-component-fails#tabs
Ran into a very similar issue assisting a colleague. The project had been converted from 2010 to 2013 and was working for most developers. To "resolve" this, we had him close the solution, then delete all of the source control files at the solution level, (vsssc). Once reopening the solution, all was fine.
I've had this issue constantly in different dev environments for the last while. I managed to solve it in one case without using the cache clearing technique by launching component services->DCOM Config. When I did this I was prompted to register a missing key. (didn't quite catch it but something related to EventManagement). Clicked OK and lauched visual studio...hey presto...back in business. Hopefully this advice might catch a few cases out there.

Build error : Incompatible versions of SQL Server Data Tools and database runtime components are installed on this computer

I have a Visual Studio 2012 project that reports an error from msbuild when trying to publish the database from the command line:
Microsoft.Data.Tools.Schema.SqlTasks.targets(390,5): Build error :
Incompatible versions of SQL Server Data Tools and database runtime
components are installed on this computer.
I have checked and installed all updates for VS2012 SSDT and everything is up to date.
The trick was to install SSDT updates for Visual Studio 2010 - despite the fact that my solution was running in VIsual Studio 2012. The solution was upgraded from 2010 so perhaps that is why there is the dependency.
Another clue was in the path to the build target - v10 not v11
C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v10.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(390,5): [error message followed]
I had the same issue but without the version v10/v11 being the issue.
To fix this problem, I closed Visual Studio 2012 then went into Programs and Features and did a repair of the following installer:
Microsoft SQL Server Data Tools - enu (11.1.41025.0)
Microsoft SQL Server Data Tools - Database Projects - Web installer entry point
Restart Visual Studio and compile again. Worked for me.
Downloading and running the latest installer for Visual Studio 2012 fixed this issue for me.

Opening a .css file crashes Visual Studio?

When I open any .css file in any project in Visual Studio 2012, it immediately crashes.
I've tried restarting my computer, reinstalling Visual Studio, installing a Visual Studio update and uninstalling all of my Visual Studio extensions.
The problem started this morning - last night I had a power outage and my computer, which was running Visual Studio at the time, crashed.
I wish I could supply more details but this is all I have. The problem isn't specific to a project or a file, but (AFAIK) only to .css files.
Edit: Running Visual Studio in Safe Mode fixes the problem in some projects but not in all - specifically, in a standalone, standard website project I can edit .css files fine, but in my TFS-hosted team project I can't, which is making it impossible for me to work.. When exiting safe mode, .css files in general crash Visual Studio.
To clarify: The problem isn't that Visual Studio gives me some sort of error message when I try to load a .css file, Visual Studio just crashes. I've tried reinstalling, restarting, and repairing, nothing works. There have been similiar complaints that I've found but they all have something to do with some extension messing Visual Studio up.. The only extensions I had were Web Essentials and Resharper, both now uninstalled, and they worked fine until this morning.
i think it's better to try Visual Studio reset. Do you tired using any other software like Dreamweaver?

Visual Studio 2010 crashes opening .cshtml files

I am unable to open any CSHTML files in any ASP.NET MVC solution as VS2010 consistently crashes.
I am running Visual Studio 2010 Premium on Windows 7 Ultimate x64 SP1. Repairing the installation doesn't fix the issue. Anyone know how to resolve this?
Running the following command from the command line helped me resolve my issue with VS crashing on opening .cshtml files:
devenv.exe /ResetSkipPkgs
The /ResetSkipPkgs switch is documented here and has helped several other people resolve all kinds of problems with VS.

Resources