SubMain - CodeIt.Right The First Time!

/Community

Support Community for SubMain Products
 Home Products Services Download Purchase Support
in Search
 
Home Forums Blogs Tutorials/CIR Tutorials/GD Downloads
Welcome to SubMain Community Sign in | Join | Help

SubMain Blog

Browse by Tags

All Tags » News   (RSS)

  • GhostDoc Pro Beta brings true Visual Editing to XML Comments

    The latest Beta of GhostDoc introduces a new feature that makes XML documentation authoring a breeze – Visual Edition for XML Comments. The number one challenge authoring XML Comments that we heard from our users has been keeping the valid XML which includes encoding HTML formatting tags, code samples, etc. Many of these don’t even...
  • Released: GhostDoc v5.5

    GhostDoc version 5.5 delivers compatibility with VS2017 RTM as well as a number of fixes:

    • VS2017 RTM support
    • GhostDoc is now also available as VSIX for VS2017
    • Documentation Hints no longer visible in the Debug mode
    • Fixed issue wrapping lines within the <value></value> tag
    • In the Offline Activation Preview - the fields are now auto-selected on focus/click for easy copying
    • GhostDoc is no longer adding extra line when re-documenting header in VB
    • GhostDoc is no longer appending generated XML comments to the existing comment when using auto-generated properties in VB

    For the complete list of changes, please see What's New in GhostDoc v5

    For overview of the v5.0 features, visit Overview of GhostDoc v5.0 Features

    Download the new build at http://submain.com/download/ghostdoc/

  • Released: CodeIt.Right v3.0

    The v3.0 of CodeIt.Right v3 is here – the new major version of our automated code review and code quality analysis product. Here are the v3.0 new feature highlights:

    • VS2017 RC integration
    • Official support for VS2015 Update 3 and ASP.NET 5/ASP.NET Core 1.0 solutions
    • Solution filtering by date, source control status and file patterns
    • Summary report view - provides a summary view of the analysis results and metrics, customize to your needs
    • New Review Code commands – review opened files and review checked out files
    • Improved Profile Editor with advanced rule search and filtering
    • Improved look and feel for Violations Report and Editor violation markers
    • Setting to keep the OnDemand and Instant Review profiles in sync
    • New Jenkins integration plugin
    • Batch correction is now turned off by default
    • Most every CodeIt.Right action now can be assigned a keyboard shortcut
    • New rules

    For the complete and detailed list of the v3.0 changes see What's New in CodeIt.Right v3.0


    Solution Filtering

    The solution filtering feature allows to narrow the code review scope to using the following options:

    • Analyze files modified Today/This Week/Last 2 Weeks/This Month – so you can set the relative date once and not have to change the date every day
    • Analyze files modified since specific date
    • Analyze files opened in Visual Studio tabs
    • Analyze files checked out from the source control
    • Analyze only specific files – only include the files that match a list of file patters like *Core*.cs or Modules\*. See this KB post for the file path patterns details and examples.

    cir-v3-solution-filtering

    New Review Code commands

    We have changed the Start Analysis menu to Review Code – still the same feature and the new name is just highlighting the automated code review nature of the product. Also added the following Review Code commands:

    • Analyze Open Files menu - analyze only the files opened in Visual Studio tabs
    • Analyze Checked Out Files menu - analyze only files that that are checked out from the source control

    cir-v3-profile-filterImproved Profile Editor

    The Profile Editor now features

    • Advanced rule filtering by rule id, title, name, severity, scope, target, and programming language
    • Allows to quickly show only active, only inactive or all rules in the profile
    • Shows totals for the profile rules - total, active, and filtered
    • Improved adding rules with multiple categories

     

    Summary Report

    The Summary Report tab provides an overview of the analyzed source code quality, it includes the high level summary of the current analysis information, filters, violation summary, top N violation, solution info and metrics. Additionally it provides detailed list of violations and excludes.

    The report is self-contained – no external dependencies, everything it requires is included within the html file. This makes it very easy to email the report to someone or publish it on the team portal – see example.

    cir-v3-summary-report-part

    The Summary Report is based on an ASP.NET Razor markup within the Summary.cshtml template. This makes it very easy for you to customize it to your needs.

    You will find the summary report API documentation in the help file – CodeIt.Right –> Help & Support –> Help –> Summary Report API.

    cir-v3-summary-source

     

    How do I try it?

    Download the v5.0 at http://submain.com/download/codeit.right/

    Feedback is what keeps us going!

    Let us know what you think of the new version here - http://submain.com/support/feedback/


    Note to the CodeIt.Right v2 users
    : The v2.x license codes won't work with the v3.0. For users with active Software Assurance subscription we have sent out the v3.x license codes. If you have not received or misplaced your new license, you can retrieve it on the My Account page. Users with expired Software Assurance subscription will need to purchase the new version - currently we are not offering upgrade path other than the Software Assurance subscription. For information about the upgrade protection see our Software Assurance and Support - Renewal / Reinstatement Terms

  • Released: GhostDoc v5.4 update

    Version 5.4 of GhostDoc is a maintenance update for the v5.0 users:

    • VS2017 RC integration
    • New menu items - Getting Started Tutorial and Tutorials and Resources
    • (Pro) (Ent) Edit buttons in Options - Solution Ignore List and Options - Spelling Ignore List
    • (Pro) (Ent) Test button in Options - Solution Ignore List
    • (Ent) Now GhostDoc shows error message when Conceptual Content path is invalid in the solution configuration file
    • Fixed PathTooLongException exception when generating preview/build help file for C++ projects
    • (Ent) Updated ClassLibrary1.zip, moved all conceptual content files inside the project in GhostDoc Enterprise\Samples\Conceptual Content\
    • Improved documenting ReadOnly auto-properties in VB
    • Resolved issue re-documenting a type at the top of source code file in VB
    • Resolved issue with generating preview of the <seealso> tag for generics in VB

    For the complete list of changes, please see What's New in GhostDoc v5

    For overview of the v5.0 features, visit Overview of GhostDoc v5.0 Features

    Download the new build at http://submain.com/download/ghostdoc/

  • CodeIt.Right v3.0 Release Candidate

    We have just made available the Release Candidate of CodeIt.Right v3.0, here is the new feature highlights:

    • VS2017 RC integration
    • Solution filtering by date, source control status and file patterns
    • Summary report view (announced as the Dashboard in the Beta preview) - provides a summary view of the analysis results and metrics, customize to your needs

    These features were announced as part of our recent v3 Beta:

    • Official support for VS2015 Update 2 and ASP.NET 5/ASP.NET Core 1.0 solutions
    • New Review Code commands:
      • only opened files
      • only checked out files
      • only files modified after specific date
    • Improved Profile Editor with advanced rule search and filtering
    • Improved look and feel for Violations Report and Editor violation markers
    • New rules
    • Setting to keep the OnDemand and Instant Review profiles in sync
    • New Jenkins integration plugin
    • Batch correction is now turned off by default
    • Most every CodeIt.Right action now can be assigned a keyboard shortcut
    • For the Beta changes and screenshots, please see Overview of CodeIt.Right v3.0 Beta Features

    For the complete and detailed list of the v3.0 changes see What's New in CodeIt.Right v3.0

    To give the v3.0 Release Candidate a try, download it here - http://submain.com/download/codeit.right/beta/


    Solution Filtering

    In addition to the solution filtering by modified since specific date, open and checked out files available in the Beta, we are introducing few more options:

    • Analyze files modified Today/This Week/Last 2 Weeks/This Month – so you can set the relative date once and not have to change the date every day
    • Analyze only specific files – only include the files that match a list of file patters like *Core*.cs or Modules\*. See this KB post for the file path patterns details and examples.

    cir-v3-solution-filtering

    Summary Report

    The Summary Report tab provides an overview of the analyzed source code quality, it includes the high level summary of the current analysis information, filters, violation summary, top N violation, solution info and metrics. Additionally it provides detailed list of violations and excludes.

    The report is self-contained – no external dependencies, everything it requires is included within the html file. This makes it very easy to email the report to someone or publish it on the team portal – see example.

    cir-v3-summary-report-part

    The Summary Report is based on an ASP.NET Razor markup within the Summary.cshtml template. This makes it very easy for you to customize it to your needs.

    You will find the summary report API documentation in the help file – CodeIt.Right –> Help & Support –> Help –> Summary Report API.

    cir-v3-summary-source

     

    Feedback

    We would love to hear your feedback on the new features! Please email it to us at support@submain.com or post in the CodeIt.Right Forum.

  • Survey: What are your biggest code documentation challenges right now?

    We are looking for your input and we're willing to bribe you for answering one very simple question: What are your biggest code documentation challenges right now?

    The survey is super-quick and we're offering a $20 discount code for your time (good with any new SubMain product license purchase) that you will automatically receive once you complete the survey as our thank you.

    Take the Survey

    We'd also appreciate it if you'd help us out by tweeting about this using the link Share on Twitter or otherwise letting folks know we're interested to know their code documentation challenges.

    Thanks for your help!

  • Released: GhostDoc v5.3 update

    Version 5.3 of GhostDoc is a maintenance update for the v5.0 users:

    • Added full support for string interpolation in C# and VB parsers
    • Added support for "arrow functions" in JavaScript parser
    • Fixed "File is not part of a solution" issue when loading projects
    • (Pro) (Ent) Added IsAbstract property to CurrentCodeElement in the T4 templates
    • Improved exception documentation - now the type name in a nameof() parameter is added as part of the generated documentation template
    • (Ent) Fixed iue when using <section> along with <code> elements in an .aml file

    For the complete list of changes, please see What's New in GhostDoc v5

    For overview of the v5.0 features, visit Overview of GhostDoc v5.0 Features

    Download the new build at http://submain.com/download/ghostdoc/

  • Released: GhostDoc v5.2 update

    Version 5.2 of GhostDoc is a minor feature release for the v5.0 users includes:

    • Support for Visual Studio 2015 Update 3
    • Fixes for the latest ASP.NET Core projects
    • GhostDoc now treats underscore as a delimiter to improve summary generation for underscore delimited identifiers
    • "Use Modern URLs" Help Configuration option for declarative help documentation file naming - namespace-classname-membername.htm
    • Option to turn on/off Documentation Hints during setup
    • (Pro) (Ent)Comment Preview is now rendered using the FlatGray theme
    • Plenty of improvements and bug fixes

    For the complete list of changes, please see What's New in GhostDoc v5

    For overview of the v5.0 features, visit Overview of GhostDoc v5.0 Features

    This version is a required update for Visual Studio 2015 Update 3 users.

    Download the new build at http://submain.com/download/ghostdoc/

  • Released: GhostDoc v5.1 update

    Version 5.1 of GhostDoc is a maintenance release for the v5.0 users; includes minor enhancements and number of important bug fixes. Many of the fixes are relevant to the Visual Studio 2015 environment, so while everyone will benefit from this update, it is highly recommended for the Visual Studio 2015 users.

    For the complete list of changes, please see http://support.submain.com/kb/a42/whats-new-in-ghostdoc-v5.aspx

    For overview of the v5.0 features, visit http://submain.com/blog/ReleasedGhostDocV50.aspx

  • Released: GhostDoc v5.0

    Note to GhostDoc Pro v4 users: The v4 licenses won’t work with the v5. We will be sending new license codes shortly to users with License Protection and active Software Assurance subscription. See more information at the bottom of this post.

    Both Pro and Enterprise editions of GhostDoc in version 5 introduce Documentation Quality hints in Visual Studio editor; Documentation Management assistance - find auto-generated comments, edit or remove the bulk created docs; identify and fix comments that are missing, out of sync or can be copied from base class; mark generated XML comments as auto-generated and "to be edited". The v5 also includes multiple Help documentation themes and layouts to choose from.

    The free version of GhostDoc has been re-branded as GhostDoc Community Edition and adds general improvements, limited generation of CHM help documentation as well as the means to find auto-generated comments.

    GD_v5_new_commands

    The new menu commands

    • Documentation Quality Hints in Visual Studio editor
    • Documentation Maintenance - Find auto-generated comments - edit or remove the bulk created docs
    • Documentation Maintenance - Identify and fix comments that are missing, out of sync or can be copied from base class
    • Theme support for generated help documentation and new themes - Flat Gray and Flat Main
    • Official Visual Studio 2015 support
    • Options to add Auto-generated doc and TODO 'Edit' attributes
    • Option to have the default summary text focused and selected when using Document This command - allows to edit/override the summary quickly
    • Exclude from Documentation action – marks a member with a tag to exclude it from the help documentation
    • Hide/Show Comments feature – an easy way to expand/collapse documentation comments to minimize the XML Comments footprint in the Visual Studio code editor
    • New Summary Override table in Options - configure predefined summaries for specific member or type names instead of auto-generated
    • A basic Build Documentation feature is now available in the Community Edition of GhostDoc – while quite limited and watermarked, yet allows to produce simple CHM help documentation for personal use without paying for the commercial version

    For the detailed list of v5.0 changes see What’s New in GhostDoc v5.

    To see new features by product edition see this page - http://submain.com/ghostdoc/editions/


    Documentation Quality Hints

    This new feature provides real-time visual hints in the Visual Studio Editor window to highlight members which have documentation issues that require attention.

    GD_v5_maint_hints

    The following documentation hint actions included with this release make it very easy to maintain the documentation quality:

    GD_v5_maint_hints_list


    Documentation Maintenance

    This feature will help you identify missing documentation, find auto-generated XML comments, maintain your documentation, and keep it up to date. Once these are found, GhostDoc provides the tools to edit or remove the bulk created docs, add missing or fix the dated documentation – one by one or as a batch. You can fine tune the search criteria and use your own template library if yours is different from the built-in.

    • Find auto-generated docs and edit or remove them
    • Find and fix members that are missing documentation
    • Discover members that have parameters, return types, and type parameters out of sync with the existing XML comments and fix the comments
    • Find members that can have XML docs copied from the base class
    • Find documentation that require editing

    GD_v5_maint_autogen

    The Community Edition only allows to find auto-generated documentation and not batch actions – only one action at a time.


    Help Documentation Themes

    In the v5 we are introducing theme support for the generated help documentation and including two new themes, The old help doc view preserved as the Classic theme. You can see the new theme preview here - Flat Gray (default) and Flat Main.

    The Enterprise Edition users can modify the existing themes or create and deploy own help documentation themes – now easier than ever!

    The Community Edition theme selection is limited to one – Classic.

    GD_v5_help_sample


    Auto-generated doc and TODO 'Edit' attributes

    The option to add <autogeneratedoc /> tag to XML comment is intended to provide an explicit flag that the comment has been generated automatically.

    The option to add a TODO comment “TODO Edit XML Comment Template for {member name}” which in turn adds a TODO task into the Visual Studio Task List –> Comments as a reminder for the auto-generated comment requires editing.

    GD_v5_autogen_todo

    Both flags can be used as additional criteria for the documentation quality hints and documentation management “Find auto-generated Documentation” feature. When generating help documentation these flags are also accounted for – the flagged members can be included, ignored or highlighted in the final docs.


    Summary Override

    The Summary Override table allows to configure predefined summaries for specific member or type names to be used instead of the auto-generated. We ship some predefined summary overrides and you are welcome to add your own. If you find a summary override that the GhostDoc user community can benefit of, please submit it to us to be reviewed for the inclusion.

    GD_v5_summary_override

     

    How do I try it?

    Download the v5.0 at http://submain.com/download/ghostdoc/


    Feedback is what keeps us going!

    Let us know what you think of the new version here - http://submain.com/support/feedback/


    Note to the GhostDoc Pro v4 users
    : The v4.x license codes won't work with the v5.0. For users with License Protection and active Software Assurance subscription we will be sending the v5.x license codes shortly. If you need your v5 license sooner, please let us know and we will send one to you. Users without the License Protection or with expired Software Assurance subscription will need to purchase the new version - currently we are not offering upgrade path other than the Software Assurance subscription. For information about the upgrade protection see our Software Assurance and Support - Renewal / Reinstatement Terms

  • You asked, we answered: Asynchronous Programming Demystified webinar Q&A

    If you didn't make it to the webinar, we recommend you watch the webinar recording first - the questions and answers below will make much more sense then.

    At the last month's webinar, "Asynchronous Programming Demystified" Stephen Cleary, Microsoft MVP, and author of "Concurrency in C# Cookbook" introduced the async and await keywords and describes how they work.

    During the webinar, there were a number of great questions asked from viewers that Stephen didn't have sufficient time to answer. In fact, there were 88 total questions. Fortunately, Stephen was kind enough to provide us with his answers below:

    Q: You showed us how to correctly use and call async methods. But how do I create an async API out of nothing?

    A: The low-level type for this is TaskCompletionSource , which allows you to complete a task manually. There are some higher-level wrappers as well, e.g., Task.Factory.FromAsync will take the old Begin/End style asynchronous methods and wrap them into a task.

    Q: Can we use Async inside LINQ methods (with lambda BLOCKED EXPRESSION?

    A: LINQ is inherently synchronous, so there isn't much you can do asynchronously. E.g., you can use Select with an asynchronous delegate, but that gives you a sequence of tasks, and there isn't much you can do with them other than using something like Task.WhenAll. If you want an asynchronous sequence or stream abstraction, a better fit would be Reactive Extensions.

    Need Async Guidance?
    CodeIt.Right includes extensive Async Best Practices rule set that will guide you through the intricacies of Async. Start a no-cost 14-day trial of CodeIt.Right, SubMain's code quality analysis, automated code review and refactoring for Visual Studio.

    Q: What would be the best approach to implement 3rd party synchronous library/API into let's say our existing asynchronous API? Since we does want to maintain asynchronous should we wrap it into Task Run or something else?

    A: Answered in webinar

    Q: Does async await help with AJAX calls?

    A: Async can exist independently on the server and the client. You can use async on the client to help you call AJAX endpoints (i.e., call several of them concurrently). You can also use async on the server to help you implement AJAX endpoints.

    Q: Will try-catch around await keyword really catch all exceptions that can be raised within the called async method?

    A: Yes; an async method will always place its exceptions on the task it returns, and when you await that task, it will re-raise those exceptions, which can be caught by a regular try/catch.

    Q: Is it true that async method is not in fact started until either await, Wait or .Result is called for it?

    A: No. An async method starts when it is called. The await/Wait/Result will just wait for the method to complete.

    Q: We use MSMQ for a lot of our asynchronous WCF processing. It's heavy and expensive. Can async/await replace some if not all of the MSMQ processing?

    A: Async/await is not a direct replacement for any kind of queuing. You can use async to interact with the queue, though. The MessageQueue class unfortunately does not follow a standard asynchronous pattern, but you can use TaskCompletionSource to create await-compatible wrapper methods. The MSDN docs "Interop with Other Asynchronous Patterns and Types" under "Task-based Asynchronous Pattern" should get you started.

    Q: IAsyncResult fits very nicely with Windows low level and IOPorts. Does async/await have the same high performance?

    A: Answered in webinar

    Q: Can you explain when it is appropriate to use ConfigureAwait(false)?

    A: Anytime that the async method does not need its context, it should use ConfigureAwait(false). This is true for most library code.

    Q: Re. Task.Run() blocking a background thread... even using await will block a thread at some point surely?

    A: No, await does not block a thread. I have more details in my blog post "There Is No Thread".

    Q: Do you need to tweak machine/web config to get greater throughput for asynchrony?

    A: Answered in webinar

    Q: What about WhenAll?

    A: WhenAll can be used to concurrently execute multiple asynchronous operations.

    Q: What are the main problems using ContinueWith? There a lot of companies that have this type of implementation because of legacy code.

    A: ContinueWith is problematic for several reasons. For one, a single logical method must be broken up into several delegates, so the code is much more difficult to follow than a regular await. Another problem is that the defaults are not ideal; in particular, the default task scheduler is not TaskScheduler.Default as most developers assume - it is in fact TaskScheduler.Current. This unexpected task scheduler can cause issues like the one I describe in my blog post "StartNew Is Dangerous".

    Q: Why is button1_Click using the async keyword, when it is calling the async method?

    A: Any method that uses the await keyword must be marked async. Normally, I would make the method an "async Task" method, but since this is an event handler, it cannot return a task, so I must make it an "async void" method instead.

    Q: Are there any means to debug async code easily?

    A: VS2013 has pretty good support for debugging asynchronous code, and the tooling is continue to improve in this area. The one drawback to async debugging is that the call stack is not as useful. This is not a problem of async; we developers have gotten used to the idea that the call stack is a trace of how the program got to where it is - but that mental model is incorrect; the call stack is actually telling the program where to go next.I have an AsyncDiagnostics library that preserves "how the program got to where it is", which is sometimes helpful when trying to track down an issue.

    Q: In ASP.NET there are many queues. What will happen when system is overloaded, and we fulfill Async IO ports. Will it throw exception or will act it as it would without async?

    A: When the queues fill up, it will act the same. Async provides better scalability, but not infinite scalability. So you can still have requests timing out in the queues or being rejected if the queues fill up. Note that when the async request starts, it is removed from the queue, so async relieves pressure on the queues.

    Q: Lets say I have an WinForm app. with a method that renders some image that takes 60 secs for example. When the user presses the Begin button, I want to render to occur and later say "Finished" when done, without blocking during the meantime. Can you suggest a strategy?

    A: Answered in webinar

    Q: Is it acceptable to create asynchronous versions of synchronous methods by just calling the synchronous methods with Task.Run

    A: Answered in webinar

    Q: Is it really bad to wrap async code in sync code? I thought that is a very bad practice, but have seen OAuth packages wrapping async code in sync methods with some kind of TaskHelper eg. GetUser is internally using GetUserAsync

    A: The problem with library code is that sometimes you do want both asynchronous and synchronous APIs. But you don't want to duplicate your code base. It is possible to do sync-over-async in some scenarios, but it's dangerous. You have to be sure that your own code is always using ConfigureAwait(false), and you also have to be sure that any code your code calls also uses ConfigureAwait(false). (E.g., as of this writing, HttpClient does on most platforms but not all). If anyone ever forgets a single ConfigureAwait(false), then the sync-over-async code can cause a deadlock.

    Q: If you have large application with lots of different things to do with async how to handle the correct "flow"? So user will not use application in wrong way. Is there best practices for this?

    A: The approach I usually use is to just disable/enable buttons as I want them to be used. There is a more advanced system for UI management called Reactive UI (RxUI), but it has a higher learning curve.

    Async Guidance at your fingertips!
    CodeIt.Right includes extensive Async Best Practices rule set that will guide you through the intricacies of Async. Start a no-cost 14-day trial of CodeIt.Right, SubMain's code quality analysis, automated code review and refactoring for Visual Studio.

    Q: Is await produces managed code in .NET? Can we write unmanaged code within await/ async blocks?

    A: Await does produce managed (and safe) code. I believe unsafe code can be within an async method (though I've never tried it), but await cannot be used within an unsafe code block.

    Q: Any advice with use of DAL (sync with MSSQL) to use with async call? Use Task.Run or rewrite

    A: I'd recommend using the asynchronous support in EF6 to rewrite the DAL as purely asynchronous. But if you are in a situation where you need UI responsiveness and don't want to take the time to make it asynchronous, you can use Task.Run as a temporary workaround.

    Q: But you do want it for CPU bound code on client UIs (WPF, WinForms, Phone, etc.)

    A: Answered in webinar

    Q: When I am awaiting on several tasks, is it better to use WaitAll or WhenAll?

    A: WaitAll can cause deadlock issues if the tasks are asynchronous, just like Result and Wait do. So, I would recommend "await Task.WhenAll(...)" for asynchronous code.

    Q: You say await Task.Run(() => Method() is Ok to do... I'm assuming it's not best practice or just not the way Stephen uses? I guess is it a common or personal practice?

    A: Answered in webinar

    Q: Can you explain the Server Side Scalability benefit a little more?

    A: Answered in webinar

    Q: If there is a use case where i have to call async call from synchronous code, what is the best way to do that?

    A: "There is no good way to do sync-over-async that works in every scenario. There are only hacks, and there are some scenarios where no hack will work. So, for sure, the first and best approach is to make the calling code async; I have a blog post series on "async OOP" that covers ways to make it async even if it doesn't seem possible at first.

    If you absolutely must do sync-over-async, there are a few hacks available. You can block on the async code (e.g., Result); you can execute the async code on a thread pool thread and block on that (e.g., Task.Run(() => ...).Result); or you can do a nested message loop. These approaches are all described in Stephen Toub's blog post "Should I Expose Synchronous Wrappers for My Asynchronous Methods?"

    Q: Would "unit testing" be part of "Async Best Practices"? As in, would you be giving tips on best way to unit test in that future proposed webinar?

    A: Answered in webinar

    Q: What is the appropriate way to unit test an async method?

    A: Answered in webinar

    Q: The benefit : "Responsiveness on the client side" sounds like a background process. I thought async wasn't a background thing...

    A: Answered in webinar

    Q: I've read and heard often that another thread is not created. I'm struggling to understand how I/O is occurring without a thread managing it while the main thread is released. I comprehend how it gets back, i.e. an event of sorts picking up on the stack where it left off.

    A: I have a blog post "There Is No Thread" that explains this in detail.

    Q: When you implementing the IUserStore for the Identity, there are things that require you to implement a Task returning async method, however, I don't see any need to call async method. Task IUserStoreMethod(){ // no async stuff, but it requires a Task , and it cant be changed because it is from the interface. } How should I write the body? Is Task.Run() inside the method body an exception here?

    A: Normally, I/O is asynchronous. So "saving" a user is an inherently I/O-bound operation, and should be asynchronous if possible. If you truly have a synchronous implementation (e.g., saving the user in memory as part of a unit test), then you can implement the asynchronous method by using Task.FromResult.

    Q: Does Await spin a new thread under the hoods?

    A: Answered in webinar

    Q: What is the best way to call Async Methods from class constructors?

    A: Answered in webinar

    Q: Shouldn't the Click event handler be also renamed to ClickAsync?

    A: Answered in webinar

    Q: Is it possible to communicate progress from the async task?

    A: Yes. An asynchronous method can report progress by taking an IProgress parameter and calling its Report method. UI applications commonly use Progress as their implementation of IProgress . There's more information on MSDN under the "Task-based Asynchronous Pattern" topic.

    Q: How would unit/integration test code coverage influence designs and usage of async/await?

    A: Answered in webinar

    Q: So if my UI uses await/async to call a WebAPI method, the method itself has to be async or else it will be blocking correct?

    A: Answered in webinar

    Q: I have a project that interacts with SharePoint 2010 object model, so bound to .NET 3.5. Any caveats when using TPL for 3.5?

    A: .NET 3.5 is before the TPL was introduced (and well before async/await). There is an AsyncBridge project which attempts to back port the TPL and async support, but I haven't ever used it.

    Q: Can I use Async and await inside a sandboxed CRM Dynamics plugin?

    A: I don't know about Dynamics, sorry. But if they have support for .NET 4.5, I don't see why not.

    Q: How can, for example, the DownloadAsync method be canceled in a proper way from another UI action?

    A: Cancellation is done with the CancellationToken/CancellationTokenSource types in .NET. Usually, asynchronous methods just pass the CancellationToken through to whatever APIs they call. For more information, see the MSDN topics "Task-based Asynchronous Pattern" and "Cancellation in Managed Threads".

    Q: How to call an async method from a synchronous method or controller?

    A: Answered in webinar

    Q: Is .NET 4.5.1 the minimum for async / await?

    A: Answered in webinar

    Q: How do we do exception handling inside the DownloadAsync function?

    A: Answered in webinar

    Q: Can you explain how we can perform unit testing using these new keywords?

    A: Answered in webinar

    Q: Is async/await useful for WPF and Windows Form?

    A: Yes, async is useful in any UI scenario.

    Q: For Task Parallel and async/await which one we should use?

    A: The Task Parallel Library is great for CPU-bound code. Async is better for I/O-bound code.

    Q: If you got an normal MVC controller that returns a standard view... If that view contains AJAX code to fetch data from an async (WebAPI) controller, would the calling thread be blocked while the AJAX call is running? We have a situation at work where we cant switch page before the AJAX call is done... which seems a bit weird to me.

    A: Answered in webinar

    Q: When building async controllers/methods, is there some way to tell that the code is actually running asynchronous? How can I tell that the code is non blocking?

    A: Answered in webinar

    Need Async Guidance?
    CodeIt.Right includes extensive Async Best Practices rule set that will guide you through the intricacies of Async. Start a no-cost 14-day trial of CodeIt.Right, SubMain's code quality analysis, automated code review and refactoring for Visual Studio.
  • Webcast: Asynchronous Programming Demystified - Jan 14th

    Featuring Stephen Cleary, Microsoft MVP

      Date: Wednesday, January 14th, 2015
      Time: 10:00 am PST / 1:00 pm EST

    Register Here!

    Asynchronous code using the new async and await keywords seems to be everywhere these days! These keywords are transforming the way programs are written. Yet many developers feel unsure about Async programming.

    Get demystified with Stephen Cleary, as he introduces the new keywords and describes how they work. Stephen is the author of "Concurrency in C# Cookbook" as well as several MSDN articles on asynchronous programming. Together, we'll cover:

    • How the async and await keywords really work
    • How to think about asynchronous code
    • The difference between asynchrony and parallelism
    • Common mistakes when learning asynchronous programming
    • Fixing Async code smells with CodeIt.Right

    If this time isn't convenient for you, register and we will send you the recording afterwards.

    Register Here!

  • Upcoming upgrade protection change for new GhostDoc Pro users

    First, we want to thank all of you for the support and loyalty you have given us over the last few years. We truly have the most amazing and passionate community of developers on the planet, and it makes our job an absolute joy. If you already have a GhostDoc Pro with License Protection, rejoice! The upcoming changes are not going to affect you (and if you were thinking about purchasing additional licenses, now is the time).

    If you don't have GhostDoc Pro, this is your last chance to purchase it with the License Protection and receive free upgrades for the life of the product.

    We are working harder than ever to bring more great features to your favorite plugin. We are super excited about the things we're working on and can't wait to share them with you over the next few months!

    We will be making upgrade protection changes for new GhostDoc Pro users in order to align GhostDoc Pro maintenance and support with all other SubMain's products.

    Starting January 1, 2015, we are retiring the lifetime License Protection option for GhostDoc Pro and replacing it with annual Software Assurance and Support subscription offering.

    If you have been thinking buying new license(s) or adding more licenses, now is the time! Purchase GhostDoc Pro with License Protection by December 31, 2014 and save big on future GhostDoc Pro upgrades!

    Purchase GhostDoc Pro w/ License Protection now!

    What is Software Assurance and Support subscription?

    SubMain customers can purchase 12 months of Software Assurance and Support subscription with the purchase of any new license. Upgrade protection includes access to all major and minor version upgrades for 12 months from the date of purchase at no additional charge.

    Upgrade Protection Timeline 2015

    For example, if a new GhostDoc Pro license is purchased on May 1, 2015, upgrade protection will expire on April 30, 2016. During this time, the customer can download and install any minor version upgrades. In addition, if SubMain issues a major release of GhostDoc Pro during the subscription period, the license can be upgraded to the latest version at no additional charge. With SubMain's Software Assurance, customers will always have access to the latest features and fixes.

    For more information please see Software Assurance and Support - Renewal / Reinstatement

    Again, please note that this new upgrade protection subscription will only affect new license purchases after January 1, 2015. All existing customer licenses with License Protection and those purchased by December 31st, 2014 will be honored and free upgrades will be provided to users with License Protection for the life of the product.

    Thanks again for all of your support. Keep an eye out for more new exciting releases coming very soon!

  • Webcast: Identify and Correct Common Code Smells - Nov 12th

      Featuring Steve Smith, Microsoft Regional Director, Microsoft MVP, ASP Insider 

      Date: Wednesday, November 12th, 2014
      Time: 10:00 am PST / 1:00 pm EST

    Register Here!

    Refactoring is a critical developer skill that helps keep code from collapsing under its own weight. This webinar is based on Pluralsight course "Refactoring Fundamentals" by Steve Smith and covers when and how to refactor code, as well as a wide variety of "code smells" that may indicate some refactoring is warranted.

    Join Steve Smith as he shows some common code issues, and how to identify and refactor them with SubMain's CodeIt.Right code quality tool. In this webcast Steve will cover:

    • What are Code Smells
    • Principle of Least Surprise
    • Rules of Simple Design
    • Explain code smells like, Long Method, Large Class, Primitive Obsession, Data Clumps, Poor Names, Inappropriate Abstraction Level and more
    • Demo using CodeIt.Right to find and resolve code issues

    If this time isn't convenient for you, register and we will send you the recording afterwards.

    Register Here!

  • Released: CodeIt.Right v2.7

    CodeIt.Right v2.7 is a maintenance release that includes:

    • Support for VS2013 Update 3 and newer
    • Improved compatibility with Shared/Universal App projects
    • Exported Violation Report now includes profile name, severity threshold, version of CodeIt.Right and duration of the analysis
    • Exported Violation Report now includes information about Excluded Projects, Files, Rules and Violations
    • Command line version console output shows profile name as well as number of excluded projects, files, rules and violations
    • Other improvements and fixes

    For detailed list please see What's New in CodeIt.Right v2.7

    How do I try it?

    Download v2.7 at http://submain.com/download/codeit.right/

More Posts Next page »
    

This Blog

Syndication

 
     
 
Home |  Products |  Services |  Download |  Purchase |  Support |  Community |  About Us |