Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS2017 15.9.12 Fixes #24

Merged
merged 3 commits into from
May 31, 2019
Merged

VS2017 15.9.12 Fixes #24

merged 3 commits into from
May 31, 2019

Conversation

MaulingMonkey
Copy link
Contributor

Couple of minor fixes for the following issues:

  • VS2017 appears to be ignoring the .csproj settings to allow debugging the vsix.
  • VS2017 has trouble loading the extension assembly for the Tools > Options > Rust menu.

While the RustLanguageExtension.dll assembly is loaded fine for
intellisense, syntax highlighting, etc. - the Tools > Options > Rust
page fails to load the appropriate assembly.  This might be related to
VS2017 breaking changes[1], but I'm not 100% sure what's going on.

I'm not even sure this isn't a bug in VS, given that only the options
page is unable to load the assembly, but at least we have a fix [2].

[1] https://docs.microsoft.com/en-us/visualstudio/extensibility/breaking-changes-2017?view=vs-2019#change-global-assembly-cache-gac
[2] https://social.msdn.microsoft.com/Forums/en-US/39ca5319-96af-4de7-b2d1-4d28154321b4/vsix-options-dialog-does-not-always-load-in-vsix-extension?forum=vsx#b209ab3b-6f0d-493f-a322-c25e4ed6b82e
RustLanguageExtension.csproj already specifies these settings, but this
version of VS2017 appears to ignore those completely.  Adding a new
launchSettings.json appears to fix the problem.
@ZoeyR
Copy link
Owner

ZoeyR commented May 31, 2019

Is the options dialog issue consistent for you? I've never seen this problem before.

@MaulingMonkey
Copy link
Contributor Author

Yes, it's 100% consistent for me when building from master. Clicking the Rust entry at all I get this dialog:

image

And the options don't show, being replaced by "An error occurred loading this property page". The relevant record from ActivityLog.xml isn't particularly informative except to say it couldn't load the assembly due to a FileNotFoundException and a suggestion to enable fusion logging.

  <entry>
    <record>2005</record>
    <time>2019/05/31 20:30:20.475</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>CreateInstance failed for package [RustLanguageExtensionOptionsPackage]Source: &apos;mscorlib&apos; Description: Could not load file or assembly &apos;RustLanguageExtension, Version=0.5.0.0, Culture=neutral, PublicKeyToken=null&apos; or one of its dependencies. The system cannot find the file specified.&#x000D;&#x000A;System.IO.FileNotFoundException: Could not load file or assembly &apos;RustLanguageExtension, Version=0.5.0.0, Culture=neutral, PublicKeyToken=null&apos; or one of its dependencies. The system cannot find the file specified.&#x000D;&#x000A;File name: &apos;RustLanguageExtension, Version=0.5.0.0, Culture=neutral, PublicKeyToken=null&apos;&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Activator.CreateInstance(String assemblyString, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark&amp; stackMark)&#x000D;&#x000A;   at System.Activator.CreateInstance(String assemblyName, String typeName)&#x000D;&#x000A;   at System.AppDomain.CreateInstance(String assemblyName, String typeName)&#x000D;&#x000A;&#x000D;&#x000A;WRN: Assembly binding logging is turned OFF.&#x000D;&#x000A;To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.&#x000D;&#x000A;Note: There is some performance penalty associated with assembly bind failure logging.&#x000D;&#x000A;To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].&#x000D;&#x000A;</description>
    <guid>{B57536CB-0310-4E50-907B-A14610127C49}</guid>
    <hr>80004005 - E_FAIL</hr>
    <errorinfo></errorinfo>
  </entry>

Using fuslogvw to grab the logs for the assembly load failure, we can see everywhere it tried to find the assembly - none of which are where it's installed, %USERPROFILE%\AppData\Local\Microsoft\VisualStudio\15.0_545960d0\Extensions\0fex5fpx.qfa.

*** Assembly Binder Log Entry  (5/31/2019 @ 1:34:38 PM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = RustLanguageExtension, Version=0.5.0.0, Culture=neutral, PublicKeyToken=null
 (Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = devenv.exe
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\Mike\AppData\Local\Microsoft\VisualStudio\15.0_545960d0\devenv.exe.config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/RustLanguageExtension.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/RustLanguageExtension/RustLanguageExtension.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/PublicAssemblies/RustLanguageExtension.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/PublicAssemblies/RustLanguageExtension/RustLanguageExtension.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/PrivateAssemblies/RustLanguageExtension.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/PrivateAssemblies/RustLanguageExtension/RustLanguageExtension.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/RustLanguageExtension.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/RustLanguageExtension/RustLanguageExtension.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/TestWindow/RustLanguageExtension.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/TestWindow/RustLanguageExtension/RustLanguageExtension.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Platform/Debugger/RustLanguageExtension.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Platform/Debugger/RustLanguageExtension/RustLanguageExtension.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Platform/DiagnosticsHub/RustLanguageExtension.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Platform/DiagnosticsHub/RustLanguageExtension/RustLanguageExtension.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/PrivateAssemblies/DataCollectors/RustLanguageExtension.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/PrivateAssemblies/DataCollectors/RustLanguageExtension/RustLanguageExtension.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/PrivateAssemblies/DataCollectors/x86/RustLanguageExtension.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/PrivateAssemblies/DataCollectors/x86/RustLanguageExtension/RustLanguageExtension.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/RustLanguageExtension.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/RustLanguageExtension/RustLanguageExtension.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/PublicAssemblies/RustLanguageExtension.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/PublicAssemblies/RustLanguageExtension/RustLanguageExtension.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/PrivateAssemblies/RustLanguageExtension.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/PrivateAssemblies/RustLanguageExtension/RustLanguageExtension.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/RustLanguageExtension.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/RustLanguageExtension/RustLanguageExtension.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/TestWindow/RustLanguageExtension.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/TestWindow/RustLanguageExtension/RustLanguageExtension.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Platform/Debugger/RustLanguageExtension.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Platform/Debugger/RustLanguageExtension/RustLanguageExtension.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Platform/DiagnosticsHub/RustLanguageExtension.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Platform/DiagnosticsHub/RustLanguageExtension/RustLanguageExtension.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/PrivateAssemblies/DataCollectors/RustLanguageExtension.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/PrivateAssemblies/DataCollectors/RustLanguageExtension/RustLanguageExtension.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/PrivateAssemblies/DataCollectors/x86/RustLanguageExtension.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/PrivateAssemblies/DataCollectors/x86/RustLanguageExtension/RustLanguageExtension.EXE.
LOG: All probing URLs attempted and failed.

@ZoeyR
Copy link
Owner

ZoeyR commented May 31, 2019

Oh, I see what's going on. This doesn't happen from the marketplace builds since they are from before I switched to a CPS project. The new one isn't generating a codebase entry in the .pkgdef file.

@ZoeyR ZoeyR merged commit b097d6b into ZoeyR:master May 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants