Visual Studio 2017 Error initializing VroomJs.JsEngine - asp.net-mvc

My project uses Reactjs, and I use Visual Studio 2017. Recently I did an software update on VS 2017, but no code/config changes.
However, when I start my project locally in debug mode, I encountered below error:
No JavaScript engines were registered, falling back to a default config! It is recommended that you configure JavaScriptEngineSwitcher in your app. See https://github.com/Taritsyn/JavaScriptEngineSwitcher/wiki/Registration-of-JS-engines for more information.
Error initialising JavaScriptEngineSwitcher.V8.V8JsEngineFactory: JavaScriptEngineSwitcher.Core.JsEngineLoadException: During loading of V8JsEngine error has occurred.
See more details:
Cannot load V8 interface assembly. Load failure information for v8-ia32.dll:
C:\Users\user1\AppData\Local\Temp\Temporary ASP.NET Files\vs\77655ce5\ca0bb6d0\assembly\dl3\300b733a\003cadac_c3f4d201\v8-ia32.dll: The specified module could not be found
C:\Code\project1\branches\apps\src\DotNet\COMP.project1.Web\v8-ia32.dll: The specified module could not be found
C:\Code\project1\branches\apps\src\DotNet\COMP.project1.Web\bin\v8-ia32.dll: The specified module could not be found ---> System.TypeLoadException: Cannot load V8 interface assembly. Load failure information for v8-ia32.dll:
C:\Users\user1\AppData\Local\Temp\Temporary ASP.NET Files\vs\77655ce5\ca0bb6d0\assembly\dl3\300b733a\003cadac_c3f4d201\v8-ia32.dll: The specified module could not be found
C:\Code\project1\branches\apps\src\DotNet\COMP.project1.Web\v8-ia32.dll: The specified module could not be found
C:\Code\project1\branches\apps\src\DotNet\COMP.project1.Web\bin\v8-ia32.dll: The specified module could not be found
at Microsoft.ClearScript.V8.V8Proxy.LoadNativeLibrary()
at Microsoft.ClearScript.V8.V8Proxy.LoadAssembly()
at Microsoft.ClearScript.V8.V8Proxy.GetAssembly()
at Microsoft.ClearScript.V8.V8Proxy.GetImplType(Type type)
at Microsoft.ClearScript.V8.V8Proxy.CreateImpl[T](Object[] args)
at Microsoft.ClearScript.V8.V8IsolateProxy.Create(String name, V8RuntimeConstraints constraints, Boolean enableDebugging, Int32 debugPort)
at Microsoft.ClearScript.V8.V8Runtime..ctor(String name, V8RuntimeConstraints constraints, V8RuntimeFlags flags, Int32 debugPort)
at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(V8Runtime runtime, String name, V8RuntimeConstraints constraints, V8ScriptEngineFlags flags, Int32 debugPort)
at JavaScriptEngineSwitcher.V8.V8JsEngine..ctor(V8Settings settings)
--- End of inner exception stack trace ---
at JavaScriptEngineSwitcher.V8.V8JsEngine..ctor(V8Settings settings)
at JavaScriptEngineSwitcher.V8.V8JsEngineFactory.CreateEngine()
at React.JavaScriptEngineFactory.GetFactory(JsEngineSwitcher jsEngineSwitcher, Boolean allowMsie)
Error initialising React.VroomJsEngine+Factory: JavaScriptEngineSwitcher.Core.JsEngineLoadException: During loading of VroomJs JavaScript engine error has occurred.
See more details:
The type initializer for 'VroomJs.JsEngine' threw an exception. ---> System.TypeInitializationException: The type initializer for 'VroomJs.JsEngine' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'VroomJsNative': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at VroomJs.JsEngine.js_set_object_marshal_type(JsObjectMarshalType objectMarshalType)
at VroomJs.JsEngine..cctor()
--- End of inner exception stack trace ---
at VroomJs.JsEngine..ctor(Int32 maxYoungSpace, Int32 maxOldSpace)
at React.VroomJsEngine.<>c.<.cctor>b__23_0()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at System.Lazy`1.get_Value()
at React.VroomJsEngine.get_Engine()
at React.VroomJsEngine..ctor()
--- End of inner exception stack trace ---
at React.VroomJsEngine..ctor()
at React.VroomJsEngine.Factory.CreateEngine()
at React.JavaScriptEngineFactory.GetFactory(JsEngineSwitcher jsEngineSwitcher, Boolean allowMsie)
This error does not block me from running and testing the code.
Like I said, all I did recently was to update the VS 2017 software...I tried to do a wild search in the project for 'v8-ia32' but nothing found.

To fix these errors I did the following:
Make sure you install the JavaScriptEngineSwitcher.V8, JavaScriptEngineSwitcher.V8.Native.win-x86 and JavaScriptEngineSwitcher.V8.Native.win-x64.
(I didn't install JavaScriptEngineSwitcher.V8.Native.win-x86)
According to https://reactjs.net/getting-started/aspnet.html
edit the ReactConfig.cs, basically, I just added this
JsEngineSwitcher.Current.DefaultEngineName = V8JsEngine.EngineName;
JsEngineSwitcher.Current.EngineFactories.AddV8();
Rebuild the project.

Related

Xamarin Error XA0009 - Format of Executable or Library is invalid

I am struggling to make an Android App, but it always seems to end in this particular failure:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Exception while loading assemblies: Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA0009: Error while loading assembly: bin/Debug/(projectname).dll ---> System.BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.
at Mono.Cecil.PE.ImageReader.ReadImage () [0x0002d] in <1b827dd2cbec4ef6829dffcefdcd3b01>:0
at Mono.Cecil.PE.ImageReader.ReadImage (Mono.Disposable1[T] stream, System.String file_name) [0x0000a] in <1b827dd2cbec4ef6829dffcefdcd3b01>:0
at Mono.Cecil.ModuleDefinition.ReadModule (Mono.Disposable1[T] stream, System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00007] in <1b827dd2cbec4ef6829dffcefdcd3b01>:0
at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00073] in <1b827dd2cbec4ef6829dffcefdcd3b01>:0
--- End of inner exception stack trace ---
at Java.Interop.Tools.Diagnostics.Diagnostic.Error (System.Int32 code, System.Exception innerException, System.String message, System.Object[] args) [0x0000a] in :0
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Load (System.String fileName) [0x00045] in <9ca47d05131d4b8c85910dacd818f0c6>:0
at Xamarin.Android.Tasks.ResolveAssemblies.Execute (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver resolver) [0x00123] in <3f37ea95794e430e91f10accab4cf241>:0 ((projectname))
I am wondering what on earth might be causing the error, as I have tried multiple solutions to avoid the error and it often turns up in such random ways.
Last time I got the error it occurred as follows:
I had a project with only two Activity-files and two Layout files.
I created a gridview in the other layout and tested it on the Android emulator -> all was working well.
I resized the gridview and tested the app with the emulator -> error mentioned above occurred.
I deleted the solution, restored a manual backup saved in an other location, and tested it -> it was working.
I repeated the procedure with the gridview -> error occurred.
Now, as I deleted the project and tried to restore the backup again, even the backup did not work anymore. I tried to build it, then clean it and build but every attempt to build it resulted now as an error.
I seem to get mystic errors from time to time ( like Emulator image stopped working after all I did was just add a button with the designer) but every time troubleshooting eventually comes down to this error and I have to scrap the project. I have been working with Xamarin now 18 hours this weekend and 4 hours have been coding and the rest trying to fix the never-ending errors.
I am using MacBook Pro and have tried running the solution from the default directory and external drive.
So in a nutshell: What causes the error mentioned above and can it be fixed or at least avoided?
I tried to google ( long and hard) but could not find a solution that would be of any help.
Ps. Sorry if the post was not correct, it is my first. Would not have posted in the first place but I am desperate.
Thank you for your patience to read all the way to here.

Could not load type 'ProtocolSupportModule'

I've found a boss-level error that forced me to become an active member of stackoverflow.
I am hosting an MVC app and on root level it works, however css and images are failing. Even when going to the image directly via URL I get the following error:
Could not load type 'ProtocolSupportModule'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Could not load type 'ProtocolSupportModule'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): Could not load type 'ProtocolSupportModule'.]
System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +12510809
System.Web.Configuration.HandlerFactoryCache.GetTypeWithAssert(String type) +47
System.Web.Configuration.HandlerFactoryCache.GetHandlerType(String type) +18
System.Web.Configuration.HandlerFactoryCache..ctor(String type) +27
System.Web.HttpApplication.GetFactory(String type) +94
System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +375
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
Okay so I figured this out.
Under handler mappings, the OptionsVerbHandler was set to allow all verbs under the request restrictions section. I set it to only allow the OPTIONS verb and created extra handlers for POST and GET.
UPDATE:
WHEN a GETHandler is specified on a folder with stylesheets or images the ProtocolSupportModule error occurs when the image/stylesheet is called. When no Gethandler is present on dll's views, the MVC app displays a verb rights error.
I got around this by setting the handlers on folder level. This is a bad way of doing it. Are there any better ideas? I am sure the MVC framework should handle this automatically?

TF215097: An error occured while initializing a build for build definition

We just installed TFS2013 Update 2 on a brand new server with server 2008 r2 on it. At one moment in time I was able to run builds for my projects but now I can't and I don't know why or what even changed. The explination will get a little winded so sorry. Here is the full exception that i see every time. All of my projects use the CMMI process, so out of curiousity I made a new project called Hello World Test that uses the Agile template. Made a new build, committed my code and sure enough just like all my other projects I get this error. There are 3 accounts in our TFS server, 2 are admin and 1 is a contributor. I'm one of the 2 admins, but both of us have same problem. I've even logged on as the system admin and tried kicking off a build and got same error.
TF215097: An error occurred while initializing a build for build definition \Hello World Test\WpfApplication1:
Exception Message: One or more errors occurred. (type AggregateException)
Exception Stack Trace: at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at Microsoft.TeamFoundation.Build.Client.FileContainerHelper.GetFile(TfsTeamProjectCollection projectCollection, String itemPath, Stream outputStream)
at Microsoft.TeamFoundation.Build.Client.FileContainerHelper.GetFileAsString(TfsTeamProjectCollection projectCollection, String itemPath)
at Microsoft.TeamFoundation.Build.Client.ProcessTemplate.Download(String sourceGetVersion)
at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.PrepareRequestForBuild(WorkflowManagerActivity activity, IBuildDetail build, WorkflowRequest request, IDictionary`2 dataContext)
at Microsoft.TeamFoundation.Build.Hosting.BuildWorkflowManager.TryStartWorkflow(WorkflowRequest request, WorkflowManagerActivity activity, BuildWorkflowInstance& workflowInstance, Exception& error, Boolean& syncLockTaken)
Inner Exception Details:
Exception Message: VS30063: You are not authorized to access http://foo.bar.com:8050. (type VssUnauthorizedException)
Exception Stack Trace: at Microsoft.VisualStudio.Services.Common.VssHttpMessageHandler.<SendAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.WebApi.VssHttpRetryMessageHandler.<SendAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.WebApi.HttpClientExtensions.<DownloadFileFromTfsAsync>d__2.MoveNext()
After getting this error about 100x I checked the Application logs to see if i could glean any sort of information and the only thing I could see was that during creation of the build server was this Failed to add the build service account 'CORP\Administrator' to Windows Group 'IIS_IUSRS'. Details: Group does not exist. I tried changing the build server user and each time i get the same Warning message in the event logs. I'm almost 100% sure this is the problem. Now what I find odd about this particular error is that I can see IIS_IUSRS in active directory but i keep getting that error. Anyone have any clue as to why i'm getting this error? What information can I get anyone to help figure this out?

Castle Windsor does not work under Medium Trust

When attempting to run an ASP.NET MVC application which uses Castle Windsor, the following error occurs.
Server Error in '/' Application.
Inheritance security rules violated while overriding member:
'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'.
Security accessibility of the overriding method must match the
security accessibility of the method being overriden.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.TypeLoadException: Inheritance security
rules violated while overriding member:
'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'.
Security accessibility of the overriding method must match the
security accessibility of the method being overriden.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[TypeLoadException: Inheritance security rules violated while
overriding member:
'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'.
Security accessibility of the overriding method must match the
security accessibility of the method being overriden.]
Castle.Windsor.WindsorContainer..ctor() +0
The assemblies Castle.Core.dll and Castle.Windsor.dll have been built off the source code available on github. The source code for the assemblies includes the file SecurityAssemblyInfo.cs which has the following source code:
// Sets up assembly level security settings
#if ! SILVERLIGHT
[assembly: System.Security.AllowPartiallyTrustedCallers]
#if DOTNET40
[assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level2)]
#endif
#endif
I have verified using ILSpy that the System.Security.AllowPartiallyTrustedCallers attribute is declared at the assembly on both files.
The web application is being run with <trust level="Medium" />.
I have been able to get a successful build + run of my mvc application by making the following changes to Castle.Core:
SecurityAssemblyInfo.cs:
Changed to only the following:
[assembly: System.Security.AllowPartiallyTrustedCallers]
[assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)]
ProxyGenerator.cs:
Changed three lines in ProxyGenerator::ProxyGenerator(IProxyBuilder):
if (HasSecurityPermission())
{
Logger = new TraceLogger("Castle.DynamicProxy", LoggerLevel.Warn);
}
becomes:
// if (HasSecurityPermission())
// {
// Logger = new TraceLogger("Castle.DynamicProxy", LoggerLevel.Warn);
// }
I have no idea what sort of consequences these might have. It would be nice if someone familiar with the SecurityRuleSets could chime in on the first part, and #Krzysztof Koźmic could advise me on why I had to comment out the trace logger.

Troubleshooting MSBuild failures

I am trying to convert my shop from using VSS to TFS.
Our current codebase consists of a large number of Visual Studio 2008 solutions and I've noticed some of them seem to cause MSBuild to fail, but I cannot figure out why. The actual solutions themselves and the projects they hold build correctly, but the overall build still fails.
The ErrorsAndWarnings.txt and Release.txt file show no errors, just warnings (various little things in the code we need to clean up)
The BuildLog.txt file is, of course, enormous and has tons and tons of difficult-to-comprehend text in it. As best I can tell though, when it gets to one of these SLN files that give it problems, MSBuild just flat out crashes and dies.
Task "MSBuild"
Global Properties:
Configuration=Release
Platform=Any CPU
OutDir=C:\TFS\REPOSITORY\Full\Binaries\Release\
PublishDir=C:\TFS\REPOSITORY\Full\Binaries\Release\
SkipInvalidConfigurations=true
RunCodeAnalysis=false
VCBuildOverride=C:\TFS\REPOSITORY\Full\Sources\Code\Solution\Solution.sln.Release.vsprops
VCBuildAdditionalLibPaths=
VCBuildAdditionalOptions=
VCBuildToolPath=
VCBuildUseEnvironment=
TeamBuildConstants=_TEAM_BUILD_
TargetsNotLogged=GetTargetPath;GetNativeManifest;GetCopyToOutputDirectoryItems
C:\Program Files\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets(1008,5):
error MSB4018: The "MSBuild" task failed unexpectedly.
error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object.
error MSB4018: at Microsoft.Build.BuildEngine.SolutionWrapperProject.AssignDependencyLevel(ProjectInSolution project, SolutionParser solution, Dictionary`2 projectsByDependencyLevel)
error MSB4018: at Microsoft.Build.BuildEngine.SolutionWrapperProject.AssignDependencyLevel(ProjectInSolution project, SolutionParser solution, Dictionary`2 projectsByDependencyLevel)
error MSB4018: at Microsoft.Build.BuildEngine.SolutionWrapperProject.AssignDependencyLevels(SolutionParser solution, Dictionary`2 projectsByDependencyLevel)
error MSB4018: at Microsoft.Build.BuildEngine.SolutionWrapperProject.CreateSolutionProject(SolutionParser solution, Project msbuildProject, BuildEventContext projectBuildEventContext, String wrapperProjectToolsVersion, Engine parentEngine, String solutionProjectCache)
error MSB4018: at Microsoft.Build.BuildEngine.SolutionWrapperProject.Generate(SolutionParser solution, Project msbuildProject, String toolsVersionOverride, BuildEventContext projectBuildEventContext)
error MSB4018: at Microsoft.Build.BuildEngine.Project.Load(String projectFileName, BuildEventContext buildEventContext, ProjectLoadSettings projectLoadSettings)
error MSB4018: at Microsoft.Build.BuildEngine.Engine.GetMatchingProject(Project existingProject, String projectFullPath, BuildPropertyGroup globalPropertiesToUse, String toolsVersion, String[] targetNames, BuildEventContext buildEventContext, Boolean toolsVersionPeekedFromProjectFile)
error MSB4018: at Microsoft.Build.BuildEngine.Engine.BuildProjectFileInternal(BuildRequest buildRequest)
error MSB4018: at Microsoft.Build.BuildEngine.Engine.EngineBuildLoop(BuildRequest terminatingBuildRequest)
error MSB4018: at Microsoft.Build.BuildEngine.TaskExecutionModule.BuildProjectFile(Int32 handleId, String[] projectFileNames, String[] targetNames, IDictionary[] globalPropertiesPerProject, IDictionary[] targetOutputsPerProject, EngineLoggingServices loggingServices, String[] toolsVersions, Boolean useResultsCache, Boolean unloadProjectsOnCompletion, BuildEventContext taskContext)
error MSB4018: at Microsoft.Build.BuildEngine.EngineProxy.BuildProjectFilesInParallel(String[] projectFileNames, String[] targetNames, IDictionary[] globalProperties, IDictionary[] targetOutputsPerProject, String[] toolsVersions, Boolean useResultsCache, Boolean unloadProjectsOnCompletion)
error MSB4018: at Microsoft.Build.Tasks.MSBuild.ExecuteTargets(ITaskItem[] projects, Hashtable propertiesTable, ArrayList targetLists, Boolean stopOnFirstFailure, Boolean rebaseOutputs, IBuildEngine2 buildEngine, TaskLoggingHelper log, ArrayList targetOutputs, Boolean useResultsCache, Boolean unloadProjectsOnCompletion, String toolsVersion)
error MSB4018: at Microsoft.Build.Tasks.MSBuild.BuildProjectsInParallel(Hashtable propertiesTable, ArrayList targetLists, Boolean success, Boolean[] skipProjects)
error MSB4018: at Microsoft.Build.Tasks.MSBuild.Execute()
error MSB4018: at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)
Done building target "CoreCompileSolution" in project "TFSBuild.proj" -- FAILED.
Done Building Project "C:\TFS\REPOSITORY\Full\BuildType\TFSBuild.proj" (CompileSolution target(s)) -- FAILED.
Done executing task "MSBuild" -- FAILED.
Done building target "CoreCompileConfiguration" in project "TFSBuild.proj" -- FAILED.
Done Building Project "C:\TFS\REPOSITORY\Full\BuildType\TFSBuild.proj" (CompileConfiguration target(s)) -- FAILED.
Done executing task "MSBuild" -- FAILED.
Done building target "CoreCompile" in project "TFSBuild.proj" -- FAILED.
Done Building Project "C:\TFS\REPOSITORY\Full\BuildType\TFSBuild.proj" (CoreCompile target(s)) -- FAILED.
Done executing task "MSBuild" -- FAILED.
Done building target "CallCompile" in project "TFSBuild.proj" -- FAILED.
I know pasting incredibly verbose error messages in Stack Overflow is lame but the core thing to take from the above is MSBuild is crashing and I can't figure out why. It gives the usual "Object reference not set..." error, which is pretty much universally useless when it's not your code or program you're troubleshooting.
I see that it's referencing TeamFoundation.Build.targets. I look up that file that file but it doesn't really jump out at me what the problem could be. (the line after the comment is the (1008,5) referenced above)
<!-- Build using MSBuild task -->
<MSBuild BuildInParallel="$(BuildSolutionsInParallel)"
Projects="$(Solution)"
Properties="Configuration=$(Configuration);Platform=$(Platform);$(OutDirOption);$(PublishDirOption);SkipInvalidConfigurations=$(SkipInvalidConfigurations);$(FxCopDirOption);$(ReferencePathOption);$(CodeAnalysisOption);
VCBuildOverride=$(VsPropsFile);VCBuildAdditionalLibPaths=$(VCBuildAdditionalLibPaths);VCBuildAdditionalOptions=$(VCBuildAdditionalOptions);VCBuildToolPath=$(VCBuildToolPath);VCBuildUseEnvironment=$(VCBuildUseEnvironment);
TeamBuildConstants=$(TeamBuildConstants);TargetsNotLogged=$(TargetsNotLogged);$(CustomPropertiesForBuild);$(CustomProperties)"
Targets="$(Targets)"
StopOnFirstFailure="$(StopOnFirstFailure)">
<Output TaskParameter="TargetOutputs" ItemName="CompilationOutputs" />
</MSBuild>
At first I thought this was telling me that one of the items that need to be substituted in the node was missing, but the other solutions which don't have issues have similar/identical setups.
I notice some of the items in the call stack of the MSBuild deal with targets and the issue seems to stem from the TeamFoundation.Build.targets file but I'm stuck as to what to do next to troubleshoot it.
Has anyone run into this before?
I believe the solution file is corrupt, and VS is being more tolerant. (If I remember correctly this crash can be caused by an unmatched curly parenthesis)
If it's feasible, I would recreate the solution file from within VS.
Dan (msbuild team)
When you said:
The actual solutions themselves and the projects they hold build correctly
do you mean that they build correctly within the IDE, or that you can go to those solution directories on the command line and run 'msbuild foo.proj' or 'msbuild bar.sln'?
Anyway, things I would try are first narrow down the offending solution/project, by telling TFS not to build in parallel, turn off multi-CPU support (e.g. '-maxcpucount:1'), do a binary search by trimming away solutions/projects. Once you get to the offending set, build with the '-v:diag' parameter to get even more details about the state of the MSBuild engine.
Alternately, you can write a small C# app that invokes the MSBuild engine directly and debug that application by catching first chance exceptions and having Reflector handy. See
sample code in MSBuild Engine Class.
Hmmm. You get a NullReferenceException, meaning that one of the parameters into that task is a null when it shouldn't be. Dumb question, but have you set up your TFSBuild.proj file with the solutions you want to build? IE. the stuff you put into the
- Itemgroup.
If you have, I would suggest adding message tasks to the Teambuild targets file just above the failing task to write out diagnostic information, like so:
That should spew some diagnostics info into your buildlog just above the log exerpt you pasted on your next build.
You may want to give the MSBuild-Sidekicks a try. They have a nifty little debugger for MSBuild included and offer a 14-day trial version: http://www.attrice.info/msbuild/

Resources