Whenever I compile any project on visual studio it fails with the following errors:
2>CSC : error CS1583:
'$path\obj\Debug\CSC1DCAF528D2BE4F9F8084DAE56ECCD9AD.TMP' is not a
valid Win32 resource file
There are a number of projects in my solution and the project for which I get this error changes randomly.
I have to compile and interrupt several times before I am able to complete the compilation. When I interrupt the build process I get the following error:
Microsoft Visual Studio Debugging Monitor (MSVSMON.EXE) failed to
start. If this problem persists, please repair your Visual Studio
installation via 'Add or Remove Programs' in Control Panel.
--------------------------- OK
--------------------------- 4
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(316,9):
error MSB4018: The "Csc" task failed unexpectedly.
4>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(316,9):
error MSB4018: System.InvalidOperationException: No process is associated with this object.
4>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 Microsoft.CSharp.targets(316,9):
error MSB4018: at System.Diagnostics.Process.EnsureState(State state)
4>C:\WINDOWS\Microsoft.NET\Framework\v4.0.303\Microsoft.CSharp.targets(316,9):
error MSB4018: at System.Diagnostics.Process.get_HasExited()
4>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(316,9):
error MSB4018: at Microsoft.Build.Utilities.ToolTask.TerminateToolProcess(Process proc, Boolean isBeingCancelled)
4>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(316,9):
error MSB4018: at
Microsoft.Build.Utilities.ToolTask.HandleToolNotifications(Process
proc)
4>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(316,9):
error MSB4018: at
Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool,
String responseFileCommands, String commandLineCommands)
4>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(316,9):
error MSB4018: at Microsoft.Build.Utilities.ToolTask.Execute()
4>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(316,9):
error MSB4018: at
Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
4>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(316,9):
error MSB4018: at
Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()
I am getting the same error with other versions of visual studio. So it looks like an issue with csc.exe.
I have tried all the fixes that I could find on google, including re-installation, repair and uninstallation of .net frameworkds, visual studio. The only option that is left with me is to format my computer and build my dev environment from scratch.
Any help in resolving this will would be greatly appreciated.
Related
I tried to a create new project through Google maps activity but my android studio keeps through an exception whenever I try build the gradle. Please any solution colleagues. PC... haven't written any code yet.
Here is the gradle message ....
Error:error: resource android:attr/fontVariationSettings not found.
Error:error: resource android:attr/ttcIndex not found.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Recently I copied my project (ASP.NET Core on Visual Studio 2015) to a new computer. Everything is set up except that I can't seem to publish to the existing App Service without getting an "InvokePowerShell" error.
I have tried creating a new publish profile, resetting the publish profile for the App Service on Azure, running Visual Studio as administrator but no good. Anyone kindly have an idea how to solve this?
Published 1/1 projects successfully
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Publishing.targets(408,5): Error MSB4018: The "InvokePowerShell" task failed unexpectedly.
System.Management.Automation.PSSecurityException: AuthorizationManager check failed. ---> System.Management.Automation.Host.HostException: A command that prompts the user failed because the host program or the command type does not support user interaction. The host was attempting to request confirmation with the following message: Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning message. Do you want to run C:\Users\rober\OneDrive\Documents\Visual Studio 2015\Projects\willfon\src\willfon\Properties\PublishProfiles\willfon20180423121452 - Web Deploy-publish.ps1?
at System.Management.Automation.Internal.Host.InternalHostUserInterface.ThrowPromptNotInteractive(String promptMessage)
at System.Management.Automation.Internal.Host.InternalHostUserInterface.PromptForChoice(String caption, String message, Collection`1 choices, Int32 defaultChoice)
at Microsoft.PowerShell.PSAuthorizationManager.RemoteFilePrompt(String path, PSHost host)
at Microsoft.PowerShell.PSAuthorizationManager.CheckPolicy(ExternalScriptInfo script, PSHost host, Exception& reason)
at Microsoft.PowerShell.PSAuthorizationManager.ShouldRun(CommandInfo commandInfo, CommandOrigin origin, PSHost host, Exception& reason)
at System.Management.Automation.AuthorizationManager.ShouldRunInternal(CommandInfo commandInfo, CommandOrigin origin, PSHost host)
--- End of inner exception stack trace ---
at System.Management.Automation.Runspaces.AsyncResult.EndInvoke()
at System.Management.Automation.PowerShell.EndInvoke(IAsyncResult asyncResult)
at Microsoft.Web.Publishing.Tasks.InvokePowerShell.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
1>Publish failed due to build errors. Check the error list for more details.
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
2-27-2020 And now today it's working. Who knows why.
In an iOS project in Visual Studio 2015, networked to a Mac, I get this error on build...
C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(411,3): error : The given path's format is not supported.
The same solution copied to the Mac builds and runs OK in Visual Studio for Mac preview.
Xamarin.iOS.Common.targets, at line 411 position 3 is this:
<SmartCopy
SessionId="$(BuildSessionId)"
Condition="'$(IsMacEnabled)' == 'true'"
SourceFiles = "#(_BundleResourceWithOutputPath)"
DestinationFiles = "#(_BundleResourceWithOutputPath -> '%(OutputPath)')"
/>
Question: Ids there any way tosee what these tokens resolve to at build-time?
Note: Here is the build output that fails...
. . .
1> Copying file from '/Users/user123483/Library/Caches/Xamarin/mtbs/builds/TrySpeechPlus/d33d40e519762246de1faff7c177fd44/obj/iPhoneSimulator/Debug/optimized/Images/whtball2.PNG' to '/Users/user123483/Library/Caches/Xamarin/mtbs/builds/TrySpeechPlus/d33d40e519762246de1faff7c177fd44/bin/iPhoneSimulator/Debug/TrySpeechPlus.app/Images/whtball2.PNG'
1> SmartCopy: 2017-02-11T10:05:56.0785600-05:00 - Deserializing outputs
1> SmartCopy: 2017-02-11T10:05:56.0805590-05:00 - Creating output items
1>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(411,3): error : The given path's format is not supported.
1> SmartCopy: 2017-02-11T10:05:56.1110734-05:00 - Finished
1>Done executing task "SmartCopy" -- FAILED.
1>Done building target "_CopyResourcesToBundle" in project "TrySpeechPlus.csproj" -- FAILED.
1>
1>Build FAILED.
Can anyone suggest what the problem might be?
The error is caused by the space in the filename (Program Files (x86)).
A fix is to replace the space with the correct escape string
Replace(" ","%20")
After upgrading a solution with 25 projects from VS2012 Update 4 to VS2015 RTM (14.0.23107.0), I get the following error while building one of the projects:
(...) MSB4018: 'The "Link" task failed unexpectedly. (...) System.NullReferenceException: Object reference not set to an instance of an object.' (...)
Here the full output:
1>------ Build started: Project: Buttons, Configuration: Release Win32 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(643,5): error MSB4018: The "Link" task failed unexpectedly.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(643,5): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(643,5): error MSB4018: at Microsoft.Build.CPPTasks.Link.ForcedRebuildRequired()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(643,5): error MSB4018: at Microsoft.Build.CPPTasks.TrackedVCToolTask.ComputeOutOfDateSources()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(643,5): error MSB4018: at Microsoft.Build.CPPTasks.TrackedVCToolTask.SkipTaskExecution()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(643,5): error MSB4018: at Microsoft.Build.Utilities.ToolTask.Execute()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(643,5): error MSB4018: at Microsoft.Build.CPPTasks.TrackedVCToolTask.Execute()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(643,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(643,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__1.MoveNext()
========== Build: 0 succeeded, 1 failed, 24 up-to-date, 0 skipped ==========
I've tried already several suggested solutions related to MSB4018 without any success. The error 'The "Link" task failed unexpectedly' wasn't even indexed by Google yet. I guess this issue is somehow related to the type of the project because it's the only project in the solution that's used as a resource DLL (i.e. with no entry point, etc.). The only changes that have been made to the project file by VS2015 are "ToolsVersion: 4.0 => 14.0" and "PlatformToolset: v110_xp => v140_xp".
Does anyone has a solution for this?
I've managed to fix this issue myself and would like to document the solution here for future reference.
The following error was caused by an empty XML element in the project file:
MSB4018: System.NullReferenceException: Object reference not set to an instance of an object.
The empty element was accessed by the 'Link' task, which just failed:
MSB4018: 'The "Link" task failed unexpectedly.
Removing the respective element fixed the issue:
<Link><GenerateDebugInformation></GenerateDebugInformation></Link>
Hint: As it can be seen in other posts, many of the MSB4018 errors seem to be related to project files containing unexpected values.
Another solution is to delete all generated files from the last build through an explorer window.
Delete all files in:
.\Project\bin
.\Project\obj
While you can "Clean" or "Rebuild" directly through Visual Studio, this only captures some of the files. By forcing to recompile all files, all memory locations will now correctly align and the issue should be resolved.
VS 2015: Solution of the problem is as follows:
Goto:
Project Properties->Linker->Debugging->Generate Debug Info,
Set this property either as Optimize for debugging (/DEBUG) or No
Note: I observed similar issue when it was blank(not set).
It worked for me.
Hope this information would be helpful.
Good Luck:).
If the error statement is something like 'System.InvalidCastException: Unable to cast object of type 'System.Xml.XmlComment' to type 'System.Xml.XmlElement'' then you can try the following:
Unload the .csproj file and check for Project ToolsVersion. Make sure that projects ToolsVersion is lesser than 14 (for example 12).
Using the Azure SDK installer 2.4 failed to install the azure storage emulator with the following error on the log:
CAQuietExec: Windows Azure Storage Emulator 3.3.0.0 command line tool
CAQuietExec:
CAQuietExec: Unhandled Exception: System.TypeInitializationException: The type initializer for 'Microsoft.WindowsAzure.Storage.Emulator.Controller.Configuration.StorageEmulatorConfigCache' threw an exception. ---> System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: Unrecognized attribute 'enable'. Note that attribute names are case-sensitive. (C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config line 104)
CAQuietExec: at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
CAQuietExec: at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
CAQuietExec: at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
CAQuietExec: --- End of inner exception stack trace ---
CAQuietExec: at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
CAQuietExec: at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
CAQuietExec: at Microsoft.WindowsAzure.Storage.Emulator.Controller.Configuration.StorageEmulatorUpdatableConfiguration.GetConfigurationSection(String name)
CAQuietExec: at Microsoft.WindowsAzure.Storage.Emulator.Controller.Configuration.StorageEmulatorConfigCache..cctor()
CAQuietExec: --- End of inner exception stack trace ---
CAQuietExec: at Microsoft.WindowsAzure.Storage.Emulator.Controller.Configuration.StorageEmulatorConfigCache.get_Configuration()
CAQuietExec: at Microsoft.WindowsAzure.Storage.Emulator.Controller.Initialization..ctor(Boolean forceCreate, Boolean autodetect, String server, String sqlInstance)
CAQuietExec: at Microsoft.WindowsAzure.Storage.Emulator.InitCommand.RunCommand()
CAQuietExec: at Microsoft.WindowsAzure.Storage.Emulator.Program.Main(String args)
CAQuietExec: Error 0xe0434352: Command line returned an error.
CAQuietExec: Error 0xe0434352: CAQuietExec Failed
Looking at the machine.config line found the 'enable' attribute but I am not sure why this would be a problem.
Here is the machine.config line
<section name="processModel" type="System.Web.Configuration.ProcessModelSection, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineOnly" allowLocation="false" enable="true" requestQueueLimit="15000"/>
Any help would be greatly appreciated.
I had the same issue , the following is how i fixed the issue.
Uninstall old Windows Azure Storage emulator , via add/remove programs. In case if you are not able uninstall then use FixItnow to uninstall http://support.microsoft.com/mats/program_install_and_uninstall/en
2.Once the old emulator is gone , you should be able to install the new storage emulator.
Give it a try and let me know.
Thanks
On the previous post there was a posted machine.config that gave me the answer to this question.
After looking and comparing your Machine.config from a successful install I found that the one that worked did not have the "enable" attribute nor the "requestQueueLimit" defined.
I removed those 2 attributes while installing and it worked. I am not sure how the installer works but it apparently does not have all the definitions for all the "processModel" element in the machine.config.
I hope there is someone out there that knows why this would be an issue and why this fix works.