升级到Visual Studio 2015后无法进入.NET Framework源代码

时间:2015-09-25 23:09:46

标签: .net visual-studio-2015 debug-symbols

升级到Visual Studio 2015后,我无法再进入几个.NET Framework程序集的代码。

根据http://referencesource.microsoft.com/setup.html

的说明设置了所有内容

我可以进入一些程序集,例如System.Xml.dll和System.Xml.Linq.dll,但是我无法进入其他程序,例如mscorlib.dll。

为了弄清楚发生了什么,我使用.NET Framework的不同版本(4.5.1,4.5.2,4.6)创建了一些测试项目但没有成功。

例如。给出以下代码:

import java.net.*;
import java.util.ArrayList;
import java.io.*;

public class TestServer extends Thread {
    private Socket clientSocket;
    protected static String inputLine;
    public static ArrayList < Socket > ConnectionArray = new ArrayList < Socket > ();
    public static ArrayList < String > CurrentUsers = new ArrayList < String > ();
    String Sender;
    String Receiver;

    final static int PORT = 256;


    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = null;

        try {
            serverSocket = new ServerSocket(PORT);
            System.out.println("Connection Socket Created");
            try {
                while (true) {
                    System.out.println("Waiting for Connection");
                    Socket sock = serverSocket.accept();
                    ConnectionArray.add(sock);
                    System.out.println("Client connected from: " + sock.getLocalAddress().getHostName());
                    new TestServer(sock);
                }
            } catch (IOException e) {
                System.err.println("Accept failed.");
                System.exit(1);
            }
        } catch (IOException e) {
            System.err.println("Could not listen on port: " + PORT);
            System.exit(1);
        } finally {
            try {
                serverSocket.close();
            } catch (IOException e) {
                System.err.println("Could not close port: 10008.");
                System.exit(1);
            }
        }
    }

    private TestServer(Socket inSock) {
        clientSocket = inSock;
        start();
    }

    public void run() {
        System.out.println("New Communication Thread Started");
        //System.out.println ("Client connected from: " + sock.getLocalAddress().getHostName());

        try {
            PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
            BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));

            while (true) {

                for (int i = 1; i <= TestServer.ConnectionArray.size(); i++) {
                    Socket TEMP_SOCK = (Socket) TestServer.ConnectionArray.get(i - 1);
                    if (clientSocket == TEMP_SOCK)
                        try {
                            Sender = TestServer.CurrentUsers.get(i - 1);
                        } catch (Exception e) {}

                }
                inputLine = in .readLine();
                System.out.println("Server: " + inputLine);
                getCommand(inputLine);

                if (inputLine.equals("EXIT"))
                    break;
            }
            out.close(); in .close();
            clientSocket.close();
        } catch (IOException e) {
            System.err.println("Problem with Communication Server");
            System.exit(1);
        }
    }

    public void addUsername(String inputName) throws IOException {
        CurrentUsers.add(inputName);

        for (int i = 1; i <= TestServer.ConnectionArray.size(); i++) {
            Socket TEMP_SOCK = (Socket) TestServer.ConnectionArray.get(i - 1);
            PrintWriter OUT = new PrintWriter(TEMP_SOCK.getOutputStream());
            OUT.println("Current Users: " + CurrentUsers);
            OUT.flush();
        }
    }

    public void sendToAll(String input) throws IOException {

        for (int i = 1; i <= TestServer.ConnectionArray.size(); i++) {
            Socket TEMP_SOCK = (Socket) TestServer.ConnectionArray.get(i - 1);
            if (clientSocket != TEMP_SOCK) {
                PrintWriter TEMP_OUT = new PrintWriter(TEMP_SOCK.getOutputStream(), true);
                TEMP_OUT.println(Sender + ": " + input);
                TEMP_OUT.flush();
                System.out.println("Sending to: " + TEMP_SOCK.getLocalAddress().getHostName());
            }
        }

    }

    public void sendPrivate(String inputName, String inputMsg) throws IOException {
        Socket TEMP_SOCK = null;
        for (int a = 1; a <= TestServer.CurrentUsers.size(); a++) {
            String Receiver = TestServer.CurrentUsers.get(a - 1);
            if (inputName == (Receiver)); {
                System.out.println("Found username!!!");
                TEMP_SOCK = (Socket) TestServer.ConnectionArray.get(a - 1);
            }
        }
        PrintWriter TEMP_OUT = new PrintWriter(TEMP_SOCK.getOutputStream());
        TEMP_OUT.println("[PM] " + Sender + " :" + inputMsg);
        TEMP_OUT.flush();
    }

    public void getCommand(String inputCmd) throws IOException {
        String str = inputCmd;
        String[] splitStr = str.trim().split("\\s+");

        if (splitStr[0].equalsIgnoreCase("REG")) {
            System.out.println("Registering");
            StringBuffer result = new StringBuffer();
            for (int y = 1; y < splitStr.length; y++) {
                result.append(splitStr[y]);
                result.append(" ");
            }
            String joinedStr = result.toString();
            System.out.println("Registering Name ---> " + joinedStr);
            addUsername(joinedStr);
        } else if (splitStr[0].equalsIgnoreCase("MSG")) // SEND TO ALL
        {
            System.out.println("Sending to ALL");
            StringBuffer result = new StringBuffer();
            for (int y = 1; y < splitStr.length; y++) {
                result.append(splitStr[y]);
                result.append(" ");
            }
            String joinedStr = result.toString();
            System.out.println("Sending---> " + joinedStr);
            sendToAll(joinedStr);
        } else if (splitStr[0].equalsIgnoreCase("PMSG")) // SEND PRIVATE
        {
            System.out.println("Sending Private Message");
            StringBuffer result = new StringBuffer();
            for (int y = 2; y < splitStr.length; y++) {
                result.append(splitStr[y]);
                result.append(" ");
            }
            String joinedStr = result.toString();
            System.out.println("Sending---> " + joinedStr);
            String pvtMsg = splitStr[1];
            sendPrivate(pvtMsg, joinedStr);
        } else if (splitStr[0].equalsIgnoreCase("EXIT")) {
            Socket TEMP_SOCK = clientSocket;
            PrintWriter TEMP_OUT = new PrintWriter(TEMP_SOCK.getOutputStream(), true);
            TEMP_OUT.println("Bye bye");
            TEMP_OUT.flush();
        } else {
            Socket TEMP_SOCK = clientSocket;
            PrintWriter OUT = new PrintWriter(TEMP_SOCK.getOutputStream());
            OUT.println("Invalid Input");
            OUT.flush();
        }
    }

}

在三个不同的控制台项目中实现 - 每个版本的.NET Framework一个,我无法进入String或Console,当我查看mscorlib的符号加载信息时,我得到:

.NET 4.5.1

using System;

namespace ConsoleApplication_451
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(new string('a', 50));
            Console.Read();
        }
    }
}

.NET 4.5.2

C:\Users\alfred.myers\Documents\Visual Studio 2015\Projects\ConsoleApplication46\ConsoleApplication46\bin\Debug\mscorlib.pdb: Cannot find or open the PDB file.
C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.pdb: Cannot find or open the PDB file.
C:\Windows\mscorlib.pdb: Cannot find or open the PDB file.
C:\Windows\symbols\dll\mscorlib.pdb: Cannot find or open the PDB file.
C:\Windows\dll\mscorlib.pdb: Cannot find or open the PDB file.
C:\SymbolCache\mscorlib.pdb\bad2b04f3cb34c248fbd3f1e9dcf60202\mscorlib.pdb: Cannot find or open the PDB file.
C:\SymbolCache\MicrosoftPublicSymbols\mscorlib.pdb\bad2b04f3cb34c248fbd3f1e9dcf60202\mscorlib.pdb: Cannot find or open the PDB file.
SYMSRV:  C:\SymbolCache\mscorlib.pdb\BAD2B04F3CB34C248FBD3F1E9DCF60202\mscorlib.pdb - file not found


*** ERROR: HTTP_STATUS_NOT_FOUND


*** ERROR: HTTP_STATUS_NOT_FOUND


*** ERROR: HTTP_STATUS_NOT_FOUND


*** ERROR: HTTP_STATUS_NOT_FOUND


SYMSRV:  C:\SymbolCache\mscorlib.pdb\BAD2B04F3CB34C248FBD3F1E9DCF60202\mscorlib.pdb not found


SYMSRV:  http://referencesource.microsoft.com/symbols/mscorlib.pdb/BAD2B04F3CB34C248FBD3F1E9DCF60202/mscorlib.pdb not found


http://referencesource.microsoft.com/symbols: Symbols not found on symbol server.
SYMSRV:  C:\SymbolCache\mscorlib.pdb\BAD2B04F3CB34C248FBD3F1E9DCF60202\mscorlib.pdb - file not found


*** ERROR: HTTP_STATUS_NOT_FOUND


*** ERROR: HTTP_STATUS_NOT_FOUND


INFO:  HTTP_STATUS_OK


SYMSRV:  C:\SymbolCache\mscorlib.pdb\BAD2B04F3CB34C248FBD3F1E9DCF60202\mscorlib.pdb - file not found


SYMSRV:  mscorlib.pdb from https://msdl.microsoft.com/download/symbols: 121231 bytes 

https://msdl.microsoft.com/download/symbols: Symbols downloaded from symbol server.
C:\SymbolCache\mscorlib.pdb\BAD2B04F3CB34C248FBD3F1E9DCF60202\mscorlib.pdb: Symbols loaded.

.NET 4.6

C:\Users\alfred.myers\Documents\Visual Studio 2015\Projects\ConsoleApplication452\ConsoleApplication452\bin\Debug\mscorlib.pdb: Cannot find or open the PDB file.
C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.pdb: Cannot find or open the PDB file.
C:\Windows\mscorlib.pdb: Cannot find or open the PDB file.
C:\Windows\symbols\dll\mscorlib.pdb: Cannot find or open the PDB file.
C:\Windows\dll\mscorlib.pdb: Cannot find or open the PDB file.
C:\SymbolCache\mscorlib.pdb\bad2b04f3cb34c248fbd3f1e9dcf60202\mscorlib.pdb: Cannot find or open the PDB file.
C:\SymbolCache\MicrosoftPublicSymbols\mscorlib.pdb\bad2b04f3cb34c248fbd3f1e9dcf60202\mscorlib.pdb: Cannot find or open the PDB file.
SYMSRV:  C:\SymbolCache\mscorlib.pdb\BAD2B04F3CB34C248FBD3F1E9DCF60202\mscorlib.pdb - file not found


*** ERROR: HTTP_STATUS_NOT_FOUND


*** ERROR: HTTP_STATUS_NOT_FOUND


*** ERROR: HTTP_STATUS_NOT_FOUND


*** ERROR: HTTP_STATUS_NOT_FOUND


SYMSRV:  C:\SymbolCache\mscorlib.pdb\BAD2B04F3CB34C248FBD3F1E9DCF60202\mscorlib.pdb not found


SYMSRV:  http://referencesource.microsoft.com/symbols/mscorlib.pdb/BAD2B04F3CB34C248FBD3F1E9DCF60202/mscorlib.pdb not found


http://referencesource.microsoft.com/symbols: Symbols not found on symbol server.
SYMSRV:  C:\SymbolCache\mscorlib.pdb\BAD2B04F3CB34C248FBD3F1E9DCF60202\mscorlib.pdb - file not found


*** ERROR: HTTP_STATUS_NOT_FOUND


*** ERROR: HTTP_STATUS_NOT_FOUND


INFO:  HTTP_STATUS_OK


SYMSRV:  C:\SymbolCache\mscorlib.pdb\BAD2B04F3CB34C248FBD3F1E9DCF60202\mscorlib.pdb - file not found


SYMSRV:  mscorlib.pdb from https://msdl.microsoft.com/download/symbols: 121231 bytes 

https://msdl.microsoft.com/download/symbols: Symbols downloaded from symbol server.
C:\SymbolCache\mscorlib.pdb\BAD2B04F3CB34C248FBD3F1E9DCF60202\mscorlib.pdb: Symbols loaded.

我几天前给设置页面上提到的人发了一封电子邮件,但没有人回复。

有关如何解决此问题的任何线索?

0 个答案:

没有答案