"You have mixed Tabs and Spaces. Fix this? WPF Project with VS2015

Having returned to WPF, and downloading/installing Dev Express trial, I’m getting this message each time I start editing the XAML. If left uncorrected, the project enters break mode on running - even with an “empty project”

Any ideas - is it Dev Express? I remember some issues with an earlier release of Oxygene.

Thanks.

I don’t recall EVER seeing this message. Can you show me some of your XAML?

What version of Elements? VS? Developer Express?

Hi Alan. Thanks for reply. This has started recently, so may relate to installing Dev Express – I just downloaded and installed their trial.

Steps to replicate:

Start new WPF project in VS2015

Click on any text in Windows1.xaml as if to start editing

Message is then displayed. I usually click on Tabify, and all is well. A new file created (e.g. by adding a new window) shows the same problem

Details of environment:

Microsoft Visual Studio Community 2015

Version 14.0.25431.01 Update 3

Microsoft .NET Framework

Version 4.7.02556

Installed Version: Community

Visual Basic 2015 00322-20000-00000-AA309

Microsoft Visual Basic 2015

Visual C# 2015 00322-20000-00000-AA309

Microsoft Visual C# 2015

Visual C++ 2015 00322-20000-00000-AA309

Microsoft Visual C++ 2015

Application Insights Tools for Visual Studio Package 7.0.20622.1

Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 14.1.30801.0

ASP.NET and Web Tools 2015.1

ASP.NET Web Frameworks and Tools 2012.2 4.1.41102.0

For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013 5.2.40314.0

For additional information, visit http://www.asp.net/

Azure App Service Tools v2.8.1 14.0.11123.0

Azure App Service Tools v2.8.1

BusinessObjectEditor 1.0

Information about my package

Common Azure Tools 1.8

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

ConvertToDevExtremeCommand Extension 1.0

ConvertToDevExtremeCommand Visual Studio Extension Detailed Info

DevExpress.DeploymentTool 1.0

A useful tool for deploying DevExpress assemblies.

DevExpress.ExpressApp.Design.DynamicPackage 1.0

DevExpress VSIX Package

DevExpress.ExpressApp.DesignPackage 1.0

DevExpress VSIX Package

DevExpress.Win.LayoutAssistant Extension 1.0

DevExpress.Win.LayoutAssistant Visual Studio Extension Detailed Info

DevExtreme.Design 17.2.7

DevExtreme Visual Studio integration package

JavaScript Language Service 2.0

JavaScript Language Service

JavaScript Project System 2.0

JavaScript Project System

Microsoft .NET Core Tools (Preview 2) 14.1.30801.0

Microsoft .NET Core Tools (Preview 2)

Microsoft Azure Mobile Services Tools 1.4

Microsoft Azure Mobile Services Tools

NuGet Package Manager 3.5.0

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

PreEmptive Analytics Visualizer 1.2

Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

RemObjects Elements 10.0.0.2253

RemObjects Elements (Oxygene, C# and Silver) for .NET, Cocoa, Java and Island.

Copyright 2003-2018 RemObjects Software, LLC. All rights reserved.

http://www.remobjects.com/elements

RemObjects Elements leverages the LLVM compiler backend:

Copyright © 2003-2018 University of Illinois at Urbana-Champaign. All rights reserved.

http://llvm.org

RemObjects Everwood 4.7.0.761

RemObjects Everwood

Copyright RemObjects Software, LLC 2002-2017. All Rights Reserved.

http://www.remobjects.com/everwood

SQL Server Data Tools 14.0.60519.0

Microsoft SQL Server Data Tools

SQLite & SQL Server Compact Toolbox 4.7

SQLite & SQL Server Compact Toolbox adds scripting, import, export, rename, query execution and much more to SQL Server Compact & SQLite Data Connections.

TypeScript 1.8.36.0

TypeScript tools for Visual Studio

XtraReports package 1.0

XtraReports package

Regards

Bob Russell

Does this look similar/familiar.

Hi Alan. Brilliant. Well spotted. It was Productivity Tools. Looks ok after switching off that setting.

Many thanks.

Bob

That said, we should still figure out whats creating the badly tabbed code. Is the file mixed already when you create it? does the designer added wring spaces or tabs when you add controls? or does manual editing of the XAML cause this?

Ideally, we should find the root cause, as mixed tab/spaces is one of my pet peeves (which is why Fire/Water will always for to fully have one or the other, preserving what best matched the original (ie a spaced C#/Swift/Java/Xaml file will keep spaces [and a subtle “(spaces)” hint and menu items to let you fix it], but a mixed file would be cleaned to all tabs on save. And Oxygene files will always use spaces because, Ugh! ;).

Fire/Water also always keeps clean line endings and EOFs :wink:

Unfortunately, VS is it’s own worst enemy and doesn’t let us handle all this stuff as nicely :(. In fact, it can’t even remember Tabs vs Spaces settings for C# for longer than 3 days, most times :(.

Hi Marc. To provide you with more information, I decided to switch the Productivity Power Tools setting “Fix Mixed Tabs” back on. However, when I did that, then created a new blank WPF project, the “You have mixed Tabs and Spaces…” message did NOT re-appear. Strange. I’ll keep an eye on it, investigate if it re-appears, then let you know the circumstances.

I looked at the source files with Notepad++ and saw that the *.pas file lines ended in CR|LF and the *.XAML file lines ended in LF. Is that as expected?

Bob

Thanx!

Expected enough, at least yes. VS doesn’t;'t keep these consistent. But as long as they are all the same within the file, they should be good. I’ll see what we can do in terms of pre-processiong the templates, on our side, to make sure they end cup more consistently in VS…