Saturday, March 03, 2012 10:30 PM
Is it possible to reference an assembly built with .NET 4.0 to a Metro project? I tried it and received the following error message:
A reference to '...' could not be added. The project targets '.NETCore' while the file reference targets '.NETFramework'. This is not a supported scenario.
Saturday, March 03, 2012 11:37 PM
A Metro style app must use references to another .NETCore or Portable Library binary only...it can not reference a full .NET 4.0 library because the Metro profile is not that large (and would fail store certification).
- Marked As Answer by Frank Calahan Sunday, March 04, 2012 4:35 AM
Wednesday, March 07, 2012 5:46 PM
Can you give us more details on how to create a ".NETCore" or "Portable Library binary"?
I have existing .NET Class Library dlls that are built using C++/CLI and target .NETFramework 4.0. I need to use those in a Metro application. What do I need to do in order to re-compile them so that they can be used?
Wednesday, March 07, 2012 7:53 PM
@xcRacer - Portable Libraries are available in the Beta for VS Ultimate (not in the express version). C++/CLI is not supported in Metro.
Wednesday, March 07, 2012 8:41 PMWhere can I find an example project for creating a .NETCore dll that actually works in a Metro application?
Wednesday, March 07, 2012 11:02 PM@xcRacer - the ".NETCOre" library is the Class Library project under the Metro style apps category in Visual Studio
Wednesday, March 07, 2012 11:35 PM
I think I figured it out myself.
If you create a new Visual C++, Windows Metro Style, WinRT Component DLL in Visual Studio 11 BETA, and then try to add a reference to the output .dll in a Visual C#, Windows Metro Style, Blank Application you will get an error:
"A reference to '<path>\WinRTComponentDll\WinRTComponentDll.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component."
However, if you add reference to the .winmd file which is in the same folder as the .dll, then it works.
- Proposed As Answer by BullyOwner Wednesday, March 07, 2012 11:35 PM
Tuesday, July 31, 2012 8:22 AMi don't understand the .winmd ? can you explain to me?
Tuesday, July 31, 2012 8:44 AM
When you build a C++/WinRT component using VS 2012, it will generate a .DLL and a .WINMD file.
In your consuming application, you must AddReference to the .WINMD file, not the .DLL file.
Thursday, January 10, 2013 2:19 PM
I'm getting the same issue with Json.Net
I've tried the Portable version but still get errors.
Has anyone successfully referenced Json.Net in to a Store App?
Thursday, January 10, 2013 4:21 PM
Tuesday, February 05, 2013 12:15 PMDo you know how this can be done in C#?
Wednesday, February 06, 2013 2:55 AM