VCMesssage task has failed unexpectedly - visual-studio

`
Severity Code Description Project File Line Suppression State
Error MSB4018 The "VCMessage" task failed unexpectedly.
System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.Format(IFormatProvider provider, String format, Object[] args)
at Microsoft.Build.Utilities.TaskLoggingHelper.FormatString(String unformatted, Object[] args)
at Microsoft.Build.Utilities.TaskLoggingHelper.LogErrorWithCodeFromResources(String messageResourceName, Object[] messageArgs)
at Microsoft.Build.CPPTasks.VCMessage.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() xbLive C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets 460
`I dont know why it is giving me this error. I am rebuilding an old project and I can't seem to find the right build tools needed in order to run the solution correctly.
I tried v143 build tools for 2022 and did all the components. I attempted to get build tools from earlier builds of the project. There is no documentation for me to refer to and this is something I would like to pursue. I just dont know where to find the correct stuff. If it is even in the source code, I wouldn't know because I havent tried looking there. I wouldnt even know where to look.

Related

What causes the error: The "NgenLocalized" parameter is not supported

My project is a Visual Studio Extension. The solution contains multiple projects and references multiple NuGet packages.
On building the solution, I am getting the two errors:
error MSB4064: The "NgenLocalized" parameter is not supported by the
"GenerateFileManifest" task. Verify the parameter exists on the task,
and it is a settable public instance property.
error MSB4063: The "GenerateFileManifest" task could not be
initialized with its input parameters.
The complete errors are:
C:\Users\Phil\.nuget\packages\microsoft.vssdk.buildtools\16.3.2093\tools\VSSDK\Microsoft.VsSDK.targets(685,88): error MSB4064: The "NgenLocalized" parameter is not supported by the "GenerateFileManifest" task. Verify the parameter exists on the task, and it is a settable public instance property.
C:\Users\Phil\.nuget\packages\microsoft.vssdk.buildtools\16.3.2093\tools\VSSDK\Microsoft.VsSDK.targets(685,5): error MSB4063: The "GenerateFileManifest" task could not be initialized with its input parameters.
I get these errors build a release or a debug build.
What do these error mean and how can I get rid of them?
Strangely, if I simply start debugging, it builds without the errors and starts visual studio. However, in that case, I cannot load my package.
The activity log shows the error:
SetSite failed for package [MultiLanguagePackage]
Source: "MultiLanguageWPF"
Description: Method not found: "Microsoft.VisualStudio.Threading.JoinableTaskFactory Microsoft.VisualStudio.Shell.AsyncPackage.get_JoinableTaskFactory()".
System.MissingMethodException: Method not found: "Microsoft.VisualStudio.Threading.JoinableTaskFactory Microsoft.VisualStudio.Shell.AsyncPackage.get_JoinableTaskFactory()".
at MultiLanguageWPF.MultiLanguagePackage.<InitializeAsync>d__2.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
at MultiLanguageWPF.MultiLanguagePackage.InitializeAsync(CancellationToken cancellationToken, IProgress`1 progress)
at Microsoft.VisualStudio.Shell.AsyncPackage.<>c__DisplayClass19_0.<<Microsoft-VisualStudio-Shell-Interop-IAsyncLoadablePackageInitialize-Initialize>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e)
at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck)
at Microsoft.VisualStudio.Services.VsTask.GetResult()</description>
That might be a related error, or it might not be.
error MSB4064: The "NgenLocalized" parameter is not supported by the
"GenerateFileManifest" task. Verify the parameter exists on the task,
and it is a settable public instance property.
error MSB4063: The "GenerateFileManifest" task could not be
initialized with its input parameters.
Can't reproduce exactly same issue in my machine cause I lack the necessary enough info about your project. But I guess maybe this's one issue about the Microsoft.VSSDK.BuildTools package with 16.3.2093 version.
Some tests and discovery:
Msbuild use targets to manage the build process. We can consider msbuild target as the group of msbuild tasks. The task is a unit of executable code used by MSBuild to perform atomic build operations.
I opened the Microsoft.VsSDK.targets(version ) file at line 685 and found content below:
<Target Name="GenerateFileManifest"
Outputs="$(FileManifest)"
DependsOnTargets="$(GenerateFileManifestDependsOn)">
<GenerateFileManifest FileItems="#(VsixSourceItem)" FileManifest="$(FileManifest)" NgenLocalized="$(NgenLocalized)">
<Output TaskParameter="FileManifest" ItemName="FileWrites" />
</GenerateFileManifest>
</Target>
So it's obvious during build process of your vsix project, it will call GenerateFileManifest target, and this target will call and execute GenerateFileManifest task.
See this and we can better understand what the task means and what it really does for us during build process. To execute the GenerateFileManifest task actually is similar to call the method from GenerateFileManifest class. And according to FileItems="xxx" FileManifest="xxx" NgenLocalized="xxx" these three input parameters, this GenerateFileManifest class should have three public property. (While it actually doesn't have public property NgenLocalized defined in GenerateFileManifest class)
Then another line in Microsoft.VsSDK.targets file indicates this class from assembly $(VsSDKCommonAssemblyFile), it's actually Microsoft.VisualStudio.Sdk.BuildTasks.dll in the same folder. (C:\Users\xxx\.nuget\packages\microsoft.vssdk.buildtools\16.3.2093\tools\VSSDK\)
<UsingTask TaskName="FindVsixManifest" AssemblyFile="$(VsSDKCommonAssemblyFile)" />
After view the structure of this assembly, I can't find the expected NgenLocalized public property. So it's the original cause of the issue in my opinion.
Suggestions:
If this issue can be reproduced in simple vsix project, feel free to report this issue
by Help=>Send feedback=>Report the problem to report to Developer Community.
I think this issue comes from the 16.3.2093 package, the Microsoft.VsSDK.targets is not compatible perfectly with the Microsoft.VisualStudio.Sdk.BuildTasks.dll. So I think you can use previous version of this package.(16.2.3073 or earlier, in my machine I use 16.1.3132 version actually and it works well)
Hope it helps:)

Visual Studio Code Cannot Configure Correctly

For some reason, most likely because I do not know how to configure Visual Studio Code. We are talking about the free light version.
It is always showing an error of some type. I am new to this product, NOT VS but this version of it.
How do we set this IDE up correct to work with it?
Here is my current error.
Downloading and configuring the .NET Core Debugger...
Telemetry is: Enabled
log : Restoring packages for C:\Users\Erik Little\.vscode\extensions\ms-vscode.csharp-0.3.7\coreclr-debug\project.json...
info : Committing restore...
log : Lock file has not changed. Skipping lock file write. Path: C:\Users\Erik Little\.vscode\extensions\ms-vscode.csharp-0.3.7\coreclr-debug\project.lock.json
log : C:\Users\Erik Little\.vscode\extensions\ms-vscode.csharp-0.3.7\coreclr-debug\project.json
log : Restore completed in 585ms.
NuGet Config files used:
C:\Users\Erik Little\.vscode\extensions\ms-vscode.csharp-0.3.7\coreclr-debug\NuGet.config
Feeds used:
https://www.myget.org/F/dotnet-core/api/v3/index.json
https://api.nuget.org/v3/index.json
https://www.myget.org/F/coreclr-debug/api/v3/index.json
Telemetry is: Enabled
Error: Can not find runtime target for framework 'DNXCore,Version=v5.0' compatible with one of the target runtimes: 'win10-x64, win81-x64, win8-x64, win7-x64'. Possible causes:
1. The project has not been restored or restore failed - run `dotnet restore`
2. The project does not list one of 'win10-x64, win81-x64, win8-x64, win7-x64' in the 'runtimes' section.
Error:
System.InvalidOperationException: Can not find runtime target for framework 'DNXCore,Version=v5.0' compatible with one of the target runtimes: 'win10-x64, win81-x64, win8-x64, win7-x64'. Possible causes:
1. The project has not been restored or restore failed - run `dotnet restore`
2. The project does not list one of 'win10-x64, win81-x64, win8-x64, win7-x64' in the 'runtimes' section.
at Microsoft.DotNet.ProjectModel.BuildWorkspace.GetRuntimeContext(ProjectContext context, IEnumerable`1 runtimeIdentifiers)
at Microsoft.DotNet.Tools.Publish.PublishCommand.<>c__DisplayClass71_0.<SelectContexts>b__1(ProjectContext c)
at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Microsoft.DotNet.Tools.Publish.PublishCommand.TryPrepareForPublish()
at Microsoft.DotNet.Tools.Publish.PublishCommand.<>c__DisplayClass0_0.<Run>b__0()
at Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args)
at Microsoft.DotNet.Tools.Publish.PublishCommand.Run(String[] args)
dotnet exited with error code 1
Error while installing .NET Core Debugger.
They make it seem so easy to set up but there is always something that i am missing. I have a very good thought that I am not setting up the configuration file correctly because it looks strange to me. Looks like all JS.
Also if I point to a folder that I work in with no issues at all with visual studio enterprise edition I always get this error
eslintrc-error
It keeps looking for eslintrc but i have looked everywhere to resolve this.
I've posted a snapshot of this issue as well.
I know is must be a config issue.
I do not even know what eslintrc is.
Please advise.
It's a linter for ecma... the rc file configures its options.
So you're aware code is an editor, not really an IDE. If you're looking for free I'd suggest Visual Studio Community.

Install Visual Studio 2015 express on Windows 7

I have read this, this, this, this and this questions and answers, none of them have help me at all.
I'm trying to install Visual Studio 2015 Express or Community edition, I have W7 SP1, I have tried with admin rights, I've checked that no preview VS have been installed but no matter what I do, I still can't install VS and I don't understand what the log says, I'll append a picture and what I think is an important part of the log file:
[0D48:1794][2015-10-20T19:36:45]i000: MUX: Feed uri to register: http://go.microsoft.com/fwlink/?LinkID=558779&clcid=0x409
[0D48:1794][2015-10-20T19:36:47]e000: MUX: Exception: Info: Unable to load dynamic feed
[0D48:1794][2015-10-20T19:36:47]e000: MUX: ERROR: Could not load file or assembly 'System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The module was expected to contain an assembly manifest.
[0D48:1794][2015-10-20T19:36:47]e000: MUX: Stack: at Microsoft.Web.PlatformInstaller.Util.IsSignatureValid(String xmlFile)
at Microsoft.Web.PlatformInstaller.ProductManager.LoadFromXml(String xmlFile, Boolean loadEnclosures, Boolean isOnlineFeedLoaded, Boolean verifySignature)
at Microsoft.Web.PlatformInstaller.ProductManager.Load(Uri productFileUrl, Boolean filterByArchitectureAndOS, Boolean loadEnclosures, Boolean useCachedVersion, String cacheDirectory, Architecture architecture, Int32 osType, String& finalFeedCacheLocation, Boolean& isOnlineFeedLoaded, Boolean& onlineFeedLoadError, String localFeed, Boolean verifySignature, String feedUri, String lastUsedFeedLocationKey, BundleProperties currentBundle)
at Microsoft.Web.PlatformInstaller.ProductManager.Load(Uri productFileUrl, Boolean filterByArchitectureAndOS, Boolean loadEnclosures, Boolean useCachedVersion, String cacheDirectory, String& finalFeedCacheLocation, Boolean& isOnlineFeedLoaded, Boolean& onlineFeedLoadError, String localFeed, Boolean verifySignature, String feedUri, String lastUsedFeedLocationKey, BundleProperties currentBundle)
at Microsoft.Devdiv.Bootstrapper.Utility.SecondaryInstallerUtility.LoadProductManager()
[0D48:05C8][2015-10-20T19:36:54]i000: MUX: View loaded
[0D48:05C8][2015-10-20T19:36:54]i000: MUX: Go to Blocker page.
[0D48:05C8][2015-10-20T19:36:54]i199: Detect complete, result: 0x0
Apparently, the problem is in:
Could not load file or assembly
'System.Security, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'
UPDATE
After devlin carnate suggestion and reading answers from this site and this one too I have tried the following:
Update my OS. Except for the "update to W10" I have installed all updates (even some of those marked as optionals).
Run a "scan now" from command prompt, bassically, I followed instructions from this site, and even when something were marked as corrupted I don't know how to repair it ('cause no dll or file were detected).
Uninstall the .NET Framework and install a prev version (from 4.5 to 4) but the problem persist (also, after this, windows suggest to update to 4.5 so I reinstall 4.5 version).
Use the .NET Framework Repair Tool with no results.
UPDATE 2
I just format my HDD unit and reinstall (the same) W7 SP1 all over again, after that, I was able to install VS Community Edition, but I don't take this as a solution since is just too drastic and I don't know the original reason of why this happened in the first place.

QuantLib+SWIG+C# 4.0+Visual Studio 2010: TypeInitializationException

I would like to add a small feature to QuantLib and compile it together with SWIG bindings to use in a C# project in Visual Studio 2010. I am however having problems at almost every turn. What are the steps involved in building QuantLib in Visual Studio 2010, creating the SWIG bindings, and building the C# project?
I downloaded QuantLib from http://sourceforge.net/projects/quantlib/files/
I downloaded Boost from http://sourceforge.net/projects/boost/files/boost/1.49.0/
I downloaded the QuantLib+SWIG bindings from http://sourceforge.net/projects/quantlib/files/QuantLib/1.0/bindings/QuantLib-SWIG-1.0.zip/download
I set an environment variable QL_DIR to "C:\pathToFolder\QuantLib-1.2\lib" (computer > properties > advanced system settings > advanced > environment variables)
I ran the swig.cmd file located in C:\pathToFolder\QuantLib-SWIG-1.0\CSharp
I opened QuantLib_vc9.sln in Visual Studio 2010
For the NQuantLibc project:
I included my Boost and QuantLib directories in the header directories.
I included my QuantLib/lib directory in the library directories.
I successfully built the NQuantLibc project
For the NQuantLib_vc9 project:
I made it dependent on the NQuantLibc project.
I successfully built the NQuantLib_vc9 project.
For the EquityOption_vc9 project:
I made it dependent on the NQuantLib_vc9 project.
I successfully built the EquityOption_vc9 project.
When I try to run the EquityOption_vc9 project, I get a TypeInitializationException, "An attempt was made to load a program with an incorrect format."
Here's the full exception:
System.TypeInitializationException was unhandled
Message=The type initializer for 'QuantLib.NQuantLibcPINVOKE' threw an exception.
Source=NQuantLib
TypeName=QuantLib.NQuantLibcPINVOKE
StackTrace:
at QuantLib.NQuantLibcPINVOKE.new_Date__SWIG_1(Int32 jarg1, Int32 jarg2, Int32 jarg3)
at QuantLib.Date..ctor(Int32 d, Month m, Int32 y) in C:\Users\JRobinson\Desktop\QuantLib-SWIG-1.0\CSharp\csharp\Date.cs:line 48
at EquityOptionTest.EquityOption.Main(String[] args) in C:\Users\JRobinson\Desktop\QuantLib-SWIG-1.0\CSharp\examples\EquityOption.cs:line 43
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.TypeInitializationException
Message=The type initializer for 'SWIGExceptionHelper' threw an exception.
Source=NQuantLib
TypeName=SWIGExceptionHelper
StackTrace:
at QuantLib.NQuantLibcPINVOKE.SWIGExceptionHelper..ctor()
at QuantLib.NQuantLibcPINVOKE..cctor() in C:\Users\JRobinson\Desktop\QuantLib-SWIG-1.0\CSharp\csharp\NQuantLibcPINVOKE.cs:line 126
InnerException: System.BadImageFormatException
Message=An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
Source=NQuantLib
StackTrace:
at [long string removed]
at QuantLib.NQuantLibcPINVOKE.SWIGExceptionHelper..cctor() in C:\Users\JRobinson\Desktop\QuantLib-SWIG-1.0\CSharp\csharp\NQuantLibcPINVOKE.cs:line 106
InnerException:
Note that I built everything with the Debug configuation. I also tried this using the Release configuration. It didn't work.
I wish I could find a complete set of instructions detailing how to build this type of project. I found some instructions here, Compiling Quantlib via SWIG for C# but i couldn't get it to work.
The QuantLib page contains instructions for building QuantLib in Visual Studio 2010, http://quantlib.org/install/vc10.shtml but I need help creating the SWIG bindings.
Resolver Systems has pre-built C# bindings that work for me. http://www.resolversystems.com/products/quantlib-binary/ I was able to run QuantLib code in C# just fine with this package. My problem is that I need to add a small feature to the QuantLib code for use in my C# project. This is the reason I need to re-build QuantLib and re-create the SWIG bindings.
I know about QLNet, the C# port of QuantLib, http://sourceforge.net/projects/qlnet/, but this project is missing some pieces and I think that it is no longer being actively developed. Specifically, I need to be able to price options that pay discrete dividends. QLNet is missing some of the code for this. I tried porting the necessary code from QuantLib to QLNet, but my C++ must be rusty because I was getting incorrect output.
Note that the small feature I need to add to QuantLib is the ability to handle fractional days. I was able to add this feature to QLNet, and it is a small feature indeed. This tiny edit is delaying my project. I would greatly appreciate help on this issue.
There indeed seems to be a problem with the SWIG wrappers as distributed and .Net 4.0.
I'm not working on that platform, so I can't speak based on personal experience. However, the issue was discussed recently on the QuantLib mailing list, and the solution contributed there by Mark Gillis was reported to work. You can read the relevant thread at http://thread.gmane.org/gmane.comp.finance.quantlib.user/8238. Hope this helps...
I struggled with this exact error message a little while back, and visited this page, as Google search might say, "many times".
In the end, my error was fairly benign, but it took me a while to sort it out.
I was using C# wrappers by SWIG to access QuantLib C++ library. I used Excel DNA Integration to make my Quantlib.xll, and I also built a few .exes that access Quantlib.
Various situations would cause this error to appear for me, most especially
Running the .exes off of my desktop ("sometimes")
Distributing my XLL to other users (always).
In the end, I discovered that the distribution that I was getting from the bin folder of my VS2010 (and 12, 13, 15) projects included NQuantLib (the C# wrapper code) but did not include NQuantLibc (the C++ unmanaged code being called).
The XLL and the exes worked on my machine sometimes because I probably helped them (via changing my path?) to find the missing C++ code, but I did not recall that step in the process.
Once I figured it out (using a StackOverflow hint to check the "inner exception" on the error when running the code on another machine and opening up VS to debug when it bombed), the problem went away.
A bit of ignorance on my part that cost me a bit of time but earned me a bit of experience:
this error, for me, was caused by not putting the unmanaged (C++) library where the managed (C#) library could find it.

Debugging mscorlib in .Net 4.0

I'm getting the following exception from System.IO.Path.CheckInvalidPathChars() in mscorlib:
[ArgumentException: Illegal characters
in path.]
System.IO.Path.CheckInvalidPathChars(String
path) +142
System.IO.Path.NormalizePath(String
path, Boolean fullCheck, Int32
maxPathLength) +100
System.IO.Path.GetFullPath(String
path) +187
System.Xml.XmlResolver.ResolveUri(Uri
baseUri, String relativeUri) +114
System.Xml.XmlTextReaderImpl..ctor(String
url, XmlNameTable nt) +135
System.Xml.XmlDocument.Load(String
filename) +85
Sitecore.Web.UI.WebControls.WebEditRibbon.ConvertToJson(String
layout) +210
Sitecore.Web.UI.WebControls.WebEditRibbon.Render(HtmlTextWriter
output, Item item) +1268
Sitecore.Web.UI.WebControl.Render(HtmlTextWriter
output) +387
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter
writer, ICollection children) +246
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter
writer) +315
System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter
writer) +48
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter
writer, ControlAdapter adapter)
+11279890 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter
writer, ICollection children) +246
System.Web.UI.Page.Render(HtmlTextWriter
writer) +40
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean
includeStagesAfterAsyncPoint) +5274
The thing is, I don't what the path value is that's causing this error. It would help if I could debug the method so I can see the value of the path parameter. I enabled stepping into the .Net Framework code in Visual Studio 2010. I've also loaded the related .Net Framework Symbols from the Microsoft Symbol Servers. However, it seems these PDBs don't include the source; so I can't step into CheckInvalidPathChars and retrieve the path value.
Is it possible to debug mscorlib and step through its source?
Relevant info:
.Net Framework 4.0.
Visual Studio 2010
Any constructive input is greatly appreciated.
Thanks,
Frank
You can get the reference source for the .NET libraries.
http://referencesource.microsoft.com/
Looking at your stacktrace, the problem appears to be originating in Sitecore.Web.UI.WebControls.WebEditRibbon.ConvertToJson. That thing is trying to load an XML file.
Using reflector would allow you to do that.
Is it possible that you enabled to break on all exceptions? Doing that would certainly account for internal exceptions showing up in the debugger. If this is the case, you can safely ignore the exception.
Well mscorlib.dll on your machine is of release build so even though you can very well debug into it, you won't be able to see values local variables/objects etc. The code in this binary is optimized. If you want perfect debugging experience of Microsoft .NET code then you will need to install debug version of .NET on your machine.

Resources