Visual Studio 2012 throws an error saying: “Visual Studio encountered an unexpected network error and can’t contact the Microsoft account service” when you try to “Create App Packages…” for the Windows Store.


You have developed a Windows Store app and are in the process of building your app package and uploading it to the Windows Store using Visual Studio 2012. During this process, Visual Studio should bring up a dialog that lets you sign-in with your Windows Live Credentials, however you get an error from Visual Studio 2012 that looks like this:

 

 

 

Note: This problem does not seem to happen with Visual Studio 2012 Express version.

 

One of the reasons you can encounter this issue is if you are trying to deploy your application within a network environment that has a Proxy server which requires Integrated Windows authentication, i.e NTLM/ Negotiate authentication scheme.

 

Before Visual Studio communicates with the Windows Live service to bring up the sign-in page, it performs a check to see if Windows Live URL can be accessed. It is during this check that the above issue happens because the proxy provides an authentication challenge and Visual Studio is unable to authenticate to the proxy thus resulting in the above error.

By default, Visual Studio is not configured to use your logged on credentials for authenticating with the proxy and you need to explicitly allow Visual Studio do this.

The problem should be resolved once you configure Visual Studio to use your default/ logged on users credentials to authenticate with the Proxy.

 

To resolve this issue, perform the following steps:

1.)   Close all open instances of Visual Studio 2012 running on the machine

2.)   Make a copy of the devenv.exe.config file that resides in the Visual Studio installation location. By default, this location is: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE

3.)   From an elevated command prompt open the devenv.exe.config file from the above folder

4.)   Look for the following section towards the end of the file:

    <system.net>

            <settings>

                <ipv6 enabled=”true”/>

            </settings>

    </system.net>

 

5.)   Add the following line inside the <system.net> section of the file and save the file

 

    <defaultProxy useDefaultCredentials=”true” enabled=”true” />

 

6.)   Your final setting should look like this:

    <system.net>

           <defaultProxy useDefaultCredentials=”true” enabled=”true” />

           <settings>

               <ipv6 enabled=”true”/>

           </settings>

    </system.net>

 

7.)   Close and restart any open instances of Visual Studio running on the machine

8.)   Once Visual Studio is restarted it will pick up the new settings from the changed configuration and if you now try to “Create App Packages…”, you should not longer run into the above issue. Visual Studio should now be able to authenticate through the Proxy using Integrated Windows
authentication (i.e. NTLM/Negotiate authentication scheme) and passing in your default/ logged on users credentials.

 

Comments are welcome, both below and on twitter: #WSDevSol. 


Comments (28)

  1. Jayesh says:

    Still got the same problem. Issue has been not solved ..

  2. A few follow up questions…

    1.) Does the dialog box show up with the Express Version of Visual Studio

    2.) Does your network require forward proxy authentication. If so, what type of authentication does it require?

    3.) Have you collected a network trace to check whether a HTTP request is being sent and what the error is? Generally this type of error is thrown due to network connectivity issues. To collect a network trace, you can use Network Monitor: http://www.microsoft.com/…/details.aspx and for analysis you can use a display filter such as tcp.port==80

  3. Rajan says:

    I am still getting the error. Is it something to do with any of the updates? I installed update 3 for VS2012 today

  4. Rafael Yousuf says:

    I have tried this but it didn't work, however you can do this and it will work:

    Apply the fix in this post then "Renew Your Developer licence" and all should work fine.

  5. asdf123 says:

    I did as Rafael and above suggested but still not working. I am able to Renew my developer licence from within visual studio 2013 just fine (login pops up and everything works flawlessly) but trying to create an app package or associate with windows store still throws the same error. I have tried running VS2013 in Admin mode; made no difference. I tried the proxy settings + admin mode, no change. I am not running through a proxy so this shouldn't be the issue to begin with anyways. I am running Windows server 2012 R2 and the only idea that I could come up with is that it might be a vEthernet problem related to hypervisor settings or vEthernet settings caused by the WIndows phone emulator (it automatically creates a switch). I disabled both but still to no avail…

    I used wireshark to monitor the network traffic and it seems as though packets are being sent between VS2013 and the Microsoft server just fine too. I don't know the exact packets needed by VS2013 but it does do an OAuth logout and does seem to request some sorta of login page. Any more ideas to solve this problem would be awesome 🙂

  6. adf123 says:

    follow up to the previous comment. I am using VS2013 Ultimate edition trial.

  7. asdf123 says:

    I found the fix to this problem at connect.microsoft.com/…/visual-studio-express-for-windows-8-could-not-able-to-create-app-packages

    Instead of trying to use the faulty VS2013 studio association and package creation method I uploaded it manually with the above workaround posted. The first field under appxmanifest>packaging should be the 1234developername.appname meantioned in the above guide, the second field (package display name) should the the app's reserved name. Hope this helps someone like it helped me!!!!!!!!

  8. surabhi says:

    same is the issue with me as well …………. plz help!! nothing is workin!!

  9. Casper says:

    In my case (on a new PC with a new user account), this error was caused by a hanging redirect from http to https during the login procedure.

    What you can try: open IE, and go to login.live.com/oauth20_desktop.srf (which is the login that VS tries).

    I got a warning ("first time use of https, this is safe!") which I accepted ("never show this message again").

    After that, VS2013 could connect to the store normally.

  10. mani says:

    While creating app packages my visual studio is restarting what is the pblm how can i overcome it.

    Visual studio im using  is 2013 update 3

  11. Suman Barick says:

    Facing this issue while using VS 2015 Community Edition. Any solution plz?

  12. Abcd says:

    Same problem VS 2015 Community Edition, whats up I paid a developer account fee guys.  

  13. Mike says:

    Seeing this in 2015 Community Version. Was working then all of a sudden stopped. I tried the work around in this blog but it didn't help 🙁

  14. Harsh says:

    I had been using VS2015 community seemlessely but all of a sudden getting this error while creating app package.

  15. Faisal Ishak says:

    That steps didn't worked in VS2015 Community

  16. Timo says:

    Also having this same problem in VS 2013 pro and 2015 Community. Trying to uninstall 2015 Community now and install 2015 update 1 community.

  17. Claudia Wey says:

    Me too. I have been using VS2015 community seamlessly but all of a sudden getting this error while creating app package. Looks like there is a bunch of us that started having the same problem after Jan 27.

    I suspect it was the latest OS upgrade which I just run that cause the issue. Please post here if you find a solution!

  18. Josh says:

    Facing the same issue here (On VS2015 community). I have been creating app packages before without a hitch but all of a sudden today it starts throwing the error above!! Somebody kindly help

  19. hal9k2 says:

    Got that problem today, I also could do create packages in past, today I can't

  20. Vass says:

    Confirming the same issue – until yesterday everything was working perfectly on VS2015 community. Today is not possible to access the store and generate packages. At this point I suspect it is kind of issue with the MS Account service itself and not a local issue.

  21. Ste says:

    Same problem here. We detected the issue today. Last week, when we created the last package, everything was working just fine.

  22. Vixez says:

    Ialso have ths issue on VS2015 Community. It worked fine yesterday but today it fails.

  23. Timo says:

    Now after reinstalling 2015 community I still can't create packages. The error comes right after it tries to load the list of app names on my account. I can however sign into Visual Studio with my account. Seems like we all got the same problem – can someone explain or escalate?

  24. Bostonian says:

    Same problem, started yesterday, 1/27/2016!

  25. javelinadad says:

    Glad we found this. We were about to start looking for things to do to our dev boxes. I suspect it is on the Microsoft Service side. We'll wait for verification that it is up and running properly again.

    Meanwhile, we will just keep polishing. 🙂

  26. Teosd1 says:

    Hey! It seems to be fixed now, at least I was able to create an app package in VS 2015U1 just now. 🙂

  27. javelinadad says:

    Yep, this morning when we got into the office, everything was back to normal. We uploaded a new package update.