Initializing variable using namespace crashes UnityEditor (require alternative)

Hello,

I was in the middle of integrating my Web Service into my Unity Project.
I have coded the Web Service function in a .Net console application beforehand to make sure that the service works as without Unity as a factor.
The Web Service works great and now I’m looking into integrating the Web Service into a Unity application for proof of concept.

The crash happens when I initialized a variable using namespace to avoid ambiguity.

WebService.Auth
WebService.UserMap

Both of the WebService above have a User class inside and I wanted to use the one inside of the WebService.UserMap.

When initialized as WebService.UserMap.User userData;
This causes Unity to crash even though the code editor does not throw an error.

I have also tried

using User = WebService.UserMap

and also

using userMapUser = WebService.UserMap

userMapUser.User userData

I’m using Visual Studio 2017 as my editor.

I’m also looking for alternative if this is not a bug from Unity.

Regards
Thank you

Can you show the exact code that is not working? You’re missing ;'s in many places, this code would not be expected to compile.

Hey Jeff, thank for the quick reply.

My exact code is as below

using System;
using System.Collections;
using System.Collections.Generic;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using WebServiceReference.Authentication;
using WebServiceReference.UserManagement;

public class WSAppAuth : MonoBehaviour {

    public GameObject uiText;
    public static Authentication appAuth;
    string token;
    bool initialized;
    bool LMSConnect;
    WebServiceReference.UserManagement.User userData;

    void Awake() {
    }

    void Start() {
    }

    void Update() {
    }
}

Both WebServiceReference.Authentication and WebServiceReference.UserManagement is a proxy class of my system Web Service.

I know there is a lot of using directives. Those will be used in functions not yet defined.

The code is attached to an empty gameobject.
Line 20 in particular causes Unity to freeze and crash

When restarted, Unity stays as a background process with increasing memory usage.
The first time I restarted Unity after a crash results in BlueScreen error.

Thank you in advance.

And this same code is working in a standalone VS client?