1
votes

I have an application that I just recently had to upgrade to .NET 4.5 to take advantage of async as well as some other things. It works great in my local dev environment. When I put it on the server (which I just recently installed .NET 4.5), when it gets to an async portion, it errors, throwing a System.MissingMethodException

at System.Runtime.CompilerServices.AsyncMethodBuilderCore.b__1(System.Object) at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

When I go into the event viewer, it clearly says my windows service is Framework Version: v4.0.30319. My question is how to build it as 4.5? In Visual Studio I've targeted 4.5 and again it works locally. I use TeamCity, in particular MSBuild to build the solution. In my build config file, it is using this as the build path:

<property name="msbuild.path" value="C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe" />

As I understand it there is no 4.5 msBuild. How can I make this service be 4.5 on my server?

1
Is there 4.5 installed on your server ?Micah Armantrout

1 Answers

2
votes

I would get more information on the exception. MissingMemberException has many properties that will give you a better idea that it is in fact the dot net framework that is missing. Also just because the .net framework version is listed as v4.0.30319 doesn't mean its not 4.5 because 4.5 is built on top of 4 so you can't be 100% sure until you look at your properties on your exception