Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run WPF applications after upgrade #9620

Closed
tanveerbadar opened this issue Aug 22, 2024 · 4 comments
Closed

Unable to run WPF applications after upgrade #9620

tanveerbadar opened this issue Aug 22, 2024 · 4 comments

Comments

@tanveerbadar
Copy link

Description

I upgraded Visual Studio 2022 to latest preview yesterday, version given below and even simple WPF applications which are looking up resources are failing with weird exceptions.

Reproduction Steps

Create a new WPF application.

Replace Window content with the xaml below

<Grid>
    <Grid.Resources>
        <Style TargetType="Button">
            <Setter Property="Background" Value="Blue" />
        </Style>
    </Grid.Resources>
    <Button Content="Hello" HorizontalAlignment="Center" VerticalAlignment="Center" />
</Grid>

Expected behavior

Application should run just fine.

Actual behavior

Application fails to start and exceptions are thrown at initialization.

System.Windows.Markup.XamlParseException
HResult=0x80131501
Message='Initialization of 'System.Windows.Controls.Button' threw an exception.' Line number '15' and line position '62'.
Source=PresentationFramework
StackTrace:
at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at WpfApp1.MainWindow.InitializeComponent() in WpfApp1\MainWindow.xaml:line 1

This exception was originally thrown at this call stack:
[External Code]

Inner Exception 1:
IndexOutOfRangeException: Index was outside the bounds of the array.

Regression?

This and similar were working just fine till yesterday.

Known Workarounds

No response

Impact

This is a high impact bug in the latest build and I am unable to perform my work.

Configuration

dotnet runtime/sdk
dotnet --info
.NET SDK:
Version: 9.0.100-preview.7.24407.12
Commit: d672b8a045
Workload version: 9.0.100-manifests.baed1e37
MSBuild version: 17.12.0-preview-24374-02+48e81c6f1

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.100-preview.7.24407.12\

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
There are no installed workloads to display.

Host:
Version: 9.0.0-preview.7.24405.7
Architecture: x64
Commit: static

.NET SDKs installed:
8.0.401 [C:\Program Files\dotnet\sdk]
9.0.100-preview.7.24407.12 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0-preview.7.24406.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0-preview.7.24405.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0-preview.7.24405.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Visual Studio
Microsoft Visual Studio Community 2022
Version 17.12.0 Preview 1.0
VisualStudio.17.Preview/17.12.0-pre.1.0+35209.166
Microsoft .NET Framework
Version 4.8.09032

Installed Version: Community

Visual C++ 2022 00482-90000-00000-AA607
Microsoft Visual C++ 2022

ASP.NET and Web Tools 17.12.44.63961
ASP.NET and Web Tools

AvaloniaPackage Extension 1.0
AvaloniaPackage Visual Studio Extension Detailed Info

Azure App Service Tools v3.0.0 17.12.44.63961
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 17.12.44.63961
Azure Functions and Web Jobs Tools

C# Tools 4.12.0-1.24379.11+cf82d399c36008e7936d545cde24141f8d3790fa
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

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

Conveyor by Keyoti 1.0
Allows you to access your web applications from other machines, even if hosted on the development web server.

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

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

Razor (ASP.NET Core) 17.12.1.2440703+f9c15e44b580d08bbf4b055f4adb3d2452ffb43f
Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools 17.11.38.0
Microsoft SQL Server Data Tools

TypeScript Tools 17.0.30801.2002
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 4.12.0-1.24379.11+cf82d399c36008e7936d545cde24141f8d3790fa
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 17.12.0-beta.24379.4+f5111c682d109467ec60c3b04b59b8859c01e55e
Microsoft Visual F# Tools

Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.

Other information

No response

@singhashish-wpf
Copy link
Member

Looks like this is a duplicate of #9582

@tanveerbadar
Copy link
Author

It is a duplicate, agreed.

@lindexi
Copy link
Contributor

lindexi commented Aug 22, 2024

@tanveerbadar Close this issues?

@tanveerbadar
Copy link
Author

Yes please go ahead.

For myself, I reverted VS to 17.10 and added a global.json fixing to v8 SDK.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants