Repository navigation
Open
Labels
area/hot-reloadCategorizes an issue or PR as relevant to hot reloadproject/core-tools 🛠️Categorizes an issue or PR as relevant to core and tools
Description
@MartinZikmund mine breaks also on hotreload after I edited Bindings, but with a different error message, is that somehow related to your issue?
16:57:23.15 Code changes were successfully applied. 17:04:38.95 [Error] Exception while emitting update: System.ArgumentException: An item with the same key has already been added. Key: Microsoft.CodeAnalysis.Emit.EditAndContinue.DeletedPEMethodDefinition at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) at Microsoft.CodeAnalysis.Emit.DeltaMetadataWriter.SerializeLocalVariablesSignature(IMethodBody body) at Microsoft.Cci.MetadataWriter.SerializeMethodBodies(BlobBuilder ilBuilder, PdbWriter nativePdbWriterOpt, Blob& mvidStringFixup) at Microsoft.Cci.MetadataWriter.BuildMetadataAndIL(PdbWriter nativePdbWriterOpt, BlobBuilder ilBuilder, PooledBlobBuilder& mappedFieldDataBuilder, PooledBlobBuilder& managedResourceDataBuilder, Blob& mvidFixup, Blob& mvidStringFixup) at Microsoft.Cci.MetadataWriter.WriteMetadataAndIL(PdbWriter nativePdbWriterOpt, Stream metadataStream, Stream ilStream, Stream portablePdbStreamOpt, MetadataSizes& metadataSizes) at Microsoft.CodeAnalysis.Compilation.SerializeToDeltaStreams(CommonPEModuleBuilder moduleBeingBuilt, DefinitionMap definitionMap, SymbolChanges changes, Stream metadataStream, Stream ilStream, Stream pdbStream, ArrayBuilder`1 updatedMethods, ArrayBuilder`1 changedTypes, DiagnosticBag diagnostics, Func`2 testSymWriterFactory, String pdbFilePath, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.CSharp.Emit.EmitHelpers.EmitDifference(CSharpCompilation compilation, EmitBaseline baseline, IEnumerable`1 edits, Func`2 isAddedSymbol, Stream metadataStream, Stream ilStream, Stream pdbStream, CompilationTestData testData, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Compilation.EmitDifference(EmitBaseline baseline, IEnumerable`1 edits, Func`2 isAddedSymbol, Stream metadataStream, Stream ilStream, Stream pdbStream, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.EditAndContinue.EditSession.EmitSolutionUpdateAsync(Solution solution, ActiveStatementSpanProvider solutionActiveStatementSpanProvider, UpdateId updateId, CancellationToken cancellationToken) 17:04:38.96 [Error] C:\Users\Sonja\source\repos\DevTKSS\DevTKSS.Uno.SampleApps\src\DevTKSS.Uno.Samples.sln (line 1): error ENC1002: Cannot apply changes -- unexpected error: 'An item with the same key has already been added. Key: Microsoft.CodeAnalysis.Emit.EditAndContinue.DeletedPEMethodDefinition' 17:04:38.96 Invalid changes were found. Please refer to the Error List window to fix those issues. 17:05:29.70 [Error] Exception while emitting update: System.ArgumentException: An item with the same key has already been added. Key: Microsoft.CodeAnalysis.Emit.EditAndContinue.DeletedPEMethodDefinition at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) at Microsoft.CodeAnalysis.Emit.DeltaMetadataWriter.SerializeLocalVariablesSignature(IMethodBody body) at Microsoft.Cci.MetadataWriter.SerializeMethodBodies(BlobBuilder ilBuilder, PdbWriter nativePdbWriterOpt, Blob& mvidStringFixup) at Microsoft.Cci.MetadataWriter.BuildMetadataAndIL(PdbWriter nativePdbWriterOpt, BlobBuilder ilBuilder, PooledBlobBuilder& mappedFieldDataBuilder, PooledBlobBuilder& managedResourceDataBuilder, Blob& mvidFixup, Blob& mvidStringFixup) at Microsoft.Cci.MetadataWriter.WriteMetadataAndIL(PdbWriter nativePdbWriterOpt, Stream metadataStream, Stream ilStream, Stream portablePdbStreamOpt, MetadataSizes& metadataSizes) at Microsoft.CodeAnalysis.Compilation.SerializeToDeltaStreams(CommonPEModuleBuilder moduleBeingBuilt, DefinitionMap definitionMap, SymbolChanges changes, Stream metadataStream, Stream ilStream, Stream pdbStream, ArrayBuilder`1 updatedMethods, ArrayBuilder`1 changedTypes, DiagnosticBag diagnostics, Func`2 testSymWriterFactory, String pdbFilePath, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.CSharp.Emit.EmitHelpers.EmitDifference(CSharpCompilation compilation, EmitBaseline baseline, IEnumerable`1 edits, Func`2 isAddedSymbol, Stream metadataStream, Stream ilStream, Stream pdbStream, CompilationTestData testData, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Compilation.EmitDifference(EmitBaseline baseline, IEnumerable`1 edits, Func`2 isAddedSymbol, Stream metadataStream, Stream ilStream, Stream pdbStream, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.EditAndContinue.EditSession.EmitSolutionUpdateAsync(Solution solution, ActiveStatementSpanProvider solutionActiveStatementSpanProvider, UpdateId updateId, CancellationToken cancellationToken) 17:05:29.70 [Error] C:\Users\Sonja\source\repos\DevTKSS\DevTKSS.Uno.SampleApps\src\DevTKSS.Uno.Samples.sln (line 1): error ENC1002: Cannot apply changes -- unexpected error: 'An item with the same key has already been added. Key: Microsoft.CodeAnalysis.Emit.EditAndContinue.DeletedPEMethodDefinition' 17:05:29.70 Invalid changes were found. Please refer to the Error List window to fix those issues. 17:05:40.46 DevTKSS.Uno.Samples.MvuxGallery (3):16952: The process has exited. 17:05:40.46 DevTKSS.Uno.Samples.MvuxGallery (3): Hot Reload session complete.I dont know under which caption I should list this instead maybe you have a suggestion if its not same.
Github dont lets me add the repro without bin and obj as zip here, but you can get it from my Repository directlythe nuget its "missing" then is content of my Extensions PR, but packed it here:
Metadata
Metadata
Assignees
Labels
area/hot-reloadCategorizes an issue or PR as relevant to hot reloadproject/core-tools 🛠️Categorizes an issue or PR as relevant to core and tools
Activity
jeromelaban commentedon May 16, 2025
Thanks for the report@DevTKSS.
Could you tell which version of Visual Studio you are using? Specifically, the issue is in visual studio and can't fix on our own, but it's extremely important to have exact repro steps so we can report it to Microsoft.
DevTKSS commentedon May 16, 2025
vs 2022 Community Edtion Version is the latest 17.4.0 just today before this
for the repro steps: in my opinion, my steps has been very normal...
In the CounterPage, I did see my Increment by Step Size Binding has been defect,
I thought I might had deleted a State in my Model, so I added one (type int), tryed to insert it to the Value (as you will know, that did not work ;) - no HotReload inbetween, just compiler unsatisfyed ) then I checked the mvux - xaml docs for the counter workshop for this, deleted the added state and default value edit in the model.
then in the Page I did update
THEN I clicked the Hot Reload Button and BANG... Exception, not willing to be recovered, not giving me any idea what I might did wrong to make it Break like this.
Hoping this helps you investigate it...? I dont think I have more details I could tell you.
Uno.Sdk version is and was the current 6.0.67.
the only remarkable difference I seen in this application to one created with the new released wizard Templates is, that when you resize this linked application WIDTH and look onto the NavigationView Header, the MenuPaneOpen Button just vanishes out of sight until you upscale the width again
That somehow does not happen in a app with the new templates using, which I showed for a misalignment and style issue in the Uno.Themes repo because I think the main issue there is defintly a Material Theme issue:
unoplatform/Uno.Themes#1545
DevTKSS commentedon May 16, 2025
PS: seems like for the vanished MenuPaneToggle Button is the depending Visible property set to false the culprit I did not see I set like this. I defintly have to get a ResponsiveExtension.Narrow listener added to this 😅
DevTKSS commentedon May 19, 2025
Getting quite very often exceptions similar to this (will inspect the output more closely if needed in future, most time just restarting app debug...) closely related to when I change something with State/ListFeed in the model record (99% I have to restart to get those changes appyed) and then trying to use binding via the view.
I would normally not expect that hotreload is not reliable usable with mvux state things🤔 or did I miss this information?
github-actions commentedon May 12, 2026
This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.
github-actions commentedon Oct 28, 2026
This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.