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

报错找不到方法:EnVDTE.Solution EnvDTE. DTE.get Solution0” #81

Open
ylyy opened this issue Sep 18, 2024 · 14 comments
Open

报错找不到方法:EnVDTE.Solution EnvDTE. DTE.get Solution0” #81

ylyy opened this issue Sep 18, 2024 · 14 comments

Comments

@ylyy
Copy link

ylyy commented Sep 18, 2024

Hi 请问下,运行vs2022的任何选项 await RequestAsync(selectedText);一直会报错找不到方法:EnVDTE.Solution EnvDTE. DTE.get Solution0”是为啥
image

@jeffdapaz
Copy link
Owner

Hi,

Please try updating your Visual Studio to the latest version first. Some people have reported errors recently that stopped occurring when they updated Visual Studio.

If that doesn't work, trigger the error again and get the log that is written to the Output window (select the "Visual chatGPT Studio" option in the combo box) and copy it here so I can analyze it.

@moamen270
Copy link

i have updated my visual studio to latest version and still have the same issue

@moamen270
Copy link

moamen270 commented Sep 18, 2024

9/18/2024 9:43:06 PM: System.MissingMethodException: Method not found: 'EnvDTE.Solution EnvDTE._DTE.get_Solution()'.
at JeffPires.VisualChatGPTStudio.Options.Commands.OptionCommands.d__8.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine) at JeffPires.VisualChatGPTStudio.Options.Commands.OptionCommands.GetCommandAsync(CommandsType commandType) at JeffPires.VisualChatGPTStudio.Commands.Complete.GetCommand(String selectedText) in D:\ repo\VisualChatGPTStudio\VisualChatGPTStudioShared\Commands\Complete.cs:line 23 at JeffPires.VisualChatGPTStudio.Commands.BaseGenericCommand1.d__10.MoveNext() in D:\ repo\VisualChatGPTStudio\VisualChatGPTStudioShared\Commands\BaseGenericCommand.cs:line 98
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at JeffPires.VisualChatGPTStudio.Commands.BaseGenericCommand`1.d__9.MoveNext() in D:\repo\VisualChatGPTStudio\VisualChatGPTStudioShared\Commands\BaseGenericCommand.cs:line 77

@jeffdapaz
Copy link
Owner

@ylyy e @moamen270,

I couldn't reply the error on my side, but I made some changes and I ask you guys to try this package with the changes and tell me if worked.

If work, I'll create a new release.

@ylyy
Copy link
Author

ylyy commented Sep 19, 2024

It still notwork. The error report is still in that place.
在 JeffPires.VisualChatGPTStudio.Options.Commands.OptionCommands.d__8.MoveNext()
在 System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine) 在 JeffPires.VisualChatGPTStudio.Options.Commands.OptionCommands.GetCommandAsync(CommandsType commandType) 在 JeffPires.VisualChatGPTStudio.Commands.Complete.GetCommand(String selectedText) 位置 D:\aiAPP\VisualChatGPTStudio-master\VisualChatGPTStudio\VisualChatGPTStudioShared\Commands\Complete.cs:行号 23 在 JeffPires.VisualChatGPTStudio.Commands.BaseGenericCommand1.d__10.MoveNext() 位置 D:\aiAPP\VisualChatGPTStudio-master\VisualChatGPTStudio\VisualChatGPTStudioShared\Commands\BaseGenericCommand.cs:行号 98
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 System.Runtime.CompilerServices.TaskAwaiter.GetResult()
在 JeffPires.VisualChatGPTStudio.Commands.BaseGenericCommand`1.d__9.MoveNext() 位置 D:\aiAPP\VisualChatGPTStudio-master\VisualChatGPTStudio\VisualChatGPTStudioShared\Commands\BaseGenericCommand.cs:行号 77

@jeffdapaz
Copy link
Owner

I really can't figure out what might be happening, but I suspect there is a difference between the versions of Microsoft's own libraries contained in the VSIX and the one that the Visual Studio version expects.

Can you confirm that your version of Visual Studio is 17.11.4?

In the meantime I made some more changes and compiled it.

Can you check if this version works now?

@ylyy
Copy link
Author

ylyy commented Sep 20, 2024

Visual Studio is 17.11.4. The version in the download link in this reply does not have this problem.

I really can't figure out what might be happening, but I suspect there is a difference between the versions of Microsoft's own libraries contained in the VSIX and the one that the Visual Studio version expects.

Can you confirm that your version of Visual Studio is 17.11.4?

In the meantime I made some more changes and compiled it.

Can you check if this version works now?

@jeffdapaz
Copy link
Owner

Very thanks @ylyy for the feedback.

I will publish this fix on the marketplace as soon as possible.

@ylyy
Copy link
Author

ylyy commented Sep 28, 2024

Very thanks @ylyy for the feedback.

I will publish this fix on the marketplace as soon as possible.

最新 3.0.4切换到Release版本执行的时候还会报这个问题

@jeffdapaz
Copy link
Owner

Hi @ylyy,

sorry, but since I had to translate from Chinese, there may have been a misunderstanding.

When I made the latest version available via link for you to test, from what I understood from you, the problem had been solved. Is that right?

Now, after I published version 3.0.4 on the marketplace, which is basically the version I made available via link without any changes, you're saying that the problem wasn't solved, is that it? In other words, the extension I made available via link worked, but version 3.0.4 via markplace didn't?

@jeffdapaz jeffdapaz reopened this Sep 28, 2024
@ylyy
Copy link
Author

ylyy commented Sep 29, 2024

Sorry, I didn't express myself clearly. I mean that this error is reported during the debugging process. However, when installed as vsix, the above problem does not occur. It may still be a problem with my IDE. My current solution is to debug the project in VS2019 so that there will be no error.

@jeffdapaz
Copy link
Owner

Ah, ok, now I get it. So I'll try to help by showing you how my development environment is, so try to leave it the same way on your side and maybe that will solve the problem.

First, check if your VS 2019 is on the latest version, which is currently 16.11.40.

Second, the two libraries below that are highlighted and that are referenced in the VisualChatGPTStudio2019 project cannot be updated, they must remain in the version below:

image

Also check if your VS2022 that you use to open and edit the Extension project has the component below installed:

image

I don't know if it makes a difference, but my VS2022 is the Professional edition and VS2019 is the Community edition.

It is also worth mentioning that whenever you do debugging, do it in debug mode and not release mode.

Otherwise, my environment is nothing special. I hope this helps.

@moamen270
Copy link

@ylyy e @moamen270,

I couldn't reply the error on my side, but I made some changes and I ask you guys to try this package with the changes and tell me if worked.

If work, I'll create a new release.

I found that the same error message appears regardless of the actual error in the code, which makes it difficult to identify the underlying cause of different issues.
Even if a specific error occurs elsewhere in the code, the error message remains the same, which is misleading and not directly related to the main issue.

@jeffdapaz
Copy link
Owner

@moamen270 , let me understand your case.

While the @moamen270's problem is related to debugging the extension's code running the extension in VS 2019, your case is actually trying to use any command in VS 2022 that has the extension installed, right?

And the error message is always related to "Method not found: 'EnvDTE.Solution EnvDTE._DTE.get_Solution()'", right?

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

No branches or pull requests

3 participants