You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Next to the project file is a simple static class that doesn’t really do anything. Just as a demo.
This project compiles fine from dotnet CLI (1.0.0) using dotnet build, MSBuild (v15), and also from within Visual Studio 2017. However, the generated PDB for the library weighs just 1KB and appears to be broken. When I try to open the DLL with ILSpy, I get an OutOfMemoryException when it tries to load the PDB. After removing the PDB from the file system, I can open the DLL just fine with ILSpy, so the library compilation itself appears to work just fine. But the PDB is broken.
The other issue I see, which might be related to the broken PDB, is with the Visual Studio tooling when attempting to consume the above library. I have an example ASP.NET Core project (targetting the full framework) that references above library. When I attempt to use the types defined in the library, Visual Studio reports an error that the library “does not exist in the current context”.
However, actually compiling and running the web application does work just fine. The types can be used properly and the code in the library is also executed properly. The compilation will also not fail in Visual Studio although the error message remains in the error list (suggesting that the compilation has failed when it hasn’t).
Compiling and/or running the web application from the command line does not show the error. So it’s just the Visual Studio tooling that’s not working here. This might be related to the library’s PDB being broken, if that’s how Visual Studio sets up IntelliSense for project references.
The text was updated successfully, but these errors were encountered:
While attempting to reproduce this inside a minimal test project on a different machine, I found two new behaviors within Visual Studio: In some cases, everything works fine, correctly highlighting the library namespace and giving me IntelliSense for it. In other cases, the exact same code (just used elsewhere) will not get any tooling support (no syntax highlighting, no IntelliSense) but will also not produce any error.
In all cases, I however cannot navigate to the type using F12, likely due to the PDB being broken.
Anyway, I set up a test project here: https://github.com/poke/msbuild-issue1816 – Unfortunately, this is only giving me broken tooling without the appearing error in the error list at the moment. I’ll try to figure out what’s causing that exactly.
Together with help from @dasMulli on chat, we figured out that the PDB appears to be correct after all. Apparently, portable PDBs are created by default and those seem to be incompatible with ILSpy. Related bugs already exists over there for the exact error I encountered (icsharpcode/ILSpy#723 and icsharpcode/ILSpy#779).
That left the Visual Studio tooling broken though. But after moving the example code around from one machine to another, less and less problems appeared to stick around until they suddenly all disappeared. Might be related to restarting Visual Studio in the end.
So this issue solved itself over time. Nothing to see here… *sigh*
Hey, I found a problem when using the new concise project format targetting the full framework. For this, assume the following project file:
Next to the project file is a simple static class that doesn’t really do anything. Just as a demo.
This project compiles fine from dotnet CLI (1.0.0) using
dotnet build
, MSBuild (v15), and also from within Visual Studio 2017. However, the generated PDB for the library weighs just 1KB and appears to be broken. When I try to open the DLL with ILSpy, I get an OutOfMemoryException when it tries to load the PDB. After removing the PDB from the file system, I can open the DLL just fine with ILSpy, so the library compilation itself appears to work just fine. But the PDB is broken.The other issue I see, which might be related to the broken PDB, is with the Visual Studio tooling when attempting to consume the above library. I have an example ASP.NET Core project (targetting the full framework) that references above library. When I attempt to use the types defined in the library, Visual Studio reports an error that the library “does not exist in the current context”.
However, actually compiling and running the web application does work just fine. The types can be used properly and the code in the library is also executed properly. The compilation will also not fail in Visual Studio although the error message remains in the error list (suggesting that the compilation has failed when it hasn’t).
Compiling and/or running the web application from the command line does not show the error. So it’s just the Visual Studio tooling that’s not working here. This might be related to the library’s PDB being broken, if that’s how Visual Studio sets up IntelliSense for project references.
The text was updated successfully, but these errors were encountered: