2017-06-11 3 views
2

Ich habe eine Lösung mit mehreren Projekten. Ich habe korrekte Build-Reihenfolge und Abhängigkeit. Dieses Projekt kann auf einer anderen Maschine mit der gleichen Version von Visual Studio 2017 (26430.13) erstellt werden. Der einzige Unterschied ist, dass ich derzeit versuche, auf Windows 10 aufzubauen. Das andere System (das bauen kann) ist Win 8.1. Aber auf einer 3. Maschine mit Win 10 baut auch.VS 2017 C# Fehler CS0234 Der Typ oder Namespace-Name existiert nicht im Namespace (fehlt Ihnen eine Assembly-Referenz?)

Mein Problem ist folgendes auf dem System, das nicht die Lösung aufbauen können:

Es gibt ein Projekt namens ucx.v2 (Namespace: pcbox). Wenn ich dieses Projekt erstelle, gibt es keinen Fehler und es baut korrekt auf.

Es gibt ein anderes Projekt namens Timer. Dieses Projekt enthält einen Verweis auf ucx.v2 in den Referenzen. Es ist nicht kaputt. Wenn ich dieses Projekt erstelle, bekomme ich mehr als 100 Fehler, über Referenzfehler.

Die Build-Reihenfolge ist korrekt, denn wenn ich das Timer-Projekt erstelle, beginnt es zuerst, das Projekt ucx.v2 zu erstellen, und es wird ohne Fehler beendet.

Ich habe Folgendes versucht: - Neustart VS. - Saubere Lösung, Projekt neu erstellen - Entfernen Sie die Referenz aus dem Timer-Projekt, und fügen Sie es erneut ohne Glück hinzu.

Hinweis: Ich habe die Lösung von der Arbeitsmaschine kopiert.

Hier ist das Fehlerprotokoll:

1>------ Build started: Project: ucx.v2, Configuration: Debug Any CPU ------ 
1>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\ucx.v2\forms\UcDataAdapter.cs(463,21,463,28): warning CS0108: 'UcDataAdapter.Dispose()' hides inherited member 'Component.Dispose()'. Use the new keyword if hiding was intended. 
1>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\ucx.v2\ras\RasConnectionNotify.cs(35,69,35,93): warning CS0618: 'WaitHandle.Handle' is obsolete: 'Use the SafeWaitHandle property instead.' 
1>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\ucx.v2\ras\RasConnectionNotify.cs(52,69,52,93): warning CS0618: 'WaitHandle.Handle' is obsolete: 'Use the SafeWaitHandle property instead.' 
1>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\ucx.v2\data\CommandBatch.cs(53,34,53,36): warning CS0168: The variable 'ex' is declared but never used 
1>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\ucx.v2\ras\RasConnection.cs(440,59,440,84): warning CS0618: 'WaitHandle.Handle' is obsolete: 'Use the SafeWaitHandle property instead.' 
1>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\ucx.v2\data\StoredProc.cs(58,13,58,16): warning CS0162: Unreachable code detected 
1>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\ucx.v2\data\StoredProc.cs(81,13,81,16): warning CS0162: Unreachable code detected 
1>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\ucx.v2\forms\UcColorButton.cs(23,17,23,49): warning CS0184: The given expression is never of the provided ('KnownColor') type 
1>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\ucx.v2\data\QueryOptimizer.cs(258,18,258,26): warning CS0219: The variable 'sendflag' is assigned but its value is never used 
1>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\ucx.v2\forms\Print\ReportToolbar.cs(119,30,119,32): warning CS0168: The variable 'ex' is declared but never used 
1>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\ucx.v2\forms\UcDataSetManager.cs(1172,37,1172,39): warning CS0168: The variable 'ex' is declared but never used 
1>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\ucx.v2\forms\Print\frmReportPreview.Designer.cs(140,56,140,64): warning CS0169: The field 'frmReportPreview.Command0' is never used 
1>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\ucx.v2\ras\frmGetConnection.cs(22,44,22,54): warning CS0649: Field 'frmGetConnection.components' is never assigned to, and will always have its default value null 
1>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\ucx.v2\forms\MemoryStatisticsGparh.cs(33,13,33,30): warning CS0414: The field 'MemoryStatisticsGparh.graphMaxItemCount' is assigned but its value is never used 
1>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\ucx.v2\forms\MemoryStatisticsGparh.cs(32,13,32,22): warning CS0414: The field 'MemoryStatisticsGparh.lineCount' is assigned but its value is never used 
1> ucx.v2 -> c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\ucx.v2\bin\Debug\ucx.v2.dll 
2>------ Build started: Project: Timer, Configuration: Debug Any CPU ------ 
3>------ Build started: Project: pcbox.startpage, Configuration: Debug Any CPU ------ 
4>------ Build started: Project: Loader.run, Configuration: Debug Any CPU ------ 
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1964,5): warning MSB3258: The primary reference "c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\ucx.v2\bin\Debug\ucx.v2.dll" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework. 
2>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\Timer\AlarmNotification.cs(6,13,6,17): error CS0234: The type or namespace name 'data' does not exist in the namespace 'pcbox' (are you missing an assembly reference?) 
2>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\Timer\IScheduledServiceItem.cs(2,13,2,17): error CS0234: The type or namespace name 'data' does not exist in the namespace 'pcbox' (are you missing an assembly reference?) 
2>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\Timer\pop3\RxMailMessage.cs(17,13,17,22): error CS0234: The type or namespace name 'Extension' does not exist in the namespace 'pcbox' (are you missing an assembly reference?) 
2>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\Timer\ServiceTimer.cs(8,13,8,17): error CS0234: The type or namespace name 'data' does not exist in the namespace 'pcbox' (are you missing an assembly reference?) 
2>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\Timer\ServiceTimerDS.cs(4,13,4,17): error CS0234: The type or namespace name 'data' does not exist in the namespace 'pcbox' (are you missing an assembly reference?) 
2>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\Timer\synchronization\MailReceiver.cs(7,13,7,17): error CS0234: The type or namespace name 'data' does not exist in the namespace 'pcbox' (are you missing an assembly reference?) 
2>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\Timer\synchronization\MailSender.cs(8,13,8,17): error CS0234: The type or namespace name 'data' does not exist in the namespace 'pcbox' (are you missing an assembly reference?) 
2>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\Timer\synchronization\Replication.cs(6,7,6,18): error CS0246: The type or namespace name 'ICSharpCode' could not be found (are you missing a using directive or an assembly reference?) 
2>c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\Timer\synchronization\Replication.cs(7,13,7,17): error CS0234: The type or namespace name 'data' does not exist in the namespace 'pcbox' (are you missing an assembly reference?) 
+0

Haben Sie eine Lösung gefunden? – Peter

Antwort

0

ich Ihr Problem glauben, hier zu dieser Linie zurückzuführen ist:

2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1964,5): warning MSB3258: The primary reference "c:\Users\david\Documents\Visual Studio 2017\Projects\NomalGit\ucx.v2\bin\Debug\ucx.v2.dll" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework. 

Im Projekt namens Timer, die Version .NET Ziels von 2,0 ändern 4.0 durch Öffnen von Projekteigenschaften und Ändern von "Target Framework".

Verwandte Themen