Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Long project name (~20 char) throws System.ExecutionEngineException for UWP #12990

Closed
CaseAlexander opened this issue Nov 29, 2020 · 17 comments
Labels
p/UWP s/unverified New report that has yet to be verified t/bug 🐛

Comments

@CaseAlexander
Copy link

Description

If using a relatively long project name (20 char tested), UWP throws the System.ExecutionEngineException "Windows.UI.Xaml.Controls.RevealBackgroundBrush"

Steps to Reproduce

  1. Create a new Mobile App (Xamarin.Forms) named "TestTestTestTestTest" with Blank template and develop for UWP, iOS, and Android.
  2. Build and run the UWP application for Debug x86.
  3. Repeat with a project named "Test" and everything works fine.

Expected Behavior

The project should launch with the Xamarin.Forms sample.

Actual Behavior

throws the System.ExecutionEngineException "Windows.UI.Xaml.Controls.RevealBackgroundBrush"

Basic Information

  • Version with issue: >= 4.8.0.1269
  • Last known good version: 4.7.0.1351
  • Platform Target Frameworks:
    • UWP: 16299, 17134, 17763, 18362
  • NuGet Packages: Microsoft.NETCOre.UniversalWindowsPlatform, NETStandard.Library, Xamarin.Essentials, Xamarin.Forms (all default installed versions)
  • Affected Devices: Desktop

Environment

Microsoft Visual Studio Community 2019
Version 16.8.2
VisualStudio.16.Release/16.8.2+30717.126
Microsoft .NET Framework
Version 4.8.04084

Installed Version: Community

Visual C++ 2019   00435-60000-00000-AA603
Microsoft Visual C++ 2019

ADL Tools Service Provider   1.0
This package contains services used by Data Lake tools

ASA Service Provider   1.0

ASP.NET and Web Tools 2019   16.8.553.28003
ASP.NET and Web Tools 2019

ASP.NET Core Razor Language Services   16.1.0.2052803+84e121f1403378489b842e1797df2f3f5a49ac3c
Provides languages services for ASP.NET Core Razor.

ASP.NET Web Frameworks and Tools 2019   16.8.553.28003
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   16.8.553.28003
Azure App Service Tools v3.0.0

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.6.3000.0
Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools   16.8.553.28003
Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio   2.6.3000.0
Microsoft Azure Stream Analytics Tools for Visual Studio

C# Tools   3.8.0-5.20567.16+53c5d7d3cf13d88978744a32a27c5f8350a8400a
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Collapse Comments   1.9
Adds command to Collapse Code Comments within the open file.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Cookiecutter   16.8.20241.2
Provides tools for finding, instantiating and customizing templates in cookiecutter format.

Extensibility Message Bus   1.2.6 (master@34d6af2)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

IntelliCode Extension   1.0
IntelliCode Visual Studio Extension Detailed Info

JetBrains ReSharper 2020.2.4   Build 202.0.20200925.65451
JetBrains ReSharper package for Microsoft Visual Studio. For more information about ReSharper, visit http://www.jetbrains.com/resharper. Copyright © 2020 JetBrains, Inc.

Microsoft Azure HDInsight Azure Node   2.6.3000.0
HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service   2.6.3000.0
Language service for Hive query

Microsoft Azure Stream Analytics Language Service   2.6.3000.0
Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node   1.0
Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.30924.1

Microsoft Continuous Delivery Tools for Visual Studio   0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager   2.1.113+g422d40002e.RR
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers   1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   16.8.43 (00471f8)
Support for debugging Mono processes with Visual Studio.

Node.js Tools   1.5.20902.1 Commit Hash:b474efcb6f92db52a8f8e2e6a8cb9648476885cc
Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager   5.8.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Python   16.8.20241.2
Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.

Python - Conda support   16.8.20241.2
Conda support for Python projects.

Python - Django support   16.8.20241.2
Provides templates and integration for the Django web framework.

Python - IronPython support   16.8.20241.2
Provides templates and integration for IronPython-based projects.

Python - Profiling support   16.8.20241.2
Profiling support for Python projects.

SettingsWindow Extension   1.0
SettingsWindow Visual Studio Extension Detailed Info

SQL Server Data Tools   16.0.62010.06180
Microsoft SQL Server Data Tools

StopOnFirstBuildError   1.0
StopOnFirstBuildError

Stops a solution build immediately after a project has failed to build.

http://tech.einaregilsson.com/2011/01/06/stop-build-on-first-error-in-visual-studio-2010/

Syntax Visualizer   1.0
An extension for visualizing Roslyn SyntaxTrees.

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript Tools   16.0.21016.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   3.8.0-5.20567.16+53c5d7d3cf13d88978744a32a27c5f8350a8400a
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools   16.8.0-beta.20507.4+da6be68280c89131cdba2045525b80890401defd
Microsoft Visual F# Tools

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions   1.0
View, manage, and diagnose containers within Visual Studio.

Visual Studio Tools for Containers   1.0
Visual Studio Tools for Containers

VisualStudio.DeviceLog   1.0
Information about my package

VisualStudio.Foo   1.0
Information about my package

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

VSColorOutput   2.71
Color output for build and debug windows - https://mike-ward.net/vscoloroutput

WiX Toolset Visual Studio Extension   1.0.0.4
WiX Toolset Visual Studio Extension version 1.0.0.4
Copyright (c) .NET Foundation and contributors. All rights reserved.

Xamarin   16.8.000.255 (d16-8@d002176)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   16.8.0.507 (remotes/origin/d16-8@e87b24884)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   16.8.112 (86385a3)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   11.1.0.17 (d16-8/c0e2b8e)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: be2226b
    Java.Interop: xamarin/java.interop/d16-8@79d9533
    ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000
    SQLite: xamarin/sqlite/3.32.1@1a3276b
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-8@2fb1cbc


Xamarin.iOS and Xamarin.Mac SDK   14.4.1.3 (e30c41de3)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

XamlFormatter   1.0
Formats Xaml the way I want it formatted. Focusing entirely on spacing and leaving the decision of what belongs on what line up to you.

Build Logs

Screenshots

Reproduction Link

Workaround

Capture
build_log.txt
Working - Test.zip
Not Working - TestTestTestTestTest.zip

@CaseAlexander CaseAlexander added s/unverified New report that has yet to be verified t/bug 🐛 labels Nov 29, 2020
@StephaneDelcroix
Copy link
Member

Your buid log doesn't contains errors (Rebuild all: 2 succeeded), so we can't investigate with that.

There is one part of your build chain that doesn't deal well with long windows paths (more than 256char), but I can't tell which one, or if it's the XF tooling responsibility.

in the meantime, a workaround is to use shorter project names, or move it up one directory

@StephaneDelcroix StephaneDelcroix added the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Nov 30, 2020
@Only-Xam
Copy link

Just to add even I noticed same issue highlighted by @CaseAlexander, but in my case project name is just Test. So not quite sure if it is related to long name.
I noticed this issue even with short name and a simple xaml page. Spent time to reproduce but cant find out a pattern. I observed it for UWP only after updating to XF 5.0.01709.pre4 & VS Community Version 16.8.2.

In my case, I Build and run the UWP application for Debug x86, application is launching fine, and then I clicked on some Button in my app to go to the Page (that page name is less than 20 char), and then below exception pop-up. But yes I have few other pages in my project which have names longer than 20 chars, not sure if that is the issue.

If we try to Build and run the UWP application for Debug x86 2-3 times, then all of sudden it starts working fine. So it is intermittent.

System.ExecutionEngineException
HResult=0x80131506
Source=Cannot evaluate the exception source
StackTrace:
Cannot evaluate the exception stack trace

image

@CaseAlexander
Copy link
Author

I do believe you figured it out.

The default install location for projects in VS (on my machine) is 'c:\Users\drjohn\source\repos', not a terribly deep path.

So to test your idea, I created a folder 'd:\test' and created new Xamarin Forms projects in there named "Test" and "TestTestTestTestTest1". Just create new and run, no code edits or package updates. Everything was fine.

Then I copied them both to the default location 'c:\Users\drjohn\source\repos' and the "TestTestTestTestTest1" project threw the exception. Copying them back to 'd:\test' and they worked fine.

So it looks like using the default VS install location for new projects requires relatively short project names for UWP.

Thank you!

@CaseAlexander
Copy link
Author

On a side note, I would say it is an issue with XF since I found that the issue is only present if using XF >= 4.8.0.1269. If I use XF 4.7.0.1351 no issues

@StephaneDelcroix
Copy link
Member

@CaseAlexander if you have a repro, or a log, we will investigate

@CaseAlexander
Copy link
Author

Sure, attached is a zip, just unzip to c:
repos.zip

Using XF 4.8.0.1687

  1. c:\repos\XF4.8.0.1687\works_in_XF_4_8\TestTestTest\TestTestTest.sln <- Works
  2. c:\repos\XF4.8.0.1687\this_is_a_path_which_works_in_XF_4_7\TestTestTest\TestTestTest.sln <- Does Not Work

Using XF 4.7.0.1351
3) c:\repos\XF4.7.0.1351\this_is_a_path_which_works_in_XF_4_7\TestTestTest\TestTestTest.sln <- Works

Just open the solution #2, run the program, and wait a few seconds. The exception will appear.

@MattRames
Copy link

I'm also seeing the same runtime System.ExecutionEngineException with my Xamarin.Forms project. UWP project name is 9 characters long.

"An unhandled exception of type 'System.ExecutionEngineException' occurred in System.Private.CoreLib.dll"

VS: 16.8.2
XF: 4.8.0.1687
UWP Target: Build 17763
UWP Min: Build 16299

If I just keep trying to deploy it eventually works.

@CaseAlexander
Copy link
Author

@MattRames Seems not to be related to the project name length, but the path length of the entire solution.
As suggested, move your project up a few folders so the cumulative path length of the solution is shorter.

@bmacombe
Copy link
Contributor

Might be a dup of #12884

@MattRames
Copy link

@CaseAlexander My solution path length is 53 characters, the working path you posted above is 67 characters.

@Redth Redth removed the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Nov 30, 2020
@PureWeen
Copy link
Contributor

PureWeen commented Dec 9, 2020

@CaseAlexander (and others) can you test this on 16.8.3 ?

I'm on 16.8.3 and I've tried running all the repos in here and they all run for me without any issues

@PureWeen PureWeen added the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Dec 9, 2020
@bmacombe
Copy link
Contributor

bmacombe commented Dec 9, 2020

On 16.8.2 and 16.8.3 I get this error multiple times daily. Not sure it's related to the project name, but for reference.

Here is my longest project name "AS.Mobile.DealerTools.UWP" with path "E:\Ag Spectrum\DealerTools\AS.Mobile.DealerTools\AS.Mobile.DealerTools.UWP"

@MattRames
Copy link

@bmacombe This #12884 (comment) fixed the issue for me.

  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
    .
    .
    .
    <EnableTypeInfoReflection>false</EnableTypeInfoReflection>
  </PropertyGroup>

@bmacombe
Copy link
Contributor

@MattRames Thanks, I missed that one. I've added it and things seem better. I'll report back if I get the problem again.

@CaseAlexander
Copy link
Author

@PureWeen Tested on 16.8.3 and issue persists. Adding 'false' to csproj does fix it however, so that's good!

@ivanv-microsoft
Copy link

My team started having the same issue this week..
Installing Preview version of VS (16.9.0) seems to help.
Using above property (EnableTypeReflection) seems to help too (even though I still get "errors" in output during runtime, but debugging continues unhindered)

@Redth Redth removed the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Jan 21, 2021
@PureWeen
Copy link
Contributor

I'm going to close this issue for now based on @ivanv-microsoft 's comment about 16.9

If this issue persist on 16.9 then we can revisit

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p/UWP s/unverified New report that has yet to be verified t/bug 🐛
Projects
None yet
Development

No branches or pull requests

9 participants