顯示具有 Visual Studio 標籤的文章。 顯示所有文章
顯示具有 Visual Studio 標籤的文章。 顯示所有文章

Visual Studio 2012 open MCV4 project has error message - 'Optimization' does not exist in the namespace 'System.Web'

 

Error message:

The type or namespace name 'Optimization' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)   

                                                                               

Solution:

Install Microsoft ASP.NET Web Optimization Framework 1.0.0 ( http://nuget.org/packages/Microsoft.AspNet.Web.Optimization/1.0.0)

From the Tools menu, select Library Package Manager and then click Package Manager Console.>

Install-Package Microsoft.AspNet.Web.Optimization -Version 1.0.0

The "GenerateResource" task failed unexpectedly.

Error description:

The "GenerateResource" task failed unexpectedly.
System.TypeInitializationException: The type initializer for 'Microsoft.Build.Utilities.FileTracker' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Build.Utilities.FileTracker..cctor()
   --- End of inner exception stack trace ---
   at Microsoft.Build.Utilities.FileTracker.ForceOutOfProcTracking(ExecutableType toolType, String dllName, String cancelEventName)
   at Microsoft.Build.Tasks.GenerateResource.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)    umbraco.presentation

 

Solution:

Refers to Microsoft.NET Framework v4.0.30319
Go to directory C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(Preferably -Open the file with Notepad)
Search for <PropertyGroup> , and then set <TrackFileAccess> to false

Reference: http://connect.microsoft.com/VisualStudio/feedback/details/501894/the-generateresource-task-failed-unexpectedly-system-dllnotfoundexception-unable-to-load-dll-filetracker-dll-the-specified-module-could-not-be-found-exception-from-hresult-0x8007007e