-
-
Notifications
You must be signed in to change notification settings - Fork 287
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
An error occurred:SetSite failed for package [EFCorePowerToolsPackage]Source: 'EFCorePowerTools' Description: 未能加载文件或程序集“EnvDTE, #1046
Comments
What happens before you got this error?? |
Could you try the latest daily? |
the log of VS2022 about this error. the daily build (version 2.5.714) also has the same error. |
No idea, could be a VS2022 issue/bug. What OS language and VS language? |
I am not able to repro! @madskristensen ?? |
Yes,I'm using VS 2022 preview 2. |
Known bug in Preview 1 that was fixed in Preview 2 of VS2022 |
But @kakalotte claims to be running preview 2! |
Using a brand new computer, there is no problem after reinstall the win10 system and vs2022 preview 2 software. My old computer still has this problem. Is there any temporary solution?@madskristensen |
Closing as external VS issue |
Still not fixed in my version (using Preview 3 of VS2022). |
@madskristensen Is there something I can do in Power Tools? |
Did you get rid of all uses of DTE and replaced them with DTE2? |
@TimKras Can you share your activitylog? Or full error stack? |
Ok, i think i figured it out from having the same issue in one of my extensions. I was referencing the old Private Interop Assemblies for the EnvDTE. When I changed to using PackageReferences and the Microsoft.VisualStudio.SDK (or toolkit) package it worked. Or so it seems |
But I am using PackageReferences already... |
By upgrading the package |
@ankitvarmait Well spotted, thanks! |
@TimKras @kakalotte I attempted a fix in the latest daily build, are you able to give that a try? |
@ankitvarmait What if my extension also target VS 2017 (Using SDK 15.0.1) ? (My two other extensions does that currently) |
@ErikEJ, you can refer the document at: You can also view the following resources: |
@ankitvarmait can I drop support for VS 2017, and just use the latest 2019 SDK? I cannot publish multiple extensions to same Marketplace entry yet, can I? |
Latest daily build does not fix the issue.
|
@TimKras thanks! I am going to wait and see, as I am not able to repro on my machine and according to @madskristensen publishing a mixed extension should be possible. What other extensions do you have installed in VS 2022? What other VS versions do you have installed? |
I don't know where I can reach out to you exactly @ErikEJ, but my WIP is here Tim-Maes/T4Executer#4 I'm not sure if I'm able to publish a VS2022 and a VS2019 VSIX file from one single solution |
@Tim-Maes I publish a VS 2022 and VS 2019 VSIX from the same solution, so it can be done. Look at my VSIX manifest file: https://github.com/ErikEJ/EFCorePowerTools/blob/master/src/GUI/EFCorePowerTools/source.extension.vsixmanifest#L22 The main point is to stop using EnvDTE and replace with methods from VS Community Toolkit version 16. See for example: https://github.com/ErikEJ/EFCorePowerTools/blob/master/src/GUI/Shared/Extensions/ProjectExtensions.cs |
I removed all EnvDTE references, and install the Toolkit in both vsix projects, but the code that uses EnvDTE has been moved to a shared library (as by the official documentation example) which for some reason can't reference the toolkit and still needs EnvDTE to find 'Project' objects. There must be something I don't understand or completely miss at this moment |
You do not actually need the shared project. But a shared project works fine for me with the Toolkit. If you have a branch with the current code I am happy to take a look. |
WIP on this is right here. Thanks in advance. |
Confused - I see two VSIX projects ?? And no references to the Toolkit ?? What should be the goal ? Get T4Executer project working in VS 2022 - or publish a dual target VSIX? |
If goal is just "Get T4Executer project working in VS 2022" things become much simpler. |
According to the official docs I had to create a VSIX project that targets VS2022 and move all code to a shared library. When I build in release mode TTExecuter now generates an VSIX for VS2019 and T4Executer for VS2022. You see no references to toolkit since I am still trying locally and not comitted yet As described here |
You need to switch to the Community Toolkit events, they no longer work with DTE: VsixCommunity/Community.VisualStudio.Toolkit#63 |
480
2023/07/12 14:37:01.849
Error
0x80131513 |
@JosephWJMaxwell which exact VS version? |
@ErikEJ I am getting the same issue in VS 2022 |
@tpumper sure, but which version exactly ?? 17.x.x - check Help, About menu |
The same error and log file on my site. Version 2022 - 17.4.0 |
Please Update to the latest version 17.5.6 and let me know the outcome |
@ErikEJ That worked. Thank you for the guidance. |
You are welcome, not sure what is going on here - @madskristensen any idea? |
@madskristensen yes, and it seems to be an issue with 17.4 (and maybe earlier) , not 17.5 |
Are you using 17.0.x versions of the SDK NuGet packages and not 17.5.x or newer? |
@madskristensen I am using the implicit reference via Community Toolkit. It is advisable to use 17.5 SDK explicitly? |
Referencing EnvDTE 8.0.0.0 on VS 2022 is not supported. With the change to 64-bit, we made interop-incompatible changes to fix bitness issues in these assemblies and require everyone to recompile. While some extension authors find that they may get away without doing this, this may very well be one of those cases where it really is necessary. And we don't have capacity to offer help for a scenario that is officially unsupported. |
@AArnott Thanks, I am not doing that, please read the last entries in this thread. I will add an explicit SDK ref |
Ah, it was a very long thread so I just read the description, you're right. But I see you've closed the issue too, so should I still read through everything? |
@AArnott I am so sorry, someone hijacked this old unrelated thread, and I got confused. This thread is the current issue (and luckily much shorther). Looking at the VSIX now I can see that the SDK libraries are included as files - is that expected? |
Awesome. That makes more sense. I'll hop over to that thread and reply. |
SetSite failed for package [EFCorePowerToolsPackage]Source: 'EFCorePowerTools' Description: 未能加载文件或程序集“EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项。系统找不到指定的文件。
System.IO.FileNotFoundException: 未能加载文件或程序集“EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项。系统找不到指定的文件。
文件名:“EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”
在 EFCorePowerTools.EFCorePowerToolsPackage.d__11.MoveNext()
在 System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
在 EFCorePowerTools.EFCorePowerToolsPackage.InitializeAsync(CancellationToken cancellationToken, IProgress`1 progress)
在 Microsoft.VisualStudio.Shell.AsyncPackage.<>c__DisplayClass20_0.<b__1>d.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 Microsoft.VisualStudio.Threading.JoinableTask.d__76.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e)
在 Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck)
EF Core Power Tools version:2.5.692
Visual Studio version: Microsoft Visual Studio Enterprise 2022 Preview (64 位)
The text was updated successfully, but these errors were encountered: