Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

windows store app ( phone 8.1 ) build error :System.Net namespace does not include socket

Discussion in 'Windows' started by joerealism, Aug 27, 2014.

  1. joerealism

    joerealism

    Joined:
    Aug 27, 2014
    Posts:
    5
    - I recently developed windows phone 8.1 games,
    - Development environment:
    1.vs2013 with Update2 (windows phone SDK 8.1)
    2.Unity 4.5.3
    3. publishing platform for windows store (XAML C # solution; SDK Phone8.1)

    - In the project ,i use the Socket in System.Net.Sockets
    - There is no problem when the game is running in unity, but when I click Build to VS project, prompted System.Net namespace definition does not include sockets, the compiler can not pass

    TM截图未命名.png
    I've tried the solution (no effect):

    1 I modified "Platform" for "windows phone 8" compilation was successful, but the problem is an empty Unity project, on the phone is always 100% cpu usage; and replaced "XAML C # solution" compilation, cpu usage can be reduced

    2 I saw vs the System.Net content, which contains a number of other things such as HTTP, not wp8 sdk in the System.Net

    Request your help?
    _______________________________

    Screenshot here
     
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,627
    System.Net classes are not available in WSA/WP8 platforms. WSA compiles scripts using .NET core, so you get the error immediately, while on WP8 you get it at runtime, still, the problem is there.
    We only support WWW class from Unity, for everything else you have to either use WinRT API (WSA only) or write a plugin.
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,491
    As Aurimas said, System.Net is not available on Windows Store Apps.

    However, it is available on WP8.0, hence you're only getting an error when building for WP8.1.
     
  4. joerealism

    joerealism

    Joined:
    Aug 27, 2014
    Posts:
    5
    Thank you for your reply to me so quickly

    - Now I'm confused is this:

    - I had a only a wp8 applications empty scene (Platform: windows phone 8), found it on lumia920 (wp8.1) and lumia1050 (wp8.0) phones, cpu occupancy has been 100%, the phone is very hot, it will soon no electricity

    -My game is the same ,

    - Because my simple Unity demo program will always 100% high CPU usage, I feel helpless

    - My question is: Unity wp game has continuously high CPU usage on the phone, CPU usage 100%

    - If you can help me, really appreciate it.
     
  5. joerealism

    joerealism

    Joined:
    Aug 27, 2014
    Posts:
    5

    Thank you for your reply to me so quickly

    - Now I'm confused is this:

    - I had a only a wp8 applications empty scene (Platform: windows phone 8), found it on lumia920 (wp8.1) and lumia1050 (wp8.0) phones, cpu occupancy has been 100%, the phone is very hot, it will soon no electricity

    -My game is the same ,

    - Because my simple Unity demo program will always 100% high CPU usage, I feel helpless

    - My question is: Unity wp game has continuously high CPU usage on the phone, CPU usage 100%

    - If you can help me, really appreciate it.
     
  6. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,627
    It doesn't sound good. Are you saying you're using an empty scene, that is a game that does nothing at all and you get 100% CPU?
     
    joerealism likes this.
  7. joerealism

    joerealism

    Joined:
    Aug 27, 2014
    Posts:
    5

    Yes,Its my Test;

    Its my steps:
    1. create a new project,create one empty scene and save
    2.switch to "windows phone platform", build vs project
    3.in vs,click run in device; the app is runing
    4.open vs "windows phone dev power tools",start it
    5.now , phone is hot,and cpu usage is 100%

    pls review the Screenshot:


    In addition to say:

    We are a 10 million level mobile game developer (http://game.kaixin001.com/),

    We pay more attention to the WP platform release;

    If you cannot help me to solve this problem, if you can help me contact unity technical support, I hope this problem can get support and follow up on the high priority;

    If the support services required to pay no problem,

    Look forward to your reply

    Joe


     

    Attached Files:

  8. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,627
    Have you tried to profile it using Unity profiler? Clearly this should not happen. Maybe profiler will give some hints on what is causing this.
     
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,491
    Hi,

    does the same thing happen when you run the game with "Master" configuration and without a debugger attached? In your screenshots, you're running it in debug configuration, which is kinda expected that it will eat up the CPU.
     
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,491
    I just tested locally. Deployed to phone using Master configuration, the game with an empty scene uses about 20% CPU.
     
  11. joerealism

    joerealism

    Joined:
    Aug 27, 2014
    Posts:
    5

    Wow, great, try using Master, look problem solved.

    This is I don't know enough about VS

    Much appreciated. Thank you
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,491
    I'm glad you've solved it :).