Question: I have a windows service that worked properly when the target framework is .NET 2, when I changed it to .Net 4 I recompiled the project, re-installed it using installutil then started the service but I'm getting "Windows could not start the service on Local Computer. Error 1067: The process terminated unexpectedly."
Not sure how to proceed, the OnStart() method is not being hit by the Debugger.Break() line. Any idea how to proceed? Is there some settings or configuration I need to update if I change the target framework?

Answer: 
Use the function `std::make_unique` instead of the constructor (line 27):

```
std::unique_ptr<Mesh> myMesh = std::make_unique (myModel.meshes[0]);

```

Include `<memory>` to use `std::make_unique`!
You declare `myMesh` as a `std::unique_ptr<Mesh>` so you should initialize it with the default value (`nullptr`)

```
 std::unique_ptr<Mesh> myMesh; // initialized to nullptr

```

or with a **pointer** to an **allocated** `Mesh`; something like

```
 std::unique_ptr<Mesh> myMesh( new Mesh(/* arguments to constructor */) );

```

The problem is that you try to initialize `myMesh` with a `Mesh` (non a pointer to a `Mesh`)

```
 std::unique_ptr<Mesh> myMesh( myModel.meshes[0] );
                            // myModel.meshes[0] is a Mesh

```

There isn't a constructor for `std::unique_ptr<T>` that receive a `T` object; you can see it, by example, in [this page](http://en.cppreference.com/w/cpp/memory/unique_ptr/unique_ptr).

Attention: avoid to pass to `myMesh` constructor the pointer to `myModel.meshes[0]` because isn't an allocated `Mesh`; it would be wrong and dangerous.