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

.NET Framework 4.7 Feedback #393

Closed
richlander opened this issue May 2, 2017 · 27 comments
Closed

.NET Framework 4.7 Feedback #393

richlander opened this issue May 2, 2017 · 27 comments

Comments

@richlander
Copy link
Member

Please share your feedback using the .NET Framework 4.7.

See the release notes for more information: https://github.com/Microsoft/dotnet/blob/master/releases/net47/README.md

@NickCraver
Copy link
Member

The DirectX requirement on server was quite surprising to us, just as an FYI: this will delay or prevent the install at Stack. That ship has sailed, so there's nothing to be done, but I'm providing the feedback in case it's useful.

@weltkante
Copy link

weltkante commented May 3, 2017

The .NET Framework 4.7 now uses DirectX 11 components for WPF.

Does this mean we can now use D3DImage without having to interop with DirectX 9? Or are you still forcing everyone to go through DirectX 9 for backwards compatibility? Any documentation updates or blog posts on that?

Besides the fix for a memory leak on D3DImage I can't find anything on that topic in the release notes.

@richlander
Copy link
Member Author

@weltkante The new DirectX dependency is very targeted so it will not help with that scenario. Will pass on the feedback.

@IlyaGrebnov
Copy link

From release notes: "JIT performance improvements [223169]"
.NET folks could you please expand on what JIT improvements are in 4.7? Interesting to know.

@bbarry
Copy link

bbarry commented May 4, 2017

Can we target this from VS2015 or will it require 2017?

@lstyles
Copy link

lstyles commented May 10, 2017

Windows 10 Creators Update (and therefore I'm assuming NET Framework 4.7) has broken my ASP.NET site running on Sitefinity (somewhat old - 8.0.5710).

Is there any way to downgrade .NET Framework (uninstall 4.7) in Windows 10?

I've tried a lot of things and the site throws an error in Cassini, IIS and IIS Express. I ran out of ideas what could be wrong after a good few days of investigating and decided to spin up a VM without Creators Update. Installed IIS and deployed the site, which was working. I then installed Creators Update and right after the installation launched the site.

Here's what I get:
`Server Error in '/' Application.

An item with the same key has already been added.
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.ArgumentException: An item with the same key has already been added.

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:

[ArgumentException: An item with the same key has already been added.]
System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) +56
System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) +14643456 Telerik.Sitefinity.Configuration.ConfigElementDictionary2.Add(TKey key, TElement element) +194
Telerik.Sitefinity.Security.Configuration.SecurityConfig.LoadDefaults() +2235
Telerik.Sitefinity.Security.Configuration.SecurityConfig.OnPropertiesInitialized() +92
Telerik.Sitefinity.Configuration.ConfigSection.InitializeProperties() +27
Telerik.Sitefinity.Configuration.ConfigElement.EnsurePropertiesInitialized() +122
Telerik.Sitefinity.Configuration.ConfigElement.get_Properties() +21
Telerik.Sitefinity.Configuration.Data.XmlConfigProvider.LoadAttributes(ConfigElement element, XmlReader reader, ConfigPolicyHandler policyHandler, String policyName, UpgradingInfo upgradingInfo, Boolean isNew) +214
Telerik.Sitefinity.Configuration.Data.XmlConfigProvider.LoadElement(ConfigElement element, XmlReader reader, ConfigPolicyHandler policyHandler, String policyName, UpgradingInfo upgradingInfo, Boolean isNew, Boolean validateTagName) +198
Telerik.Sitefinity.Configuration.Data.XmlConfigProvider.LoadSectionFromReader(ConfigSection section, XmlReader reader, ConfigPolicyHandler policyHandler, String policyName, Boolean checkForUpgrade, UpgradingInfo& upgradingInfo) +240
Telerik.Sitefinity.Configuration.Data.XmlConfigProvider.LoadSectionFromFile(ConfigSection section, ConfigPolicyHandler policyHandler, String policyName, Boolean withUpgrade) +134
Telerik.Sitefinity.Configuration.Data.XmlConfigProvider.LoadSection(ConfigSection section, ConfigPolicyHandler policyHandler, String policyName) +72
Telerik.Sitefinity.Configuration.ConfigSection.Initialize(ConfigProvider provider, ConfigPolicyHandler policyHandler, String policyName, Boolean singlePolicy) +301
Telerik.Sitefinity.Configuration.ConfigSection.Initialize(ConfigProvider provider) +28
Telerik.Sitefinity.Configuration.Config.GetSectionInternal(Type sectionType, Boolean safeMode, String sectionName) +168
Telerik.Sitefinity.Configuration.Config.GetSectionPrivate(Type sectionType, Boolean safeMode, String sectionName) +178
Telerik.Sitefinity.Configuration.Config.GetSectionPrivate(Boolean safeMode) +99
Telerik.Sitefinity.Security.SecurityManager..cctor() +369

[TypeInitializationException: The type initializer for 'Telerik.Sitefinity.Security.SecurityManager' threw an exception.]
Telerik.Sitefinity.Security.SecurityManager.GetCurrentUserId() +0
Telerik.Sitefinity.Services.SitefinityContextBase.get_BackendCulture() +152
Telerik.Sitefinity.Localization.Resource.ResolveCulture(CultureInfo culture) +59
Telerik.Sitefinity.Localization.Resource.GetString(ResourceDataProvider provider, String classId, ResourceProperty property, CultureInfo culture, Boolean falback) +81
Telerik.Sitefinity.Modules.ControlTemplates.ControlTemplates.RegisterTemplatableControl(Type controlType, Type dataItemType, String resourceClassId, String areaName, String controlDisplayName) +162
Telerik.Sitefinity.Modules.ControlTemplates.ControlTemplates.RegisterTemplatableControl(Type controlType, Type dataItemType) +110
Telerik.Sitefinity.Services.SystemManager.Initialize() +1234
Telerik.Sitefinity.Abstractions.Bootstrapper.RegisterRoutes() +1027
Telerik.Sitefinity.Abstractions.Bootstrapper.Bootstrap() +593
Telerik.Sitefinity.Web.SitefinityHttpModule.Init(HttpApplication context) +259
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +612
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +421
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +359

[HttpException (0x80004005): The type initializer for 'Telerik.Sitefinity.Security.SecurityManager' threw an exception.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +534
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +117
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +726

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2046.0`

This looks like a config parsing issue but I am out of ideas where to look next and how to pinpoint the exact problem?

@lextm
Copy link
Contributor

lextm commented May 10, 2017

@lstyles It was Telerik Sitefinity who blowed, so you should contact its vendor. I think there is no way to downgrade .NET Framework 4.7 once you upgraded your Windows 10 installation. Telerik should be able to locate the cause and give it a fix.

@lstyles
Copy link

lstyles commented May 10, 2017

@lextm Thanks. I've got a support case open with Telerik. I'm just bit stuck especially that Telerik couldn't have predicted what changes .NET Framework 4.7 will bring when they were writing the version I'm using, 2 years ago.

Does it often happen that new version of .NET breaks existing applications?

@jonoallen
Copy link

jonoallen commented May 24, 2017

I upgraded an existing WPF app to .net 4.7 and whereas before I was able to paste large amounts of text into a WPF textbox, after the upgrade to .net 4.7 once I paste a large text string (2,700+ characters) the entire application pauses. Task Manager doesn't show the process as Not Responding, it just shows a bunch of CPU activity as if the program is just stuck in an infinite loop or something. No other change to the application, just flipping it to .net 4.7 (and removing the ValueTuple nuget package). Run it on .net 4.6? Perfect. Run it on .net 4.7? The app dies and the process must be killed. This is bad.
If I pause the debugger, I see five threads:

  1. PresentationFramework.dll?System.Windows.Controls.Grid.ResolveStartMaxDiscrepancy,
  2. Worker Thread showing < not available > for location
  3. Worker Thread showing < not available > for location
  4. ProtocolHandler.ReadThread at Microsoft.VisualStudio.DesignTools.WpfTap.dll?Microsoft.VisualStudio.Design.Tools.WpfTap.Networking.AnonymousPipe.WaitForCondition
  5. ProtocolHandler.SendThread at Microsoft.VisualStudio.DesignTools.WpfTap.dll?Microsoft.VisualStudio.DesignTools.WpfTap.Networking.ProtocolHandler.SendThread

@aynefd
Copy link

aynefd commented May 30, 2017

@lstyles Did you find out what was causing the error? Was it really the upgrade to 4.7 that caused it? I am experiencing the same issue.

@lstyles
Copy link

lstyles commented May 30, 2017

@aynefd I don't know. Telerik/Progress have released a hotfix to all Sitefinity versions they support, so for me the problem has been resolved. I am not sure what changed in the framework that caused it.

@SamBent
Copy link
Contributor

SamBent commented Jun 1, 2017

@jonoallen I cannot repro your problem - paste a string of length 10,000 into a textbox works instantaneously. Thread 1 Grid.ResolveStarMaxDiscrepancy suggests the problem might be in Grid layout, rather than in textbox. You can probably build a simple repro by extracting your textbox and the Grid(s) surrounding it, together with dummy content for the other cells in the Grid(s). Please share such a repro (file a bug at http://connect.microsoft.com, if necessary).

@935main
Copy link

935main commented Jun 5, 2017

@SamBent Take a look at https://github.com/935main/DotNet47Test and you can re-produce the behavior.

@SamBent
Copy link
Contributor

SamBent commented Jun 8, 2017

@jonoallen Thanks, the problem is definitely in Grid layout (nothing to do with TextBox). Your grid has two rows declared with MinHeight=50, MaxHeight=100. When the first row's MinHeight (plus other rows with fixed or Auto height) already exceeds the available height, the new grid layout algorithm mistakenly tries to re-allocate the second row and gets into an infinite loop.
This will be fixed in .Net 4.7.1. Meanwhile you can set
Switch.System.Windows.Controls.Grid.StarDefinitionsCanExceedAvailableSpace=true
to get the old algorithm. This will avoid the hang, but re-introduce the bugs the new algorithm was intended to fix; this is probably not a problem in your case.

See System.AppContext for details about setting app-context switches.

@chm-tm
Copy link

chm-tm commented Jul 3, 2017

This change for Windows Forms:

Changed the background color of property grid lines to provide an 8:1 contrast ratio for high contrast themes. [225121]

causes a changed/ugly look for some existing applications.

Refer to this SO question for a screenshot.

@richlander
Copy link
Member Author

@lstyles @aynefd We worked with the Telerik folks to get the SiteFinity issue fixes. They made the changes quickly to workaround the issue. We are also releasing a fix for the underlying issue. I'm sorry for the inconvenience.

@richlander
Copy link
Member Author

@bbarry You can target the .NET Framework 4.7 with Visual Studio 2015. Get the developer pack: https://www.microsoft.com/net/targeting

@Tanya-Solyanik
Copy link
Member

@chm-tm, We are reverting header color to InactiveBorder in the default windows theme in the next release of the .Net Framework, which most likely will be included in the Windows 10 Fall Creators Update. The reason this change was introduced, was that the foreground and background colors were not contrasting enough in one of the High Contrast themes, this is why we are reverting to the previously used color only in the default theme.
For your reference, internal work item number, that will be also mentioned in release notes for .Net Framework 4.7.1, is [407249].

@urosjovanovic
Copy link

Hello,

As most of our clients switched to Windows 10 Creators Update it was noticed that our app became slow and sluggish. I'm talking slow response to mouse clicks and scroll, and the thing gets worse when the number of active controls and forms increases. Now, I've tried profiling the app and didn't notice anything unusual, most of the time is spent on drawing text inside WinForm controls and forms.

We've isolated the problem to .NET Framework 4.7 because older Win10 versions started behaving the same way upon installing NET 4.7 via automatic updates. The issues were gone by manually uninstalling the update, but there is no way of doing so (uninstalling net 4.7 manually) in Creators Update.

Our application is quite old and we use WinForms, targeting .NET 4.5.1 atm. I've tried retargeting all modules to .NET 4.7 but the issue remains.

There is a (closed) thread on stack, describing the similar issue.

Anyone having a clue what the heck is going on?
Manually uninstalling updates and reverting back to Anniversary is becoming quite a headache...

@NikolaMilosavljevic
Copy link
Member

@urosjovanovic, can you share some specifics of your WinForms app? Are you using 3rd party controls. Would it be possible to share a sample WinForms project, that exhibits this issue?

@urosjovanovic
Copy link

urosjovanovic commented Jul 21, 2017

@NikolaMilosavljevic
Upon a closer look we've isolated a piece of code that is causing a slowdown. We are using a modified version of Advanced Tree View. The rendering code is modified months ago to something like this:

void OnPaint(...)
{
    // ...
    foreach(var node in nodes)
    {
         // Some checks to see if a node control is outside of screen bounds
         // in order to skip some draw calls
                if (RectangleToScreen(rowRect).Top + y > Screen.FromControl(this).Bounds.Bottom)
                {
                    e.Graphics.ResetTransform();
                    RepaintBorder(e);
                    return;
                }

                DrawRow(e, ref context, row, rowRect);
    }
    // ...
}

The key is this:
Screen.FromControl

If this is removed or moved outside of the loop everything runs smooth.

Luckily, there is only a couple of references to Screen.FromControl in our solution. Since this worked flawlessly on Win10 Anniversary without .NET 4.7, I suppose that the new .NET framework run-time embedded in Win10 Creators Update has to do something with this changed behavior.

The weird thing is that CPU profiling didn't show any significant change in elapsed ticks between .NET 4.6 and .NET 4.7 for this command but the choppy performance is really evident in UI while using the app. This is tested and verified on at least 10 machines in our company.

Just to be clear I am strictly talking about .NET 4.7 run-time, our app is still targeting 4.5.1 but changing it to 4.6 or 4.7 has no effect on this issue.

@NikolaMilosavljevic
Copy link
Member

@urosjovanovic
This is a known issue, that was already fixed. Patches will be released to all affected OS platforms in the coming weeks.

@urosjovanovic
Copy link

@NikolaMilosavljevic
Thank you for the response, that's great news.
Would you be kind to share some additional info or docs on this issue, if there are any publicly available?

@Tanya-Solyanik
Copy link
Member

@urosjovanovic Official patches for Windows 10 creators Update that take care of bug in Screen constructor are available here:
http://www.catalog.update.microsoft.com/Search.aspx?q=KB4032188

@liubiaoyong
Copy link

OS Version = 10.0.14393, SP = 0.0, Platform 2
OS Description = Future OS - x64 Unkonw Edition (ProductType=48)
MSI = 5.0.14393.1198
Windows servicing = 10.0.14393.0
CommandLine = D:\597afc97b0d5de117771\Setup.exe /x86 /x64 /redist
Using Simultaneous Download and Install mechanism
Operation: Installing
Package Name = Microsoft .NET Framework 4.7 Setup
Package Version = 4.7.02053
User Experience Data Collection Policy: Disabled
Number of applicable items: 6
Exe (D:\597afc97b0d5de117771\SetupUtility.exe) succeeded.
Exe Log File: dd_SetupUtility.txt
Exe (D:\597afc97b0d5de117771\SetupUtility.exe) succeeded.
Exe Log File: dd_SetupUtility.txt
Exe (D:\597afc97b0d5de117771\x64-Windows10.0-KB3186568-x64.cab) failed with 0x57 - The parameter is incorrect. .
Final Result: Installation failed with error code: (0x00000057), "The parameter is incorrect. " (Elapsed time: 0 00:02:49).

@richlander
Copy link
Member Author

I am closing this issue now. Please create specific issues for problems you find.

@kcwitt
Copy link

kcwitt commented Jun 20, 2018

Pretty sure that if Microsoft "upgrades" something it just means a couple weeks of development time wasted before downgrading back to the "un-upgraded" version. Too bad we can't harness all the MS development time and awesome MS developer capabilities for more useful work. What terrible stewards of their "leadership" position.

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

No branches or pull requests