Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. One of my own :)

One of my own :)

Scheduled Pinned Locked Moved The Weird and The Wonderful
csharpwcfsysadminannouncementlearning
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    #if (LIBRARYFLAG)
    using Product.Client;
    #else
    using Product.Server;
    #endif
    using Product.Server;

    To explain - we have the same services defined in Client and Server - this is using WCF. For development we set off LibraryFlag so use the services directly - without using WCF (it is faster and makes debugging easier) Of course, if you create a new service, then dont create the client service, and set LIBRARYFLAG, resharper pops up a "Press alt-enter to add the 'using'" message. I musta pressed it - so now it adds the using for the Server version. Ohh it took me a while to spot what was happening!

    ___________________________________________ .\\axxx (That's an 'M')

    L 1 Reply Last reply
    0
    • L Lost User

      #if (LIBRARYFLAG)
      using Product.Client;
      #else
      using Product.Server;
      #endif
      using Product.Server;

      To explain - we have the same services defined in Client and Server - this is using WCF. For development we set off LibraryFlag so use the services directly - without using WCF (it is faster and makes debugging easier) Of course, if you create a new service, then dont create the client service, and set LIBRARYFLAG, resharper pops up a "Press alt-enter to add the 'using'" message. I musta pressed it - so now it adds the using for the Server version. Ohh it took me a while to spot what was happening!

      ___________________________________________ .\\axxx (That's an 'M')

      L Offline
      L Offline
      Lutoslaw
      wrote on last edited by
      #2

      There are more #if #endif-related ReSharper bugs. Here is one of them which I spotted some time ago: I you'd enable generating XML documentation in your project settings, you will get warnings in every place where you didn't make documentation. So far so good. However, once upon a time I wanted to have a different description for debugging and realase builds.

      #if DEBUG
      /// <summary>
      /// Useless and unreliable sh*t, do not use this.
      /// </summary>
      #else
      /// <summary>
      /// This is a very subtle class which performs many difficult and expensive algorithms.
      /// </summary>
      #endif
      public class Damage : Occurance

      C# compiler wasn't complaing, but ReSharper wanted me to add another summary.

      Greetings - Jacek Gajek

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups