Cannot resolve assembly or windows metadata file

User301668 posted
  • User301668 posted

    Yousuf, thanks for the reply. I wasn’t getting anywhere with anything. There were no NuGet packages installed by default.

    Last night I had added and removed (deleted) the project several times, and tried adding in missing dependencies. I was getting an error when creating the project that the project.json file could not be accessed because it was in use by another process. I had restarted Visual Studio a few times between attempts to make sure there wasn’t an issue with VS holding a lock on a file it shouldn’t have been, but that didn’t seem to make any difference.

    So now, this morning, I just deleted the project again, and then added it back in, and I didn’t get the error!? Went and checked, and now my project has the Microsoft.NETCore.UniversalWindowsPlatform NuGet package installed. Also, I did not get a warning on the project.json file being used by another process. It now contains:

    {
    «dependencies»: {
    «Microsoft.NETCore.UniversalWindowsPlatform»: «5.1.0»
    },
    «frameworks»: {
    «uap10.0»: {}
    },
    «runtimes»: {
    «win10-arm»: {},
    «win10-arm-aot»: {},
    «win10-x86»: {},
    «win10-x86-aot»: {},
    «win10-x64»: {},
    «win10-x64-aot»: {}
    }
    }

    I looked at my last version in GitHub, and it didn’t have the UniversalWindowsPlatform dependency (and that package wasn’t installed either). So it looks like there was something goofy going on in Visual Studio when trying to create the new project. Right now I don’t have any compile time errors, so it looks like it might be all fixed up. Now I just have to wire this new project back up to my solution. Looks like these are the instructions I need:

    https://developer.xamarin.com/guides/xamarin-forms/platform-features/windows/installation/universal/

    Hopefully I’m in the clear now, and this will help anyone else with the same problem.

    • Marked as answer by

      Thursday, June 3, 2021 12:00 AM

  • I am trying to compile a small test build (written in C#) in Visual Studio. However, I get two errors when trying so and can’t find the issue. No line’s are given:

    Error 1: small_project.csproj

    Cannot resolve Assembly or Windows Metadata file ‘System.Configuration.dll’

    Error 2:

    Type universe cannot resolve assembly: System.Configuration, Version 2.0.0.0, Culture=neutral, PublicKeyToken.. etc..

    I am new at developing with C# and XAML. Does someone know what could cause these errors?

    SendETHToThisAddress's user avatar

    asked Mar 18, 2016 at 19:07

    Matthijs's user avatar

    7

    I know that this question is old and all, but I am faced with the same error. I’ve done numerous xaml apps using a variety of test frameworks. I think that you might have made a Universal Windows App using the Unit Test template. Something in the MStest framework that was added was giving me the same exception that you reported here. After lots of looking around I watched a channel 9 video that mentioned them using xUnit for their UWP testing. I went to this site xUnit on github and did what they mentioned which was:

    • remove references to ms test
    • open projects.json
      • add xunit 2.1 and xunit.runners.visualstudio 2.1 dependencies
      • fix my unit test to use xUnit instead of MsTest/Nunit
    • build
    • opened test explorer and ran all tests

    I’ll have to keep in mind that testing UWP is going to be different than normal apps and so to change my expectations. Hopefully this helps others as well as the OP.

    answered Jun 4, 2016 at 17:05

    Robert Snyder's user avatar

    Robert SnyderRobert Snyder

    2,3893 gold badges33 silver badges65 bronze badges

    I had this issue when my project’s nuget packages weren’t available when trying a remote build on Jenkins.

    I just added a build-step to locate NuGet and then call restore on the project/solution to resolve this for automation purposes.

    This is just a segment of a script that I’m copying, so update to your needs:

    where nuget > nul 2>&1 nul
    IF "%errorlevel%"=="0" where nuget > .where_nuget.txt && Set where_nuget=where_nuget.txt
    IF NOT "%where_nuget%"=="" FOR /F "tokens=*" %%I IN ('type where_nuget.txt') DO call "%%I" restore "%Build_Target%"
    

    answered Nov 30, 2017 at 21:21

    kayleeFrye_onDeck's user avatar

    In my case the problem was that my UWP project referenced a project that referenced System.Web.Application.dll. I did:

    • Delete reference from the parent project
    • Clean and build parent project
    • Update Service Reference in child project
    • Clean and build child project
    • Remove unused reference from child project (System.Web.dll)

    I learnt it’s better to use nuget packages instead of adding references manually.

    System.Web.ApplicationServices-Error

    answered Feb 2, 2018 at 12:48

    7gegenTheben's user avatar

    Issue building UWP apps: Error WMC1006: Cannot resolve Assembly or Windows Metadata file

    A customer contacted me because they had errors building an UWP application on one of their build servers. Here are the related build logs:

    MarkupCompilePass1:

      Creating directory «objx86Releaseintermediatexaml».

    App1App1.csproj(0,0): Error WMC1006: Cannot resolve Assembly or Windows Metadata file ‘Type universe cannot resolve assembly: System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.’

    D:Buildsdev-agent-1_work76sApp1App1.csproj : XamlCompiler error WMC1006: Cannot resolve Assembly or Windows Metadata file ‘Type universe cannot resolve assembly: System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.’

      (Out) GeneratedCodeFiles: ‘D:Buildsdev-agent-1_work76sApp1objx86ReleaseApp.g.i.cs;D:Buildsdev-agent-1_work76sApp1objx86ReleaseApp.g.cs’

      (Out) Compile: ‘App.xaml.cs;MainPage.xaml.cs;PropertiesAssemblyInfo.cs;D:Buildsdev-agent-1_work76sApp1objx86ReleaseApp.g.i.cs;D:Buildsdev-agent-1_work76sApp1objx86ReleaseApp.g.cs’

    XamlPreCompile:

      D:Program Files (x86)Microsoft Visual Studio2017EnterpriseMSBuild15.0BinRoslyncsc.exe /noconfig /nowarn:2008,1701,1702 /nostdlib+ /platform:x86 /errorreport:prompt /warn:0 /define:TRACE;NETFX_CORE;WINDOWS_UWP;CODE_ANALYSIS /highentropyva+ /reference:»C:Program Files (x86)Windows Kits10References10.0.16299.0Windows.ApplicationModel.Calls.CallsVoipContract2.0.0.0Windows.ApplicationModel.Calls.CallsVoipContract.winmd» /reference:»C:Program Files (x86)Windows Kits10References10.0.16299.0Windows.ApplicationModel.SocialInfo.SocialInfoContract2.0.0.0Windows.ApplicationModel.SocialInfo.SocialInfoContract.winmd» /reference:»C:Program Files (x86)Windows Kits10References10.0.16299.0Windows.ApplicationModel.StartupTaskContract2.0.0.0Windows.ApplicationModel.StartupTaskContract.winmd» /reference:»C:Program Files (x86)Windows Kits10References10.0.16299.0Windows.Devices.Custom.CustomDeviceContract1.0.0.0Windows.Devices.Custom.CustomDeviceContract.winmd» /reference:»C:Program Files…

      Using shared compilation with compiler from directory: D:Program Files (x86)Microsoft Visual Studio2017EnterpriseMSBuild15.0BinRoslyn

    CSC(0,0): Error CS2001: Source file ‘D:Buildsdev-agent-1_work76sApp1objx86ReleaseApp.g.i.cs’ could not be found.

    CSC : error CS2001: Source file ‘D:Buildsdev-agent-1_work76sApp1objx86ReleaseApp.g.i.cs’ could not be found. [D:Buildsdev-agent-1_work76sApp1App1.csproj]

    Done Building Project «D:Buildsdev-agent-1_work76sApp1App1.csproj» (default targets) — FAILED.

    Done Building Project «D:Buildsdev-agent-1_work76sApp1.sln» (default targets) — FAILED.

    Build FAILED.

    On our local systems everything worked fine and even on our Hosted Build Server on VSTS, we were able to build without any issues. We were quite confident the problem was related to the targeted UWP version as with older UWP apps we didn’t had any issues.

    After contacting Microsoft they told us to switch our build server from Windows Server 2012R2 to 2016. After upgrading everything started to work!

    I have created a sample app using Windows 8 C# XAML to get site info of SharePoint 2010 using COM Dlls. I have added reference of:

    1. C:Program FilesCommon Filesmicrosoft sharedSharePoint ClientMicrosoft.SharePoint.Client.dll
    2. C:Program FilesCommon Filesmicrosoft sharedSharePoint ClientMicrosoft.SharePoint.Client.Runtime.dll

    but when I build the project it gives me following error:

    Error1: Cannot resolve Assembly or Windows Metadata file
    ‘System.Web.Services.dll’ E:Windows 8 And Sharepoint
    ExampleSharePointCOMAppSharePointCOMAppSharePointCOMApp.csproj

    Error2: Type universe cannot resolve assembly: System.Web.Services,
    Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=b03f5f7f11d50a3a. SharePointCOMApp

    How can i resolve this?

    asked Feb 1, 2013 at 6:13

    Balraj Singh's user avatar

    As far as I remember to my experiences with W8 vs. SP 2013 / O365, Managed Client Object Model assemblies (like Microsoft.SharePoint.Client.dll) cannot be directly referenced from a Windows Store App. Include your code into a wrapper class implemented as Class Library (Windows Store Apps), and reference this one from your Windows Store App.

    answered Nov 6, 2014 at 18:12

    pholpar's user avatar

    pholparpholpar

    3,1821 gold badge13 silver badges14 bronze badges

    I suspect you are targeting the wrong version of the .Net framework — you need the full framework and not the Client Profile.

    answered Feb 1, 2013 at 15:01

    lgaud's user avatar

    lgaudlgaud

    1,95112 silver badges23 bronze badges

    RRS feed

    • Remove From My Forums
    • Вопрос

    • Hi Experts,

      I am getting XAML compiler error in my PCL project

      «Cannot resolve Assembly or Windows Metadata file ‘System.Core.dll»

      Could you please tell me any workaround for this.

      Am using VS 2017 Enterprise edition and doing Xamarin Mac.

      Regards

      Suku P.K.


      Suku PK

      • Перемещено
        宝宝徐
        27 ноября 2017 г. 1:30

    Все ответы

    • Hi Suku,

      Thank you for posting in MSDN forum.

      This forum is discussing Visual Studio Setup and Installation, since your issue related to XamlCompiler error of PCL project, I suggest you post a new thread in
      https://www.xamarin.com/support to get a better help.

      Thanks for your understanding.

      Best Regards,


      MSDN Community Support
      Please remember to click «Mark as Answer» the responses that resolved your issue, and to click «Unmark as Answer» if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to
      MSDN Support, feel free to contact MSDNFSF@microsoft.com.

      • Изменено
        宝宝徐
        24 ноября 2017 г. 8:26

    • Thanks Wen Xu. will do the same.


      Suku PK

    Xamarin.Forms + Syncfusion

    The following are the Errors encountered when working with Xamarin.Forms and Syncfusion  controls.

    🔘 Error Cannot resolve Assembly or Windows Metadata file ‘Syncfusion.SfGrid.UWP.dll’ testSyncfusion.UWP D:4_PrjTrainingtestSyncfusiontestSyncfusiontestSyncfusion.UWPtestSyncfusion.UWP.csproj
    Error Type universe cannot resolve assembly: Syncfusion.SfGrid.UWP, Version=14.1460.0.46, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89. testSyncfusion.UWP C:Program Files (x86)MSBuildMicrosoftWindowsXamlv14.08.2Microsoft.Windows.UI.Xaml.Common.targets 352

    Solution:

    Remove the following references from the .UWP project:
    Syncfusion.SfGridConverter.UWP
    Syncfusion.SfGridConverter.XForms
    The error in my thinking, is because these are converters from an old library used by Syncfusion for a grid called “SfGrid”.

    🔘 Error Type universe cannot resolve assembly: Syncfusion.GridCommon.Portable, Version=14.1451.0.46, Culture=neutral, PublicKeyToken=null. testSyncfusion.UWP C:Program Files (x86)MSBuildMicrosoftWindowsXamlv14.08.2Microsoft.Windows.UI.Xaml.Common.targets 352

    🔘 Error Type universe cannot resolve assembly: Syncfusion.GridCommon.Portable, Version=14.1451.0.46, Culture=neutral, PublicKeyToken=null. testSyncfusion.UWP C:Program Files (x86)MSBuildMicrosoftWindowsXamlv14.08.2Microsoft.Windows.UI.Xaml.Common.targets 352
    Check this url:
    https://www.syncfusion.com/forums/121043/failed-to-resolve-assembly-39syncfusion-data-portable-version-13-3451-0-7-culture-neutral

    Solution:

    This error will occur in the .UWP project, so u need to add the reference for the PCL dll”Syncfusion.GridCommon.Portable.dll”, which is in pcl/Syncfusion.GridCommon.Portable.dll

    also see: http://help.syncfusion.com/xamarin/sfdatagrid/getting-started

    and also see: https://components.xamarin.com/gettingstarted/syncfusionessentialstudio

    We have analyzed your query and the screenshots. The compile error occurs as the Syncfusion.Data.Portable dll is not referred in the iOS renderer project. In order to resolve the compile error, you need to add the Syncfusion.SfDataGrid.XForms.iOS dll to your renderer project and Syncfusion.Data.Portable, Syncfusion.GridCommon.Portable, Syncfusion.SfDataGrid.XForms.dll dll’s to your pcl project.
    The Syncfusion.SfDataGrid.XForms.iOS dll internally references the three dlls that are added as reference to the pcl project and hence should resolve your error. In case if the error continue to persist, add the Syncfusion.Data.Portable, Syncfusion.GridCommon.Portable and Syncfusion.SfDataGrid.XForms dll’s along with the Syncfusion.SfDataGrid.XForms.iOS dll in the iOS renderer project in your sample.
    so check the references added:

    Related Errors:

    Xamarin.Forms Errors

    This entry was posted in Bugs and tagged Syncfusion, Xamarin.Forms. Bookmark the permalink.

    Понравилась статья? Поделить с друзьями:
  • Cannot open the windows nt service control manager
  • Cannot open source file windows h
  • Cannot open hasp driver windows server 2012
  • Cannot open file c windows system32 drivers etc hosts bandicam
  • Cannot locate the microsoft visual foxpro support library windows 10