私の夜間ビルドは昨晩失敗しました。問題は、ReadOnly Property
を完全な読み取り/書き込みProperty
として実装したコード変更であり、許可されていません。インターフェイスでのアクセスレベルのミスマッチがVisual Studioでコンパイルされますが、msbuildではコンパイルされません。
それは問題ありません(私は両方の引数を見ることができますが、それは十分です)。しかし、Visual Studio(2015)では同じコードが完全に正常にコンパイルされます。しかし、コマンドラインからmsbuildを呼び出すスクリプトビルドが失敗します。
簡単な例問題を示すために、次のコードは、VSでOKコンパイル(およびその後、あまりにも細かい動作します):
Module Module1
Interface IFoo
ReadOnly Property Bar As String
End Interface
Class Foo
Implements IFoo
Private _Bar As String
Public Property Bar As String Implements IFoo.Bar
Get
Return _Bar
End Get
Set(value As String)
_Bar = value
End Set
End Property
End Class
Sub Main()
Dim F As New Foo
F.Bar = "baz"
Console.WriteLine(F.Bar)
End Sub
End Module
しかし
C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe Foo.vbproj
が
で失敗し、次のコマンドを実行していますBuild FAILED.
"C:\Users\...\Foo\Foo\Foo.vbproj" (default target) (1) ->
(CoreCompile target) ->
C:\Users\...\Foo\Foo\Module1.vb(10,20): error BC30154: Class 'Foo' must
implement 'ReadOnly Property Bar As String' for interface 'IFoo'.
Implementing property must have matching 'ReadOnly'
or 'WriteOnly' specifiers. [C:\Users\..\Foo\Foo.vbproj]
C:\Users\...\Foo\Foo\Module1.vb(13,50): error BC30401: 'Bar' cannot
implement 'Bar' because there is no matching property on interface
'IFoo'. [C:\Users\...\Foo\Foo.vbproj]
0 Warning(s)
2 Error(s)
ReadOnly Property Bar As String
をちょうどProperty Bar As String
に変更すると、bui同じコマンドで大丈夫です。
質問:
は何かが、これは今ではなく、以前の許可されていることを変わりましたか? 新しいmsbuildを使用すべきですか? ( が現在インストールされていないようです)
Visual Studioにmsbuildと同じ動作をさせる方法はありますか? はmsbuildと同じですか? VSでビルドすると、 はmsbuildでもビルドされることを意味します。 これをエラーとして受け入れることは非常にうれしいですが、私はVSにエラーとして表示します。
[MSBuild Vs Visual Studio - コンパイルの違い?](http://stackoverflow.com/questions/42787906/msbuild-vs-visual-studio-differences-in-compilation?rq=1) – TnTinMn
セットアップVSライセンスのないビルドサーバは決して間違いではありません。あなたの開発マシンはRoslynを使用しますが、ビルドサーバーは使用しません。 VS2012と互換性のあるVB.NETコンパイラと言語バージョンを使用します。 VS2015のフレーバーをダウングレードすることは可能ですが、かなり厄介です(http://stackoverflow.com/a/32123363/17034)。 –
@Adamこの問題のアップデートはありますか?あなたは答えとコメントから有益な情報を得ることができますか?そうでない場合は、この質問の最新のステータスをお知らせください。 –