Error : DEP3321 – Can’t deploy to Windows 10 Mobile

With Windows 10 being rolled out as I write this article, there will be updated sample Windows Platform apps available soon (today). It’s also time to update your projects.

However, you may find yourself not able to deploy to Windows 10 Mobile after updating your projects or older samples to Windows 10 (build 10240). This post will show you how to resolve this problem.

The Problem

You’ll see an error something like this when deploying to a physical Windows 10 Mobile device:

Error : DEP3321 : To deploy this application, your deployment target should be running Windows Universal Runtime version 10.0.10240.0 or higher. You currently are running version 10.0.10166.0. Please update your OS, or change your deployment target to a device with the appropriate version.

The error is pretty clear but how do we fix it? The resolution is with the MinTargetVersion setting.

The Fix

We need to drop the lowest version your app targets to the version that your device has running, we can do this in one of two ways; through the project properties UI editor or manually edit the XML of the csproj file. I will show you how to do it manually because in some cases, the UI’s MinTarget dropdown list won’t show the lowest SDK if you do not have it installed. Below are the steps to fix it.

NOTE: Skip to step 3 if your project is already unloaded (it will show (unavailable) next to the name)

1) Right click on your project in Visual Studio

2) Select “Unload Project“, it will now appears as ProjectName (unavailable)

3) Right click on the unloaded project and select “Edit projectName.csproj

4) Locate the <TargetPlatformVersion> and <TargetPlatformMinVersion> items in the first <PropertyGroup>.

Here’s the “Before” screenshot:

2015-07-28_1734

5) Change the TargetPlatformMinVersion to the version that the error stated you are running. In this case, it’s 10166. Here’s the “After” screenshot:

After

6) Now Save and Close the file

7) Right click on the project again and select “Reload Project

8) Rebuild the project and deploy to device. Now you should be up and running!

Summary

I expect this to happen with increasing frequency as we move forward with Windows 10 SDK releases. The new paradigm is that we’ll have a set of installed windows 10 Tools, but multiple SDK versions. We need to be aware of the min version and targeted version of our apps.

If you have any questions, feel free to leave a comment below.

Advertisements

17 thoughts on “Error : DEP3321 – Can’t deploy to Windows 10 Mobile

  1. Thanks. But after changing the lines, it has the following errors:

    Severity Code Description Project File Line
    Error “10.0.10166.0” is not a supported value for TargetPlatformVersion. Please change it on the Project Property page. App4 C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\JavaScript\Microsoft.VisualStudio.JavaScript.UAP.targets 64

    Like

    • the error should be this one:

      Severity Code Description Project File Line
      Error “10.0.10166.0” is not a supported value for TargetPlatformMinVersion. Please change it on the Project Property page. App4 C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\JavaScript\Microsoft.VisualStudio.JavaScript.UAP.targets 64

      Like

    • Hi KfSung, can you share a screenshot of what you edited? I noticed that your project is a javascript (WinJS) project. It might be a different place to make the edit.

      Like

  2. Thanks. Fixed the problem I was having using my Win 10 phone to debug Windows 10 Universal apps in Visual Studio 2015

    Like

    • This is not true, there are plenty of low end phone models that can use Win 10 mobile. The minimum requirements for Windows 10 Mobile are; a: The minimum amount of RAM is listed as 512MB b: Minimum storage required to run Windows 10 for phones will be 4GB c: Windows 10 will support screen sizes from 3 inches all the way up to 7.99 inches

      Like

  3. Thanks for Post. After changing the lines, it has the give same errors:

    Error : DEP3320 : Target device’s operating system version does not meet the application’s minimum requirement. Minimum required operating system is Windows 10.0.

    I am using the Lumia 930 device which has 8.1 OS. So is it possible to build and deploy my application on this device. I cant manage windows 10 device right no, So is there any other way to built the UWP project. Currently I Using the simulator for debugging purpose and its going well but I can’t able to deploy the project with simulator. It give an error:

    Loading assembly “C:\Users\ngulati\.nuget\packages\System.Private.Uri\4.0.0\runtimes\win8-aot\lib\netcore50\System.Private.Uri.dll” failed. System.IO.FileNotFoundException: Could not load file or assembly ‘System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified.File name: ‘System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’

    Like

    • Hi Mahesh, the problem you’re having is because you’re trying to deploy to a UWP package to an 8.1 device. This is not possible. However, you can deploy an 8.1 “Universal” phone app. You’ll need ot make sure you have the windows 8.1 tools and SDK installed and make sure your project was started as an “8.1” Universal application.

      Like

      • Hi Lance,
        Thanks for Reply Now I have windows 10 device and code working in debug mode perfectally. But when i try to built app in release mode then it gives an following error like
        Loading assembly “C:\Users\**\.nuget\packages\Microsoft.NETCore.Portable.Compatibility\1.0.0\runtimes\aot\lib\netcore50\mscorlib.dll” failed. System.IO.FileLoadException: Could not load file or assembly ‘mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’ or one of its dependencies. Strong name validation failed.

        I have set Solution platform is ARM(also try with x86 and 64) but still it gives error. Have you aware with this issue. I also tried replace mscorlib.dll with version 4.0.0.0 but its also not working.

        Like

  4. Hi Mahesh. if you clean and rebuild, do you see the error again? This error points to the nuget packages. Make sure you have the latest tools installed (1.3.1) and the latest UWP nuget package (5.1)

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s