Jetbrains's dottrace should have profiling support for async/await.
But I cannot get it to show me the expected results (I have no "await" and "continuation" nodes in the timelineviewer call stack).
I tried profiling with the following program types:
.NET framework (4.7) console program,
.NET framework (4.7) windows program,
.NET core (>2.2) console,
.NET core (>2.2)windows program,
.NET core (3.0) wpf
Is this only not working for me ? Because I cannot find anything on the internet
or is this officially currently not working anymore ?
My only reference to possible explaination is for console applications:
https://youtrack.jetbrains.com/issue/DTRC-26464
Something about :
AsyncCausalityTracer.LoggingOn being false and some ETW provider.
But for me this is not working, for all type of applications
My current version of jetbrains software is :
Resharper Ultimate 2019.2.3 (dottrace 2019.2)
--- EDIT 2019/11/01:
When clicking on events I get (I would expect also TPL events ???):
--- EDIT 2019/11/06:
As a result of a comment in answer from Konkat info link, I also tried :
.NET core 2.0 console application
=> dottrace async support also does not work
Is the "Collect TPL events" option enabled in your configuration?
Related
I've recently started using .Net 5 on Mac, and I've discovered that Console.Beep throws an 'unsupported operation' exception.
Do the standard libraries provide a working way to make sounds for Mac? I do not believe they did in .Net Core, as per: How to play a sound in NETCore?
TLDR: From further research, I believe the answer is NO.
I discovered the System.Media.SoundPlayer class (which is in .Net 5.0), but I got a compile error System.Media belonged to missing assembly System.Windows.Extensions.
I found and installed this via Nuget: https://www.nuget.org/packages/System.Windows.Extensions/
My application now compiled but upon trying to call SoundPlayer.Play() I got PlatformNotSupportedException -
"System.Windows.Extensions types are not supported on this platform."
I can't see in the documentation anywhere if .Net 6.0 will change this though.
I'm trying to rewrite IL code dynamically at runtime. While this is quite well documented for .NET framework applications by using the Profiling API I can't find anything similar for UWP applications.
Because I have a suite of automated function tests, I need to setup the profiling environment and start a sample app programmatically.
Attempt 1
This question explains how to enable a debugger (as far as I understand a profiler is essentially a debugger) and programmatically start a UWP app.
So from my bootstrapper I call IPackageDebugSettings::EnableDebugging followed by IApplicationActivationManager::ActivateApplication.
Anyway I can't figure out how to implement the debugger. The debugger (which is an executable) is called with the following arguments:
-p 3836 -tid 6180
Both numbers change on every run. While p seems to be the process id of the debugged process, I have no idea what tid could be or how I have to use the arguments to control the debugged app (register for module load events, trigger rejits etc.).
Attempt 2
I found this issue on the Core CLR repo which is about enabling the Profiling API for Core CLR apps. The issue contains a link to a sample profiler repo.
So profiling for Core CLR apps seems to basically work the same way as it does in .NET framework apps (with some restrictions). From my bootstrapper I tried to set the appropriate environment variables (i.e. CORECLR_ENABLE_PROFILING, CORECLR_PROFILER and CORECLR_PROFILER_PATH) followed by IApplicationActivationManager::ActivateApplication.
However the profiler doesn't attach.
I'm quite sure that in general it is possible to profile UWP applications because JetBrains' dotTrace can do it.
Any ideas?
I'm trying to debug some CPU issues caused by a .NET 4.6 MVC5 application by analyzing a dump created by DebugDiag 2.1.0.7. I'm finding even after loading custom .pdb symbols I'm still not getting stacktrack information in the generated report:
The error that the report displays is
Type: Microsoft.Diagnostics.Runtime.ClrDiagnosticsException
Message: This runtime is not initialized and contains no data.
I note that DebugDiag version 1.2 didn't support .NET 4.0+. Could DebugDiag 2.1 perhaps not support .NET 4.6?
My CPU issues came down to a third-party piece of software that I was initialising in the wrong place. It needed to be initialised in Application_Start() and instead I was doing it in Application_BeginRequest(). Whoops! If you're experiencing this, and are scrambling around trying to debug issues in your production app like I was, make sure you check out the Global.asax for anything like this.
I'm guessing that the StackTrace issues with DebugDiag were related to where in the application lifecycle that the code causing the CPU problem was occurring.
I've currently built a service layer and API which I'm consuming from an ASP.NET website, Windows Phone app, and a Windows 8 metro app - the key to all of them being a project containing model classes which is a portable class library project, and is shared as a reference between all of them. This architecture works fine and without any issues.
However, I've recently started experimenting with Xamarin - specifically the iOS functionality (with a view to moving onto Android later). My initial assumption was that I would be able to utilise this model library as I do with the other projects - however, I've since realised this this isn't the case.
When I first added a reference to my model class library to my Xamarin.iOS project (in Visual Studio), I was greeted by the error:
'The current project does not support references to Portable Library projects'.
Strange - as I thought this would be a scenario that would be supported. I found a post here which suggested a fix that forced Visual Studio to detec the Monotouch (Xamarin) framework as supporting Portable Library Projects. Seemed to be exactly what I needed - but no. When I added the reference again, I was greeted by a different error:
'The current project's target framework is not compatible with that of the Portable Library project'.
And it suggests I change the target framework in the project properties. Except I can't, as the Xamarin iOS project needs to support Monotouch (and I can't change it to anything else from the GUI anyway). So I tried to change the model library's properties instead - maybe I can do something there. And it looked like I could. I can check Monotouch (Xamarin) as a supported platform here (where Windows phone, Windows store, etc are already checked), but it won't let me save. It just shows the message:
'There is no additional functionality that is supported by the target frameworks you have selected'
After some research, I discovered that the only way Xamarin suggest to share code is to use separate projects with linked code files (so in effect, a pseudo-single code base. Which I have tried and works - but it seems a hack. See here:
http://docs.xamarin.com/guides/cross-platform/application_fundamentals/building_cross_platform_applications/sharing_code_options
So is this the only option? Or is there any way to have a true single class (model) library across all platforms, including Microsoft and Xamarin?
It is currently possible to use Portable Library Projects - e.g. profile 104 - across all of .Net4.5, WP, WinRT, Xamarin.Android and Xamarin.iOS
It is also currently possible to use the output binary assemblies across .Net4.5, WP, WinRT and Xamarin.Android - but not current against Xamarin.iOS.
This situation is changing 'very soon' now with Xamarin adopting full PCL support - see http://slodge.blogspot.co.uk/2013/02/the-future-is-portable.html and listen to http://hanselminutes.com/362/ios-and-android-apps-with-xamarin-studio-20-and-miguel-de-icaza
I personally deliver MvvmCross (and a lot of apps that use MvvmCross) using PCLs - and have done for the last 6 months - but there is some setup pain involved in this currently. For some info see my blog:
http://slodge.blogspot.co.uk/2012/12/cross-platform-winrt-monodroid.html
http://slodge.blogspot.co.uk/2013/03/xamarinios-with-mvvmcross-in-vs2012.html
I do hope to provide an update on this in the very near future - it should work 'out of the box' soon.
The future is bright on Xamarin side, as it is going to support .NET 4.5 profile on all its platforms,
http://blog.xamarin.com/brave-new-async-mobile-world/
The only problem as far as I can see comes from Microsoft side, who refuses to unify its own platforms to a common profile (Windows 8 and Windows Phone 8 are still messy tailored versions no better than CF or Silverlight in my own situation).
Portable class libraries are out there, but as a library author (#SNMP) I rather build separate project files for my own projects as Xamarin suggests.
I am new to windows 7 phonegap. i want to store and retrieve data using native application.I don't know how to store and display the retrieved data from native to phonegap(HTML)page.
Doesn't that mean that phonegap supports web sql database support on
all platforms(WP7 in specific). Are there any plugins to support
sqllite on WP7 for phonegap?
console.log js script output is not visible in visual studio 2010
output window. should i use alternative api's for WP7?
How can i debug visual studio 2010 output window?
Thanks in advance.
Ok, Im late with my answer, but I have an answer to the question:
PhoneGap supports Sqlite, no question. But Windows Phone doesn't Support Sqlite, so that Phonegap exclude the "Web SQL Storage" Interface for Windows platforms (see supported platforms in Phonegap API documentation online).
There is a Little bit uncommon way to reach the Goal. You can use a sqlite implementation from codeplex to Support sqlite with your Windows mobiles:
http://sqlitewindowsphone.codeplex.com/releases
I did'nt tested with Phonegap, so I cant't give a guarantee of that, but it looks fine for me.
Have a look at this:
Phonegap Storage (provides access to the devices storage options)
To see console.log messages in visual studio's output window:
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript">
document.addEventListener("deviceready",onDeviceReady,false);
// called when device ready event fires
function onDeviceReady()
{
console.log("You should see this message in Visual Studio's output window.");
}
</script>
As answered by Timo Rehl, you can use an sqlite implementation from codeplex to implement the sqlite component and then create a PhoneGap plugin on top of it.
As a matter of fact, I've developed such a plugin (for cordova 3) that enables you to use Web SQL Database on Windows Phone (7 and 8) as if it was natively implemented : https://github.com/Smile-SA/cordova-plugin-websqldatabase.
A prototype using this plugin is available at https://github.com/Smile-SA/cordova-plugin-websqldatabase-proto.
This plugin uses a forked version (to solve some bugs) of the sqlite implementation from codeplex. The fork is available in the same github repository.