It budilds without error
When I build my UWP project I am getting error
Platform Target Frameworks:
Affected Devices: Local Machine
I cant build UWP project after upgrading to latest xamarin forms packages. I am getting error as
C:\Users\User\.nuget\packages\xamarin.forms\2.5.0.122203\build\netstandard1.0\Xamarin.Forms.targets(50,3): error XF001: Xamarin.Forms targets have been imported multiple times. Please check your project file and remove the duplicate import(s).
According to the path it has something to do with Xamarin forms. I am not using netstandard but using PCL111 profile.
Please attach your sample project so we can investigate
@StephaneDelcroix I found my problem. error was appearing because of myApp.nuget.props and myApp.nuget.targets files... when i delete them. i dont get this error anymore. how are they generated and whey do i have imports like below in each of these files and why do they throw this error. below what i had in each files
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)xamarin.forms\2.5.0.121934\build\netstandard1.0\Xamarin.Forms.props" Condition="Exists('$(NuGetPackageRoot)xamarin.forms\2.5.0.121934\build\netstandard1.0\Xamarin.Forms.props')" />
<Import Project="C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback\runtime.win10-x86.microsoft.net.uwpcoreruntimesdk\2.1.1\build\runtime.win10-x86.Microsoft.Net.UWPCoreRuntimeSdk.props" Condition="Exists('C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback\runtime.win10-x86.microsoft.net.uwpcoreruntimesdk\2.1.1\build\runtime.win10-x86.Microsoft.Net.UWPCoreRuntimeSdk.props')" />
<Import Project="C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback\runtime.win10-x64.microsoft.net.uwpcoreruntimesdk\2.1.1\build\runtime.win10-x64.Microsoft.Net.UWPCoreRuntimeSdk.props" Condition="Exists('C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback\runtime.win10-x64.microsoft.net.uwpcoreruntimesdk\2.1.1\build\runtime.win10-x64.Microsoft.Net.UWPCoreRuntimeSdk.props')" />
<Import Project="C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback\runtime.win10-arm.microsoft.net.uwpcoreruntimesdk\2.1.1\build\runtime.win10-arm.Microsoft.Net.UWPCoreRuntimeSdk.props" Condition="Exists('C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback\runtime.win10-arm.microsoft.net.uwpcoreruntimesdk\2.1.1\build\runtime.win10-arm.Microsoft.Net.UWPCoreRuntimeSdk.props')" />
<Import Project="C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback\microsoft.net.uwpcoreruntimesdk\2.1.1\build\Microsoft.Net.UWPCoreRuntimeSdk.props" Condition="Exists('C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback\microsoft.net.uwpcoreruntimesdk\2.1.1\build\Microsoft.Net.UWPCoreRuntimeSdk.props')" />
<Import Project="C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback\microsoft.net.native.sharedlibrary-x86\2.0.0\build\Microsoft.Net.Native.SharedLibrary-x86.props" Condition="Exists('C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback\microsoft.net.native.sharedlibrary-x86\2.0.0\build\Microsoft.Net.Native.SharedLibrary-x86.props')" />
<Import Project="C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback\microsoft.net.native.sharedlibrary-x64\2.0.0\build\Microsoft.Net.Native.SharedLibrary-x64.props" Condition="Exists('C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback\microsoft.net.native.sharedlibrary-x64\2.0.0\build\Microsoft.Net.Native.SharedLibrary-x64.props')" />
<Import Project="C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback\microsoft.net.native.sharedlibrary-arm\2.0.0\build\Microsoft.Net.Native.SharedLibrary-arm.props" Condition="Exists('C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback\microsoft.net.native.sharedlibrary-arm\2.0.0\build\Microsoft.Net.Native.SharedLibrary-arm.props')" />
<Import Project="C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback\microsoft.net.native.compiler\2.0.2\build\Microsoft.Net.Native.Compiler.props" Condition="Exists('C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback\microsoft.net.native.compiler\2.0.2\build\Microsoft.Net.Native.Compiler.props')" />
</ImportGroup>
@EmilAlipiev can you attach your project? It'd be useful to see the full csproj files
Are you using PackageReference or packages.config? If you're using PackageReference I think you can delete
<Import Project="$(NuGetPackageRoot)xamarin.forms\2.5.0.121934\build\netstandard1.0\Xamarin.Forms.props" Condition="Exists('$(NuGetPackageRoot)xamarin.forms\2.5.0.121934\build\netstandard1.0\Xamarin.Forms.props')" />
my references are stored in the csproj file. I dont use Packages.config. code i have copied is from myApp.nuget.targets file. I dont know why it has these lines but it solves the problem after deleting these 2 files completely. many people having this problem as i can see on xamarin forums. just wanted to reference here. otherwise my problem is already solved
None of my projects haveproject_name.nuget.propsand project_name.nuget.targets files.
What I see are lots of these files across all projects in solution
project_name.nuget.g.props
project_name.nuget.g.targets
project_name.nuget.cache
project_name.nuget.stamp
I tried deleting all of these in my solution that consists of multiple projects (Droid, iOS, UWP and number of .NETStandard projects). But I still get XF001 error on Clear, Build, Rebuild. It is happening only on my Droid project Clean/Build/Rebuild
Most helpful comment
@StephaneDelcroix I found my problem. error was appearing because of myApp.nuget.props and myApp.nuget.targets files... when i delete them. i dont get this error anymore. how are they generated and whey do i have imports like below in each of these files and why do they throw this error. below what i had in each files