Results 1 to 7 of 7

Thread: WPF/Visual studio/debugging

  1. #1
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts

    WPF/Visual studio/debugging

    Got an WPF application loading platform(x86/64 at any rate)-agnostic libs. Problem is when targeting Any CPU platform, the autogen vshost debug helper has 32bitreq flag set according to corflags. Now I could script ilasm to unset this, but surely I'm missing something? Visual studio isn't this dumb is it? The runtime exe does not set 32bitreq as I'd fully expect while targeting Any CPU, much as I'd expect the vshost to do the same.

    tl;dr
    Why does visual studio set 32bitreq on vshost helper when targeting Any CPU?
    To err is human. To really foul things up ... you need a computer.

  2. #2
    Registered+
    Join Date
    Apr 2015
    Posts
    24
    Thanks
    0
    Thanked
    1 time in 1 post

    Re: WPF/Visual studio/debugging

    Are you targeting a particular version of .NET? Also, what version of VS? Different versions handle AnyCPU slightly differently - one VB project fell on its arse when ported to VS2013 from 2008 because of changes to the AnyCPU definition between .NET 3.5 and .NET 4+

  3. #3
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: WPF/Visual studio/debugging

    Probably a bit late for this, but I think you are confusing what the vshost is.

    It's not really a 'debug helper' more a restarting the process helper. Starting and stopping processes is expensive, so vhost can help with that. However compared to the compilation cost and such, it's really not worth it, just turn it off.

    All processes have to be either 64 or 32bit. You can not be both in one process. This will be decided at start up for an Any CPU project, which has the corflags set as such.
    throw new ArgumentException (String, String, Exception)

  4. #4
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts

    Re: WPF/Visual studio/debugging

    Debug helper, restarting the process helper, tomato tomato.

    I guess re-reading the question it is less than legible. The question was, why does the vshost executable have 32bitreq on AnyCPU and the artifact binaries do not?
    To err is human. To really foul things up ... you need a computer.

  5. #5
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: WPF/Visual studio/debugging

    Because of how the vhost works is the short answer, it is an un-managed process, so can not be any CPU.

    If this worries you, you can just select in VS csproj area, not to use it. To be honest, I don't normally bother with it, it's an out-dated problem.
    throw new ArgumentException (String, String, Exception)

  6. #6
    Registered User
    Join Date
    Jul 2013
    Posts
    6
    Thanks
    0
    Thanked
    0 times in 0 posts

    Re: WPF/Visual studio/debugging

    That should solve the problem..I guess.

  7. #7
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: WPF/Visual studio/debugging

    The other solution is to make your vhost be the right process version, you can do this from the csproj settings again, but you would probably be better off adding another profile, so you've got Debug and Debug64 etc.

    However, depending on the kind of library you are making, it shouldn't be an issue at all. It only matters when you start doing pinvoke stuff using libraries that are x86/x86 specific.
    throw new ArgumentException (String, String, Exception)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •