Exception when opening a project referencing a csproj

Hey there,

Was working on a project referencing a csproj on 2022.5.0 - 0379. After closing and re-opening vvvv, I was greeted with this error message :

EmitException: "D:\Documents\dev\projects\foo\bar\collector\Collector.vl.cs(50,71): error CS0012: The type 'DirectusMetric' is defined in an assembly that is not referenced. You must add a reference to assembly 'Collector#1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'."
Full stack trace
EmitException: "D:\Documents\dev\projects\foo\bar\collector\Collector.vl.cs(50,71): error CS0012: The type 'DirectusMetric' is defined in an assembly that is not referenced. You must add a reference to assembly 'Collector#1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'."
    StackTrace:
        VL.Lang.Platforms.Roslyn.TargetCompilation+<>c__DisplayClass49_0 { internal System.ValueTuple<Microsoft.CodeAnalysis.AssemblyMetadata, VL.Core.RawAssembly> <Emit>g__EmitDebug|0() { ... } } 
        VL.Lang.Platforms.Roslyn.TargetCompilation { private System.ValueTuple<Microsoft.CodeAnalysis.PortableExecutableReference, VL.Core.RawAssembly> Emit(VL.Lang.Symbols.IProjectSymbol project, Microsoft.CodeAnalysis.CSharp.CSharpCompilation compilation, bool isDebug, bool includeSource, System.Threading.CancellationToken token) { ... } } 
        VL.Lang.Platforms.Roslyn.TargetCompilation+<>c__DisplayClass6_0 { internal VL.Lang.Platforms.Roslyn.ProjectCompilation <InitializeAsync>g__Build|0(VL.Lang.Platforms.Roslyn.ProjectBuildRequest projectBuildRequest) { ... } } 
        VL.Lang.Platforms.Roslyn.TargetCompilation+<>c__DisplayClass6_1+<<InitializeAsync>b__3>d { private virtual void MoveNext() { ... } } 
        System.Runtime.ExceptionServices.ExceptionDispatchInfo { public void Throw() { ... } } 
        System.Runtime.CompilerServices.TaskAwaiter { private static void ThrowForNonSuccess(System.Threading.Tasks.Task task) { ... } } 
        System.Runtime.CompilerServices.TaskAwaiter { private static void HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task task) { ... } } 
        VL.Lang.Platforms.Roslyn.TargetCompilation+<InitializeAsync>d__6 { private virtual void MoveNext() { ... } } 
        System.Runtime.ExceptionServices.ExceptionDispatchInfo { public void Throw() { ... } } 
        System.Runtime.CompilerServices.TaskAwaiter { private static void ThrowForNonSuccess(System.Threading.Tasks.Task task) { ... } } 
        System.Runtime.CompilerServices.TaskAwaiter { private static void HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task task) { ... } } 
        System.Runtime.CompilerServices.TaskAwaiter`1 { public TResult GetResult() { ... } } 
        VL.Lang.Platforms.Roslyn.TargetCompilation+<CreateAsync>d__4 { private virtual void MoveNext() { ... } } 
        System.Runtime.ExceptionServices.ExceptionDispatchInfo { public void Throw() { ... } } 
        System.Runtime.CompilerServices.TaskAwaiter { private static void ThrowForNonSuccess(System.Threading.Tasks.Task task) { ... } } 
        System.Runtime.CompilerServices.TaskAwaiter { private static void HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task task) { ... } } 
        System.Runtime.CompilerServices.TaskAwaiter`1 { public TResult GetResult() { ... } } 
        VL.Lang.Platforms.Roslyn.TargetCompilation+<WithCompilationAsync>d__45 { private virtual void MoveNext() { ... } } 
        System.Runtime.ExceptionServices.ExceptionDispatchInfo { public void Throw() { ... } } 
        System.Runtime.CompilerServices.TaskAwaiter { private static void ThrowForNonSuccess(System.Threading.Tasks.Task task) { ... } } 
        System.Runtime.CompilerServices.TaskAwaiter { private static void HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task task) { ... } } 
        System.Runtime.CompilerServices.TaskAwaiter`1 { public TResult GetResult() { ... } } 
        VL.Lang.Platforms.Roslyn.TargetCompilation+<VL-Lang-Symbols-ITargetCompilation-WithCompilationAsync>d__46 { private virtual void MoveNext() { ... } } 
        System.Runtime.ExceptionServices.ExceptionDispatchInfo { public void Throw() { ... } } 
        System.Runtime.CompilerServices.TaskAwaiter { private static void ThrowForNonSuccess(System.Threading.Tasks.Task task) { ... } } 
        System.Runtime.CompilerServices.TaskAwaiter { private static void HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task task) { ... } } 
        System.Runtime.CompilerServices.TaskAwaiter`1 { public TResult GetResult() { ... } } 
        VL.Model.VLSession+<CreateTargetCompilationAsync>d__168 { private virtual void MoveNext() { ... } } 
        System.Runtime.ExceptionServices.ExceptionDispatchInfo { public void Throw() { ... } } 
        System.Runtime.CompilerServices.TaskAwaiter { private static void ThrowForNonSuccess(System.Threading.Tasks.Task task) { ... } } 
        System.Runtime.CompilerServices.TaskAwaiter { private static void HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task task) { ... } } 
        VL.Model.VLSession+<UpdateRuntimesAsync>d__167 { private virtual void MoveNext() { ... } } 
        System.Runtime.ExceptionServices.ExceptionDispatchInfo { public void Throw() { ... } } 
        System.Runtime.CompilerServices.TaskAwaiter { private static void ThrowForNonSuccess(System.Threading.Tasks.Task task) { ... } } 
        System.Runtime.CompilerServices.TaskAwaiter { private static void HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task task) { ... } } 
        VL.Model.VLSession+<UpdateCompilationAsync>d__190 { private virtual void MoveNext() { ... } } 

Thing is, the csproj is still referenced, and the patch correctly “sees” this DirectusMetric type and its operations.

Cheers

Ok, after trying to export this project, the exporter raised an error complaining that the solution’s name was ambiguous : indeed, my patch was called Collector.vl and the solution’s name was Collector as well.

Does not seem to complain anymore.

Hey, re-opening that one since the issue happens again.

This time with latest .5 preview (396).

Instead of referencing a csproj, I’m now referencing a .dll built from that csproj. Though, vvvv keeps throwing this error

EmitException: "D:\Documents\dev\projects\Blah\Blah.Blah\collector\Collector.vl.cs(50,71): error CS0012: The type 'DirectusMetric' is defined in an assembly that is not referenced. You must add a reference to assembly 'Collector.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'."

This dll is indeed referenced in the patch, and the IDE shows no red nodes, so not sure why vvvv is complaning there :

edit : at some point the console does not pop anymore when there’s an error, vvvv just stays silent. If I open the console myself, I’m getting this

Starting Application_C

OUTDATED: o: 0(-0) p: 0(-0) Application
REASON: Outdated, RestoreState

Stopping Application


Starting CollectorApplication_JekAy1KaEvtMu7xUvCLLpe

OUTDATED: o: 0(-0) p: 0(-0) Application
REASON: Outdated, RestoreState

Starting Application_C

OUTDATED: o: 0(-0) p: 0(-0) Application
REASON: Outdated, RestoreState

Stopping Application


Starting CollectorApplication_JekAy1KaEvtMu7xUvCLLpe

OUTDATED: o: 0(-0) p: 0(-0) Application
REASON: Outdated, RestoreState
Restarting the app didn't fix the issue. So let's not run it again. Stopping runtime VL.UI.Forms.UserRuntime

Which makes it impossible to patch since this happens continuously.

Any hints? Thanks.

I’m also having this error in the new 2022.5 previews, it didn’t happen in preview 335.

Can you upload a patch + your dll please? A simple test didn’t reproduce this issue on our end.

@sebescudie Thanks for the zip you sent us. Fixed in latest preview (5.0-401).

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.