title: Exception in thread "main" java.lang.UnsatisfiedLinkError: com.microsoft.tfs.jni.internal.platformmisc.NativePlatformMisc.nativeGetEnvironmentVariable
body: <p>I am getting the below error while connecting to tfs.</p>
  
  <p>Exception in thread "main" java.lang.UnsatisfiedLinkError: com.microsoft.tfs.jni.internal.platformmisc.NativePlatformMisc.nativeGetEnvironmentVariable</p>
  
  <p>code : 
  public class ConnectionToVisualStudio
  {</p>
  
  <pre><code>public static  TFSTeamProjectCollection connectToTFS()
  {
      System.setProperty("com.microsoft.tfs.jni.native.base-directory", "C:\\Users\\userName\\native");
      TFSTeamProjectCollection tpc = null;
      Credentials credentials;
  
      credentials = new UsernamePasswordCredentials("username","password");
      tpc = new TFSTeamProjectCollection(URIUtils.newURI("https://xyz.visualstudio.com/MyFirstProject"), credentials);
      return tpc;
  }
  public static void main(final String[] args)
  {
      TFSTeamProjectCollection tpc;
  
      tpc = ConnectionToVisualStudio.connectToTFS();
      Project project = tpc.getWorkItemClient().getProjects().get("MyFirstProject");
      // Find the work item type matching the specified name.
      WorkItemType bugWorkItemType = project.getWorkItemTypes().get("Bug");
  
      // Create a new work item of the specified type.
      WorkItem newWorkItem = project.getWorkItemClient().newWorkItem(bugWorkItemType);
  
      // Set the title on the work item.
      newWorkItem.setTitle("Example Work Item");
  
      // Add a comment as part of the change
      newWorkItem.getFields().getField(CoreFieldReferenceNames.HISTORY).setValue(
          "&lt;p&gt;Created automatically by a sample&lt;/p&gt;");
  
      // Save the new work item to the server.
      newWorkItem.save();
  
      System.out.println("Work item " + newWorkItem.getID() + " successfully created");
  }
  </code></pre>
  
  <p>}</p>