You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When used inside WPF projects the MSBuild task GenerateCodeFromAttributes might fail:
The "GenerateCodeFromAttributes" task failed unexpectedly. [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
System.IO.FileNotFoundException: Could not find file 'C:\Users\egger\Workspace\MSBuildTest\LibA\bin\Debug\LibA.dll'. [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
File name: 'C:\Users\egger\Workspace\MSBuildTest\LibA\bin\Debug\LibA.dll' [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at System.IO.File.OpenRead(String path) [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at Roslyn.Utilities.FileUtilities.OpenFileStream(String path) [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at Microsoft.CodeAnalysis.MetadataReference.CreateFromFile(String path, MetadataReferenceProperties properties, DocumentationProvider documentation) [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at CodeGeneration.Roslyn.Tasks.GenerateCodeFromAttributes.Helper.<>c.<CreateProject>b__40_0(ITaskItem p) [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext() [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at System.Linq.Buffer`1..ctor(IEnumerable`1 source) [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items) [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at Roslyn.Utilities.ImmutableArrayExtensions.ToImmutableArrayOrEmpty[T](IEnumerable`1 items) [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at Roslyn.Utilities.ImmutableArrayExtensions.ToImmutableReadOnlyListOrEmpty[T](IEnumerable`1 items) [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at Microsoft.CodeAnalysis.ProjectInfo.WithMetadataReferences(IEnumerable`1 metadataReferences) [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at Microsoft.CodeAnalysis.ProjectState.WithMetadataReferences(IEnumerable`1 metadataReferences) [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at Microsoft.CodeAnalysis.Solution.WithProjectMetadataReferences(ProjectId projectId, IEnumerable`1 metadataReferences) [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at Microsoft.CodeAnalysis.Project.WithMetadataReferences(IEnumerable`1 metadataReferences) [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at CodeGeneration.Roslyn.Tasks.GenerateCodeFromAttributes.Helper.CreateProject() [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at CodeGeneration.Roslyn.Tasks.GenerateCodeFromAttributes.Helper.<<Execute>b__36_0>d.MoveNext() [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
--- End of stack trace from previous location where exception was thrown --- [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at CodeGeneration.Roslyn.Tasks.GenerateCodeFromAttributes.Helper.Execute() [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at CodeGeneration.Roslyn.Tasks.GenerateCodeFromAttributes.Helper.Execute() [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at CodeGeneration.Roslyn.Tasks.GenerateCodeFromAttributes.Execute() [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() [C:\Users\egger\Workspace\MSBuildTest\WpfApp\2wvt5w2v.tmp_proj]
This only happens when two-pass-compilation happens (i.e. when XAML files reference types from the same assembly).
The obvious workaround is to separate the XAML stuff from the CodeGen stuff, but do you think you could fix this in your library?
When used inside WPF projects the MSBuild task
GenerateCodeFromAttributes
might fail:This only happens when two-pass-compilation happens (i.e. when XAML files reference types from the same assembly).
The obvious workaround is to separate the XAML stuff from the CodeGen stuff, but do you think you could fix this in your library?
For a sample repo that reproduces this see https://github.com/Weingartner/ImmutableObjectGraphAndWpfFail
The text was updated successfully, but these errors were encountered: