FAILED General metadata correctness test. When using Windows App Certification Kit on my package - windows-runtime

I'm using Application Insights in my application. The App runs without any warnings or problems but when I packaged the App and ran a Windows App Certification Kit on it, it failed stating this:
FAILED General metadata correctness test
•Error Found: The general metadata correctness test detected the
following errors:◦The type
Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration
referenced by type
Microsoft.ApplicationInsights.Extensibility.RuntimeTelemetry.RemoteDependencyModule
in file
Microsoft.ApplicationInsights.Extensibility.RuntimeTelemetry.winmd was
not found. All types referenced in metadata files must be
discoverable. ◦The type
Microsoft.ApplicationInsights.Extensibility.ISupportConfiguration
referenced by type
Microsoft.ApplicationInsights.Extensibility.RuntimeTelemetry.RemoteDependencyModule
in file
Microsoft.ApplicationInsights.Extensibility.RuntimeTelemetry.winmd was
not found. All types referenced in metadata files must be
discoverable.
Does anyone have any idea how to resolve this?

It looks like you use very old Application Insights SDK version. I guess but probably it is 0.14 (The one that you get from VS 2013, this version is not updating any more because packages were renamed). You should remove that SDK version and try the new one: https://www.nuget.org/packages/Microsoft.ApplicationInsights.WindowsApps/
RuntimeTelemetry.winmd is not there any more.

Related

Error accessing WinRT sensors in C++ desktop application

I am trying to access the WinRT sensors from a Win32 desktop application using C++/CX as mentioned here: https://software.intel.com/en-us/articles/using-winrt-apis-from-desktop-applications
When I include the C++/CX header file it causes an error when building the Win32 project.
Exact error text: "error C1190: managed targeted code requires a '/clr' option."
Since I am not using /clr code at all, this is a confusing error.
Any suggestions? Please educate me if there is a better way to do this.
The error you are getting is because you are compiling some files without /ZW option for compiler. Since you are able compile at least some files with WinRT extensions, but not others, your project configuration is inconsistent.
The option /ZW (enable WinRT extensions) has to be configured on the level of project (and not on the level of individual files). There are two ways to ensure your settings are consistent. First method is through UI in Visual Studio -- you have to go through all platforms/configurations on the project and ensure /ZW is enabled, then got through all indivudual .cpp files, and ensure they don't override project level settings. This is tedious and error prone. The easier method is to open .vcxproj in notepad and do the following:
Add this section at the beginnig of the file, under root Project node:
<ItemDefinitionGroup>
<ClCompile>
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
</ItemDefinitionGroup>
Search and remove any other places where <CompileAsWinRT> is defined.

How to package a Windows Runtime component for distribution?

I have built a WinRT component (.winmd) for use by both JavaScript and XAML Windows Store apps. When including and referencing the loose .winmd file output in a JavaScript client, I see this build warning:
Microsoft.AppXPackage.Targets(808,9): warning APPX1707: No implementation file was provided for the .winmd file 'myRuntimeComponent.winmd'. To generate registration information in the app manifest, specify the 'Implementation' metadata on the .winmd reference item in the project file.
I can't find any documentation on this error or how to include implementation metadata.
When running the JavaScript client, this exception is thrown when a class method exported from the .winmd is called:
0x80040154 - JavaScript runtime error: Class not registered
Note that I am referencing the loose .winmd file in the client application project, rather than referencing the Visual Studio project that builds the .winmd. My use case is distributing the .winmd output, not the full source for the .winmd component - source distribution is not an option.
Also note that when the Windows Runtime component is referenced as a project reference, the JavaScript client builds and runs correctly. The C# XAML client runs correctly with either a project reference or a reference to the loose .winmd.
It seems as if some registration information is not being generated in the client application build when a loose .winmd is referenced.
How can I build and distribute a loose Windows Runtime component for use by both JavaScript and managed clients?
A WinRT component built with C# or VB produces a .winmd that contains both metadata and implementation. A component built with C++ provides separate .winmd and .dll files, and the DLL is what contains the details to register the component.
Apparently, as the warning indicates, you need to edit the project file with something like the following to point to the DLL:
<Reference Include="component">
<HintPath>component.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
<Implementation>component.dll</Implementation>
</Reference>
Alternatively you might want to look into Extension SDKs. See the below link for how to package your component as an easy to consume Extension SDK in VS:
http://msdn.microsoft.com/en-us/library/jj127119.aspx

Can't load a native DLL

It's a follow-up from this.
Windows Phone 8 C# project (MyApp), migrated from WP7.1. I've added a native Windows Runtime component library (AppLib) to the solution, created a reference. There's a public sealed ref class (MyClass) in it. There's a reference to it in the C# code (in OnLoaded of the main XAML page). The whole thing builds - meaning the metadata of the component is being generated.
When I'm trying to run on the emulator, the project fails with the exception or type BadImageFormatException with the following message:
An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
The error typically pops up when you try to mix CPU types in .NET.
The active platform is "Mixed platforms". In the Configuration Manager, it's configured to build MyApp for "x86" and AppLib for "Win32". In a vanilla freshly generated project that runs fine, the config is identical.
Question - what's wrong with that configuration? What do I need to check?
EDIT: I've added a second, blank C++ library to the solution - TestLib. This one loads and works as expected.
EDIT2: excluded everything from build in AppLib - it works. Now I'll be adding lines one by one, see which one causes the issue...
Totally my fault. When I changed the namespace of AppLib (see the linked question), I've left one little declaration in the library in a MyApp namespace.
The error is still misleading. I'd delete the question, but since the error message is sure to send someone on a wild goose chase with build CPU type and whatnot, let it remain.
Shouldn't a Windows Phone library be built for ARM in most cases? Have you had a chance to watch the "Windows Phone 8: Using C++ in your Applications" session from last week's //Build/ conference? That might include some answers.

Found conflicts between different versions of the same dependent assembly.MVC3 -> MVC4 / EF4 -> EF5

The question is how to resolve conflicts between versions of assemblies in my project that was upgraded to MVC4 and EF5?
The problem is manifest in the fact that my controllers and models can include System.Data.Objects, but now my views.
I am using MVC 4, my project was upgraded from MVC 3.
Entity Framework is version 5.
I have a controller that is able to use objectcontext from System.Data.Objects.
My Usings:
using System.Data.Objects;
using System.Data.Entity;
When I try to include the using in the view form System.Data.Objects, I get :
CS0234: The type or namespace name 'Objects' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
I am targeting .net 4.5
My Build Displays this message:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1561,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly.
You can build your solution in diagnostic mode to get more detailed information about the error.
Open the VS Options dialog (Tools > Options), navigate to the "Projects and Solutions" node and select "Build and Run". Change the MS Build project build output verbosity to Diagnostic.
Have a look here.
If you look at the build message, it states the 4.0 version of the .net framework is referenced... Is there a setting in your project file or web/app.config specifying a conflicting version of the .net framework?
Are you familiar with fuslog? you can set it up to log all assembly bindings that .net is doing while running your application. You should then be able to see detailed information on what is getting bound when. If you still can't figure it out, you can always do a binding redirect on that .dll in the web.config.
http://msdn.microsoft.com/en-us/library/eftw1fys.aspx -- binding redirects
http://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.71).aspx -- fusion log viewer
Set up fusion logger and take a look at what the output is. If you don't get an answer from that, try the binding redirect (which would give you at least a temporary solution).
In the directory I was publishing to, there was a folder named aspnet_client. I moved it (instead of deleting it), republished, and it worked. I'm not sure why that folder decided to give me trouble out of the blue.

MySQL T4 Templates Error: Metadata file 'MySql.Data' could not be found

D:\Web\CityV2\App_Code\ActiveRecord.tt(0,0) : error CS0006: Compiling transformation: Metadata file 'MySql.Data' could not be found
Let me start by saying I'm using VWD 2008 Express.
These are the steps I've taken so far:
Created an entirely new project
Added references for Subsonic.Core.dll and MySql.Data.dll
Copied Active Record templates to project
Changed all <## include file="SQLServer.ttinclude" #> to <## include file="MySQL.ttinclude" #>
Copied the MySQL.ttinclude and Settings.ttinclude from the TemplateProviders folder
Updated Settings.ttinclude with my connectionstring and database information
Updated the Settings.ttinclude and created the external tool mapping as per ranomore's instructions
Attempted to build the code from the templates and received the error
I then realized that I didn't have MySql Connector "installed" on my dev box (even though I added a reference to the bin). So I proceeded to MySQL.com and downloaded the latest 6.0.4 connector msi and installed it (GAC). The error no longer appears, but neither does anything else: no new classes, no new errors, nothing [and yes, I refreshed the project after running the command ;-)].
Two things:
Am I missing a step somewhere?
Is there a way build the templates without needing MySQL installed to the GAC?
Unfortunately SubSonic 3 doesn't support VWD 2008 Express (or more specifically VWD doesn't support t4). There is a sort of workaround that ranomore came up with but it will require some work by you. See the following question for more details:
SubSonic ASP.NET MVC sample in Visual Web Developer Express
EDIT: I should have read your question properly you obviously already have the link above. Maybe worth your while downloading the trial of VS professional and seeing if you have more luck with that to see if it's worth outlaying the cash to buy it.
On a side note if you're looking to get an msdn subscription for free you should have a look into registering for the bizspark program