我有一個應用程序,我最近不得不升級到.NET 4.5以利用異步以及其他一些功能。它在我的本地開發環境中效果很好。當我把它的服務器(這是我剛剛安裝了.NET 4.5),當它到達一個異步部分,它的錯誤上,在System.Runtime.CompilerServices.AsyncMethodBuilderCore扔system.missingMethodException而使用.NET 4.5構建Windows服務
System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object,Boolean)中的System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)012b161(System.Object) System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object,Boolean) at System.Threading.QueueUserWorkIte mCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() 在System.Threading.ThreadPoolWorkQueue.Dispatch() 在System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
當我進入事件查看器,上面清清楚楚地寫着我的Windows服務是Framework版本:v4.0.30319。我的問題是如何將其構建爲4.5?在Visual Studio中,我定位到4.5,並且它在本地工作。我使用TeamCity,特別是MSBuild來構建解決方案。在我的生成配置文件,它使用這個作爲構建路徑:
<property name="msbuild.path" value="C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe" />
據我所知是沒有4.5的MSBuild。我怎樣才能使這項服務在我的服務器上4.5?
服務器上是否安裝了4.5版本? –
是4.5安裝 – KJ3