Referenced assembly FSharp.Data.SqlProvider.dll has assembly level attribute but no public type provider classes were found - sql-server

How to make SQLProvider work in F#? I followed their steps but had few errors.
I run PM> Install-Package SQLProvider
Create a new .fsx script file
Load the dll #r #"C:\src\FSharpDB\DBTest\packages\SQLProvider.1.2.10\lib\net472\FSharp.Data.SqlProvider.dll"
At that stage, I have this warning:
Referenced assembly
'C:\src\FSharpDB\DBTest\packages\SQLProvider.1.2.10\lib\net472\FSharp.Data.SqlProvider.dll'
has assembly level attribute
'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute'
but no public type provider classes were found
If I continue and try to run the example script, it can't recongnised SqlDataProvider:
#r #"C:\src\FSharpDB\DBTest\packages\SQLProvider.1.2.10\lib\net472\FSharp.Data.SqlProvider.dll"
open FSharp.Data.Sql
type Sql = SqlDataProvider<
Common.DatabaseProviderTypes.MSSQLSERVER,
"Server=myServer;Database=myDB;Trusted_Connection=True;">
Error:
The type 'SqlDataProvider' is not defined.
Am I missing anything?
Edit:
As asked in the comments below, more information on the project configuration
App.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>
packages.config
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FSharp.Core" version="6.0.1" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net48" />
<package id="SQLProvider" version="1.2.10" targetFramework="net48" />
<package id="System.IO" version="4.3.0" targetFramework="net48" />
<package id="System.Net.Http" version="4.3.4" targetFramework="net48" />
<package id="System.Runtime" version="4.3.1" targetFramework="net48" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net48" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net48" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net48" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.2" targetFramework="net48" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net48" />
</packages>

Related

I don't know why my app doesn't show ads?

I created an app, I added react-native-admob and linked it
I changed /node_modules/react-native-admob/android/build.gradle file:
compile 'com.google.android.gms:play-services-ads:+'
to
compile 'com.google.android.gms:play-services-ads:15.0.0'
and then build the apk with "./gradlew clean && ./gradlew assembleRelease", but when I install the app in my phone it doesn't show ads.
This is my code
import {
AdMobBanner,
AdMobInterstitial,
PublisherBanner,
AdMobRewarded,
} from 'react-native-admob';
....
<View>
<AdMobBanner
adSize="fullBanner"
adUnitID="ca-app-pub-2174326550695558/6129769558"
onAdFailedToLoad={error => console.error(error)}
/>
</View>
Here is my AndroidManifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.brawlcalculator">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".MainApplication"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
In your AndroidManifest.xml file:
Add you admob application id to a meta tag inside your application tag
<application
android:name=".MainApplication"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="#style/AppTheme"
> // Look at this ... after the closing tag
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-2174326550695558~2753605675"
/>
</application>

wpf app msi created by wix not working due to dependency issue?

Here is my solution.
I have a basic wpf application which uses cefsharp to show google.com. The app works fine when run from my bin folder in VisualStudio itself.
For this application I have created the following WiX file:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"><?define WpfApplication6_TargetDir=$(var.WpfApplication6.TargetDir)?>
<Product Id="*" Name="SetupProject1" Language="1033" Version="1.0.0.0" Manufacturer="acv" UpgradeCode="PUT-GUID-HERE">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="SetupProject1" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="SetupProject1" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<!-- <Component Id="ProductComponent"> -->
<!-- TODO: Insert files, registry keys, and other resources here. -->
<!-- </Component> -->
<Component Id="WpfApplication6.exe" Guid="*">
<File Id="WpfApplication6.exe" Name="WpfApplication6.exe" Source="$(var.WpfApplication6_TargetDir)WpfApplication6.exe" />
</Component>
<Component Id="WpfApplication6.exe.config" Guid="*">
<File Id="WpfApplication6.exe.config" Name="WpfApplication6.exe.config" Source="$(var.WpfApplication6_TargetDir)WpfApplication6.exe.config" />
</Component>
<Component Id="CefSharp.WinForms.dll" Guid="*">
<File Id="CefSharp.WinForms.dll" Name="CefSharp.WinForms.dll" Source="$(var.WpfApplication6_TargetDir)CefSharp.WinForms.dll" />
</Component>
<Component Id="CefSharp.dll" Guid="*">
<File Id="CefSharp.dll" Name="CefSharp.dll" Source="$(var.WpfApplication6_TargetDir)CefSharp.dll" />
</Component>
<Component Id="CefSharp.Core.dll" Guid="*">
<File Id="CefSharp.Core.dll" Name="CefSharp.Core.dll" Source="$(var.WpfApplication6_TargetDir)CefSharp.Core.dll" />
</Component>
</ComponentGroup>
</Fragment>
This code creates the setup, and when the application runs after installing the following exception occurs: Could not find cefsharp.core or one of its dependencies is not loaded.
This error appears when Visual c++ is not present.
How do I fix this, as I have Visual c++ installed.
Should I add any references in my WiX file?

Breeze.js 1.53 possible breaking changes from Breeze.js 1.5.1

I am using a subdomain on my hosted website for this application. So imi.{url} goes directly to the folder with the app. Breeze 1.5.3
I have another site running on a different subdomain that uses 3 breeze controllers successfully. Breeze 1.5.1
Both apps Angular 1.3n
The imi (problem) app uses a single breeze controller with the default name BreezeController.
The app is a Hot Towel SPA and runs fine in VS2013 against the web hosted MSSQL database.
When I upload the website to the serve the first call to the breeze/Breeze/Metadata gets a 404
http://imi.mysite.com/imi/breeze/Breeze/Metadata
in the other app
http://qui.mysite.com/qui/breeze/Quoting/Metadata
works fine.
I have compared the webconfig files and adjusted the imi webconfig to match the working app
these are the files being using in the working app
<package id="Angular.UI" version="0.4" targetFramework="net45" />
<package id="Angular.UI.Bootstrap" version="0.12.0" targetFramework="net45" />
<package id="angularjs" version="1.3.2" targetFramework="net45" />
<package id="AngularJS.Animate" version="1.3.2" targetFramework="net45" />
<package id="AngularJS.Core" version="1.3.2" targetFramework="net45" />
<package id="AngularJS.Route" version="1.3.2" targetFramework="net45" />
<package id="AngularJS.Sanitize" version="1.3.2" targetFramework="net45" />
<package id="angularjs.TypeScript.DefinitelyTyped" version="2.2.2" targetFramework="net45" />
<package id="angular-translate.TypeScript.DefinitelyTyped" version="0.9.0" targetFramework="net45" />
<package id="bootstrap" version="3.3.0" targetFramework="net45" />
<package id="Breeze.Angular" version="1.0.1" targetFramework="net45" />
<package id="Breeze.Angular.Directives" version="1.3.9" targetFramework="net45" />
<package id="Breeze.Client" version="1.5.1" targetFramework="net45" />
<package id="Breeze.Server.ContextProvider" version="1.5.1" targetFramework="net45" />
<package id="Breeze.Server.ContextProvider.EF6" version="1.5.1" targetFramework="net45" />
<package id="Breeze.Server.WebApi2" version="1.5.1" targetFramework="net45" />
<package id="Breeze.WebApi2.EF6" version="1.5.1" targetFramework="net45" />
<package id="EntityFramework" version="6.1.1" targetFramework="net45" />
<package id="FontAwesome" version="4.2.0" targetFramework="net45" />
<package id="HotTowel.Angular" version="2.3.0" targetFramework="net45" />
<package id="HotTowel.Angular.Breeze" version="2.3.0" targetFramework="net45" />
And these are the relevant files being used in the new app, running on the same web server
package id="Angular.UI.Bootstrap" version="0.12.0" targetFramework="net45" />
<package id="Angular.UI.Utils" version="0.2.1" targetFramework="net45" />
<package id="AngularJS.Animate" version="1.3.8" targetFramework="net45" />
<package id="AngularJS.Core" version="1.3.8" targetFramework="net45" />
<package id="AngularJS.Route" version="1.3.8" targetFramework="net45" />
<package id="AngularJS.Sanitize" version="1.3.8" targetFramework="net45" />
<package id="angular-moment" version="0.9.0" targetFramework="net45" />
<package id="angular-smart-table" version="1.4.8" targetFramework="net45" />
<package id="bootstrap" version="3.3.2" targetFramework="net45" />
<package id="Breeze.Angular" version="1.1.0" targetFramework="net45" />
<package id="Breeze.Angular.Directives" version="1.3.9" targetFramework="net45" />
<package id="Breeze.Client" version="1.5.3" targetFramework="net45" />
<package id="Breeze.Server.ContextProvider" version="1.5.3" targetFramework="net45" />
<package id="Breeze.Server.ContextProvider.EF6" version="1.5.3" targetFramework="net45" />
<package id="Breeze.Server.WebApi2" version="1.5.3" targetFramework="net45" />
<package id="EntityFramework" version="6.1.2" targetFramework="net45" />
<package id="FontAwesome" version="4.2.0" targetFramework="net45" />
<package id="HotTowel.Angular" version="2.3.3" targetFramework="net45"
In the 1.5.3 app the first call to Breeze/Metadata fails as described above, though it does not fail when running against the same connection string from Visual Studio.
I have also found that locally the breezeSaveErrorExtensions.js throws an unhandled error that it cannot find breeze when installed exactly as in the 1.5.1 app.
Am I missing a file, do I have some version mismatch or is there a breaking change I am not taking into account?
There is no evidence of a breaking change between Breeze 1.51 and 1.53.
The problem was failure to have the Breeze dlls fully-trusted. This was not a problem when run locally but of course became a problem when deployed.
In Chrome dev tools there was just a 404 failure to return Metadata. Could have cleared it up much more quickly if I had also tested in Firefox which correctly said the problem was that BreezeWebApi2 needed to be fully trusted.
Adding
to in the web.config (as I had done long ago but forgotten about in the app mentioned above that worked fine) resolved the issue.
Moral: browser dev tools have their own strengths and weaknesses and testing with multiple browser tools can be quite helpful in resolving problems.

Wix installer error code 2343 received for a simple configuration. (WIX Newbie)

I am receiving the following error when using the following simple WIX configuration. The application being installed is WPF.
Product: Web Miner Installer -- The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2343. The arguments are: , ,
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Application Title" Language="1033" Version="1.0.0.0" Manufacturer="Avant Prime" UpgradeCode="855a8b6e-c576-41e2-8118-8f3511613478">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="Application Title" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
<UIRef Id="WixUI_InstallDir" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
<DirectoryRef Id="ShortcutFolder">
<Component Id="ShortcutsComponent" Feature="ProductFeature" Guid="{B40F2C3F-CACC-4196-8F8F-C0F6B082404E}">
<CreateFolder Directory="ShortcutFolder" />
<RemoveFolder Id="RemoveShorcutFolder" Directory="ShortcutFolder" On="uninstall" />
<Shortcut Id="UninstallProduct"
Name="Uninstall xxxxxxx"
Target="[System64Folder]msiexec.exe"
Arguments="/x [ProductCode]"
Directory="ShortcutFolder"
Description="Uninstalls xxxxxxx"/>
<RegistryValue Id="RegistryShortcut"
Root="HKCU"
Key="SOFTWARE\xxxxxx\settings"
Name="Shortcut"
Value="1"
Type="integer"
KeyPath="yes" />
</Component>
</DirectoryRef>
<PropertyRef Id="NETFRAMEWORK45" />
<Condition Message="This setup requires the .NET Framework 4.5.1 to be installed.">
Installed OR NETFRAMEWORK45
</Condition>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramMenuFolder">
<Directory Id="ShortcutFolder" Name="xxxxxx"></Directory>
</Directory>
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="xxxxxxx" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="ProductComponent">
<File Source="$(var.MyApplication.TargetPath)" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
What am I missing or doing wrong?
Here is the requested log information. It is big so I attached a link.
WIX Installer Error Log
You should replace INSTALLLOCATION with the real property (INSTALLFOLDER in your case)

Starting tvout via "am start"

i have a widget to switch to tvout
I d like to start that widget manually via "am start" command.
This the manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="8" android:versionName="2.2.1" package="com.archos.tvoutwidget"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8" />
<uses-feature android:name="android.hardware.tvout" />
<application android:label="#string/app_name" android:icon="#drawable/app_icon">
<activity android:label="#string/app_name" android:name=".TvOutWidget" android:screenOrientation="landscape" android:configChanges="orientation" />
<receiver android:label="#string/app_name" android:icon="#drawable/app_icon" android:name="TvOutWidgetProvider">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="archos.intent.action.ARCHOS_UPDATE_TVOUT_WIDGET" />
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="#xml/tvout_widget_info" />
</receiver>
</application>
</manifest>
Is this possible ?
Yes, this is possible. Just use:
am start -n com.archos.tvoutwidget/.TvOutWidget
You can start any app using:
am start -n package_name/activity_name

Resources