tinaschrepfer on tinali
Remove use of "any" content typ… (compare)
tinaschrepfer on tinali
Merge pull request #169 from Mi… Add sample support for "any" co… (compare)
tinaschrepfer on master
Update VSSDK package and remove… Merge pull request #169 from Mi… (compare)
error CS1579: foreach statement cannot operate on variables of type 'object' because 'object' does not contain a public instance or extension definition for 'GetEnumerator'
I'm getting this error when trying to update my extension to VS2022
public VCFile FindFile(VCProject project, string name)
{
foreach (VCFile file in project.Files)
{
The code works fine with previous versions, not clear to me why these dynamic properties are not working here
<PackageReference Include="Microsoft.VisualStudio.Sdk" Version="17.0.31902.203" />
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem" Version="17.0.1313-pre" />
ITextSearchService
but if I add a property with the [Import]
attribute the property is always null
. Why doesn't this work?internal sealed class MyCommand : BaseCommand<MyCommand>
{
[Import]
internal ITextSearchService TextSearchService { get; set; }
Hey, I have a custom project page registered with
[Export(typeof(IVsProjectDesignerPageProvider))]
[AppliesTo("SliceCompile")]
internal class ProjectDesignerPageProvider : IVsProjectDesignerPageProvider
{
public Task<IReadOnlyCollection<IPageMetadata>> GetPagesAsync() =>
Task.FromResult((IReadOnlyCollection<IPageMetadata>)ImmutableArray.Create(new SliceCompilePageMetadata()));
}
But GetPageAsync is not called by Visual Studio 2022, did anything changes on how these property pages work? so far the same works fine with 2017 and 2019, and I cannot figure why this doesn't work with vs 2022
Hey 👋
I'm testing my extension on VS2015, VS2017 and VS2019. On 2019 version all works fine, but for 2015 and 2017 it throw an error
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Не удается найти указанный файл.
File name: 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at System.Span
1..ctor(T[] array)
at System.Text.Json.JsonSerializer.DeserializeTValue
at System.Text.Json.JsonSerializer.DeserializeTValue
at Common.Json.DeserializeT
at Extension.Service.ApiService.<GetSastSettingsAsync>d5.MoveNext() in C:\Projects\VisualStudio.Extension\ApiService.cs:line 50
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Extension.Service.ApiService.<IsCodeEnabledAsync>d6.MoveNext() in C:\Projects\VisualStudio\Extension\Service\ApiService.cs:line 69`
I tried to add this in my app.config file
<bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1"/>
But it doesnt help.
Maybe some one can suggest solution/fix?
Thanks!
Is anybody else having trouble with the VsixPublisher.exe tool shipped with VS2022? I am using the windows-2022
image in my Github Actions to publish my extension, but the tool ALWAYS throws an exception from the command line, even though it returns a success message. This happens NO MATTER how to invoke the tool from the command line. For reference, the VS2022 version of this tool is found here: C:\Program Files\Microsoft Visual Studio\2022\Professional\VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe
.
Unhandled Exception: System.MissingMethodException: Method not found: 'Void Microsoft.VisualStudio.RemoteControl.RemoteControlClient..ctor(Microsoft.VisualStudio.Utilities.Internal.IRegistryTools, System.String, System.String, System.String, Int32, Int32, Int32)'.
at Microsoft.VisualStudio.Telemetry.TelemetryManifestManager.Start(String hostName, Boolean isDisposing)
at Microsoft.VisualStudio.Telemetry.TelemetrySession.Start(Boolean checkPendingAsimovEvents)
at Microsoft.VisualStudio.Sdk.VsixPublisher.TelemetryLogger.CreateTelemetrySession()
at Microsoft.VisualStudio.Sdk.VsixPublisher.TelemetryLogger.get_TelemetrySession()
at Microsoft.VisualStudio.Sdk.VsixPublisher.Program.Main(String[] args)
VSSDK: information VsixPub0041 : Publisher 'SajalVerma' is now logged-in.
Error: Process completed with exit code 1.
If you see the logs, the tool does log me in from the command line, but also throws an exception leading to my publish pipeline failing. If I try logging in from the VS2019-shipped version of it, it works fine.
Trying to invoke the help option also throws this exception from command line, leading me to believe this is a bug: C:\Program Files\Microsoft Visual Studio\2022\Professional\VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe --help
I believe so, @leksycode:matrix.org - are you familiar with the IWizard interface? https://docs.microsoft.com/en-us/visualstudio/extensibility/how-to-use-wizards-with-project-templates Visual Studio provides the IWizard interface that, when implemented, enables you to run custom code when a user creates a project from a template.
Project template customization can be used to display custom UI that collects user input to customize the template, add additional files to the template, or any other action allowed on a project.