Why VS2019 marks my extension as deprecated - visual-studio-extensions

I don't use VSIX for integration (supports old VS and SSMS). Installer puts all dlls to "program files" and pkgdef and manifest to specific folders. Currently VS2019 shows message that my extension use "deprecated API".
Image with message from learn.microsoft.com but it's the same.
I done this steps:
I created asyncPackage (now empty).
Added with
Microsoft.VisualStudio.Component.CoreEditor to vsixmanifest
Generated catalog.json and manifest.json using code from here
My package looks so (constructor is empty now)
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
[InstalledProductRegistration("#110", "#112", "7.1.7", IconResourceID = 115)]
[ProvideMenuResource("MyMenus.ctmenu", 1)]
[ProvideAutoLoad(GuidList.ShellInitialized, PackageAutoLoadFlags.BackgroundLoad)]
[ProvideAutoLoad(VSConstants.UICONTEXT.NoSolution_string, PackageAutoLoadFlags.BackgroundLoad)]
[System.Runtime.InteropServices.Guid(GuidList.guidMyPkgString)]
public sealed class MyPackage : AsyncPackage {
But VisualStudio shows message about deprecated API again and again. What I missed? What VS checks during package loading?
Edit: I created AsyncPackage, added attributes, updated integration files to VsixV3. Why VS loads extension synchronously?

For whom this can help to resolve the same issue.
As I mentioned above we don't use VSIX. And all files are coping by installer. The issue was that this was missed:
[$RootKey$\Packages\{YOUR PACKAGE GUID}]
#="YOUR PACKAGE NAME"
"AllowsBackgroundLoad"=dword:00000001
I've found it during checking all packages in private registry privateregistry.bin
Also don't forget about UI Context if you are using it:
[$RootKey$\AutoLoadPackages\$UICONTEXT_GUID}]
"$YOUR_PACKAGE_GUID”= dword:00000002
Thanks to MS git

Related

"TS2729 [ERROR]: Property 'boundary' used before its initialization" in extern library

After updating my deno version to 1.9 today I had started having the following problem when running my tests or my scripts:
TS2729 [ERROR]: Property 'boundary' is used before its initialization.
readonly dashBoundary = encoder.encode(`--${this.boundary}`);
~~~~~~~~
at https://deno.land/std#0.63.0/mime/multipart.ts:266:52
'boundary' is declared here.
constructor(reader: Deno.Reader, private boundary: string) {
~~~~~~~~~~~~~~~~~~~~~~~~
at https://deno.land/std#0.63.0/mime/multipart.ts:269:36
I checked and I am not using the mime repository anywhere in my code, instead some other repositories must use it.
I am using the following repositories:
x/abc
std/uuid
std/fs
std/path
std/fmt
std/testing
I made sure that I am explicitely using the newest version for all of the imports of the std library (std version 0.93.0).
When I am running the files that are importing the std library (instead of running the entire application) no errors occur.
Does anyone have an idea how to resolve the error?
It seems like the repository x/abc was the problem.
I did not add a version when importing it implicitly. When importing implicitly it in the following way it worked:
import abc from "https://deno.land/x/abc#v1.3.1/mod.ts";

Unity/Firebase - Project Bundle ID does not match any bundle IDs in your google-services.json files

I'm making a mobile game on Unity, Android first.
And now I'm integrating firebase analytics.
After set info on Firebase Console and put google-services.json file into Unity project, Unity shows an error saying :
Project Bundle ID com.RetroSpirit.ToiletRush does not match any bundle IDs in your google-services.json files
This will result in an app that will fail to initialize.
Available Bundle IDs:
You need to either:
* Fix your app's bundle ID under "Player Settings --> Bundle Identifier"
or:
* Add another app to your firebase project
Goto https://firebase.google.com/docs/unity/setup#add_firebase_to_your_app_1
and add the new configuration file to your project.
UnityEngine.Debug:LogError(Object)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:LogErrorIfEnabled(String)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:FindGoogleServicesFile(SortedDictionary`2, String, LogMessage, LogMessage)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:FindGoogleServicesFile(String, LogMessage, LogMessage)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:UpdateJson(Boolean, LogMessage, LogMessage)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:OnPostprocessAllAssets(String[], String[], String[], String[])
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[])
UnityEditorInternal.InternalEditorUtility:ProjectWindowDrag(HierarchyProperty, Boolean)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Here's the part of google-services.json,
"client": [
{
"client_info": {
"mobilesdk_app_id": "*:***********:android:****************",
"android_client_info": {
"package_name": "com.RetroSpirit.ToiletRush"
}
},
"oauth_client": [
{
"client_id": "***********-********************************.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.RetroSpirit.ToiletRush",
"certificate_hash": "****************************************"
}
I don't know what should I check.
Project Bundle ID (the Package name on Build Settings - Other Settings - Identification) is exactly same as package_names in google-services.json.
Any ideas?
My case was in Unity and to fix it I added the google-services.json from the firebase project to the assets folder. I had only the GoogleService-Info.plist before.
Little bit funny to answer myself...
I found the reason of problem accidently. There was something wrong with my VC runtime so generate_xml_from_google_services_json.exe couldn't extract package name from google-services.json. (vc90.crt.manifest could not be extracted!)
Unfortunately, I couldn't fix that runtime error despite so many re-install of Visual Studio, VC Runtime and .net frameworks. Finally I re-installed Windows 10 and the problem just gone away... Still don't know what caused this error.
I understand you have fixed this by re-installing Windows but this is how I got passed this problem in case anyone else runs into this:
Make sure you have set your Package Name in Unity player settings (Edit > Project Settings > Player > Other Settings > Identification > Package Name).
Set to the same one you set up in Firebase (looks like com.CompanyName.ProductName).
Make sure you have imported the Firebase assets into your Unity project as described here https://firebase.google.com/docs/unity/setup and that the Firebase folder exists in Assets > Firebase. Changing the location of this folder seems to break things.
In our case we solved the issue by requesting a new google-services.json file from a collegue who has admin rights.
In my case, the issue was with the Package Name. So I followed the following steps and solved the problem:
Change the package name (com.companyname.appname) [everything in lowercase]
Delete the existing keystore
Add a new keystore and generating a fingerprint with Keytool
Delete the current app from the Firebase console
Add a new app with the correct package name and the generated fingerprint
download google-services.json again and Import to Unity under the Assets folder
Done! It works!!
hey everyone I found a fix to this issue I'm using mac pro m1
step to fix
reinstall visual studio
download Microsoft.NET.Sdk.Android from the visual studio website
restart the project
and after that, it will fix

Unable to update database to match the current model. Failing only on self hosting project

The following code:
Database.SetInitializer
(new MigrateDatabaseToLatestVersion<Db, Migrations.Configuration>(true));
using (var C = new Db())
{
Console.WriteLine(C.Usuarios.Count());
}
Works on a console test project but on the other console with self-hosting it fails with the Unable to update database to match the current model... migration error
Obviously the migrations are up to date since the other project runs fine and they both do the same configuration since the database model and the migration configuration are on a separated library
I tracked down the problem to the Newtonsoft.Json library.
The package Microsoft.AspNet.WebApi.Client depends on the version 6.0.4 of this library which seems to have conflicts with Entity Framework.
Just upgrading the Newtonsoft.Json with Install-Package Newtonsoft.Json solves the problem

Jasper Reports "package net.sf.jasperreports.engine does not exist" exception in JDeveloper 11.1 using WebLogic only in EAR Web Page

I'm using JDeveloper 11.1, Oracle 11 and TIBCO JasperReports 6.0.1.
I'm having problems trying to generate Jasper Reports from my web page (ViewController) while using an ApplicationModule (Model - EJB) for doing that. At the end the PDF file has to be sent via email, that's why I let it into the Model project.
If I execute the ApplicationModule, it works fine, no exceptions, the PDF is very well generated and sent.
However, if I execute the client method since a web page I got this exception :
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
C:\Users\rodmar\AppData\Roaming\JDeveloper\system11.1.1.7.40.64.93\DefaultDomain\Simple_Blue_1429546047623_56582.java:4: package net.sf.jasperreports.engine does not exist
import net.sf.jasperreports.engine.*;
^
C:\Users\rodmar\AppData\Roaming\JDeveloper\system11.1.1.7.40.64.93\DefaultDomain\Simple_Blue_1429546047623_56582.java:5: package net.sf.jasperreports.engine.fill does not exist
import net.sf.jasperreports.engine.fill.*;
^
C:\Users\rodmar\AppData\Roaming\JDeveloper\system11.1.1.7.40.64.93\DefaultDomain\Simple_Blue_1429546047623_56582.java:18: cannot find symbol
symbol: class JREvaluator
public class Simple_Blue_1429546047623_56582 extends JREvaluator
^
C:\Users\rodmar\AppData\Roaming\JDeveloper\system11.1.1.7.40.64.93\DefaultDomain\Simple_Blue_1429546047623_56582.java:25: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Blue_1429546047623_56582
private JRFillParameter parameter_REPORT_LOCALE = null;
^
C:\Users\rodmar\AppData\Roaming\JDeveloper\system11.1.1.7.40.64.93\DefaultDomain\Simple_Blue_1429546047623_56582.java:26: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Blue_1429546047623_56582
private JRFillParameter parameter_Description = null;
^
C:\Users\rodmar\AppData\Roaming\JDeveloper\system11.1.1.7.40.64.93\DefaultDomain\Simple_Blue_1429546047623_56582.java:27: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Blue_1429546047623_56582
private JRFillParameter parameter_JASPER_REPORT = null;
^
C:\Users\rodmar\AppData\Roaming\JDeveloper\system11.1.1.7.40.64.93\DefaultDomain\Simple_Blue_1429546047623_56582.java:28: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Blue_1429546047623_56582
private JRFillParameter parameter_REPORT_VIRTUALIZER = null;
^
I'm just pasting a fragment.
I'm using other .jars as POI, for reading .xlsx files and inserting then into database so I don't know why I can access POI without any problem but at the same time I don't have Jasper Reports available.
I have already searched some solutions in the web but nothing solves my problems. I get some information about jdt-compiler but I don't find it into JasperReports suite. My project is really a mess with all these libraries, maybe I'm missing or adding too many ?
My EAR project at the moment is like this :
The EAR\lib:
This is a kind of a problem for jars settings, or something like that. I had already found this page but it is really strange, I don't think that my issue is something so complicated.
http://docs.oracle.com/cd/E25178_01/fusionapps.1111/e15524/adv_wls_e.htm
EDIT 1 :
I tried to look to my classpath using this code :
ClassLoader cl = ClassLoader.getSystemClassLoader();
URL[] urls = ((URLClassLoader)cl).getURLs();
for (URL url: urls) {
logger.info(String.format("Classpath: %s.", url.toString()));
}
And I get this output. POI is not here but why, I'm using it without any problems while I'm not been capable of using JasperReports ?
1 ) Is POI.jar by default used in WebLogic 10.3 basic installation ? NO
EDIT 2 :
I've discovered that in WebLogic is necessary to access weblogic.utils.classloaders.GenericClassLoader which sends me all the libraries that belong to this EAR application. Using it, Jasper Reports are available however I don't know what to do to access them successfully...
GenericClassLoader jre = (GenericClassLoader) JREvaluator.class.getClassLoader();
logger.info(String.format("jre: %s, s.", jre, jre.getClassPath()));
Thanks you very much,
Well, as somebody says it was necessary to use jdt-compiler-3.1.1.jar. I added it to /lib folder and now it is working.
It's really strange that this .jar is not in the installation product for TIBCO Jasper Reports 6.0.0 actually I descend until JR 3.7.6 which is the lowest version. The file is from 28/12/2008...
Nice...
I used eclipse ecj-4.3.1.jar and it works.
First checks the dependencies of jasperReports - for example version 6.1.0 - https://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports/6.1.0
With this you can see if there is any dependency that is missing in your lib directory (webApp) or inside your .jar (if it is a main application of java).
That mistake also happened to me, and I solved it by adding dependence
<groupId>org.eclipse.jdt.core.compiler</groupId>
<artifactId>ecj</artifactId>
<version>4.3.1</version>
I hope it supports you

ASP.net app crashes - Could not load file or assembly 'Microsoft.Threading.Tasks.Extensions.Desktop'

I want to build a Google BigQuery C# ASP.net application using OAuth2 and the .Net 4.5 framework. I ran these NuGet installs
Install-Package Google.Apis.Bigquery.v2 -Pre
Install-Package Google.Apis.Authentication.OAuth2 -Version 1.2.4696.27634
Install-Package Google.Apis -Pre
Install-Package Google.Apis.Auth -Pre
and I placed the relevant "usings" in code-behind file "default.aspx.cs":
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Google.Apis.Auth.OAuth2;
using Google.Apis.Services;
using Google.Apis.Bigquery.v2;
using Google.Apis.Bigquery.v2.Data;
namespace BigQueryDemoApp
{
public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
UserCredential credential;
FileStream stream;
using (stream = new FileStream(
Server.MapPath("~/client_secrets.json"),
FileMode.Open, FileAccess.Read)
)
{
GoogleWebAuthorizationBroker.Folder =
"Tasks.Auth.Store";
credential = GoogleWebAuthorizationBroker.
AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets,
new[] { BigqueryService.Scope.Bigquery },
"user", CancellationToken.None).Result;
}
// Initialize the service.
var Service = new BigqueryService(
new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = "BigQueryDemo"
}
);
}
}
}
I set this specific page as the project start page. I picked "Installed application" when I built the Client ID file at the Google console
APIS & auth -> Credentials -> CREATE NEW CLIENT ID
and I made sure I added this file (client_secrets.json) with the solution explorer in VS2013. In the code-behind, I made sure that I correctly mapped to the client_secrets file with Server.MapPath. For the credential machinery, I used this code
<https://code.google.com/p/google-api-dotnet-client/wiki/OAuth2>
as the starting point. When I run the app, it returns a browser error page that starts with
Could not load file or assembly 'Microsoft.Threading.Tasks.Extensions.Desktop, Version=1.0.16.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
and crashes at the "credential =" line. I tried to add in some images of the actual ASP.net crashed browser page showing the Assembly Load Trace / Stack Trace / etc. but it looks like I don't have the account rights for this. When I set a breakpoint at the "credential =" line and then run the app through
DEBUG -> Start Debugging
in VS2013, the page stops at the "credential =" line and a file picker opens, looking for file
"GoogleClientSecrets.cs"
from directory
"c:\code\google.com\google-api-dotnet-client\default\Tools\Google.Apis.Release\bin\Debug\output\default\Src\GoogleApis.Auth\OAuth2\GoogleClientSecrets.cs"
which is nowhere on the drive. Using the Assembly Load Trace in the generated ASP.net error page, I tried digging around through the suggested configuration files but nothing worked. More generally, I tried looking for this issue in StackOverflow and while I did find some mention of it, none of that material helped.
Because the error is based on the fact that the latest version of Microsoft.Bcl.Async doesn't work in .NET 4.5, you can try to do the following:
Open your Package Manager Console, and run the following commands:
1) Uninstall-Package Microsoft.Bcl.Async -Force
2) Install-Package Microsoft.Bcl.Async -Version 1.0.16
It works in a sample I'm currently writing. Please let me know if it works for you.
UPDATE (March 21st):
You can update the package (new version 1.0.166-beta is available - https://www.nuget.org/packages/Microsoft.Bcl.Async/1.0.166-beta).
I tested it on VS2013 with .NET 4.5 framework and it works.
They released a new version of -Package Microsoft.Bcl.Async.
If somebody has this issue, please install the "latest" version instead of 1.0.16.
I hope it works for you.
I already encountered this error before. It looks like the Bcl.Async package contains a reference to Microsoft.Threading.Tasks.Extensions.Desktop when you run a .NET 4.0 applications but somehow it is missing in .NET 4.5 application.
My advice for you (until I'll figure our with the owner of Microsoft.Bcl.Async why it happens) is to copy Microsoft.Threading.Tasks.Extensions.Desktop from packages\Microsoft.Bcl.Async.1.0.165\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll to your BIN folder. It should solve this issue.
UPDATE (March 17th):
Consider adding the following Post-build event to your project:
copy /Y "$(SolutionDir)packages\Microsoft.Bcl.Async.1.0.16\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll" "$(TargetDir)Microsoft.Threading.Tasks.Extensions.Desktop.dll"
Unfortunately, there isn't a solution for this problem yet from the owners of the Bcl.Async package.
This approach did not fix the issue - I got the same runtime error. But after a rebuild, I noticed that the VS2013 compiler showed this warning, which I formatted a little for the SO editor
C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1635,5): warning
MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual
Studio, double-click this warning (or select it and press Enter) to fix the conflicts;
otherwise, add the following binding redirects to the "runtime" node in the application
configuration file:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Threading.Tasks.Extensions.Desktop" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
<bindingRedirect oldVersion="0.0.0.0-1.0.165.0" newVersion="1.0.165.0" />
</dependentAssembly>
</assemblyBinding>
so I dropped the suggested block in the app web.config file. Then the app decided to work. I have no idea why it works now, but I get the impression that the XML block and / or the reference fix you mentioned somehow touched the Microsoft.Threading.Tasks.Extensions.Desktop DLL, or some low-level machinery inside .Net, or both. Or neither, for all I know. Anyway, thanks for your help. I only wish I had a better understanding of the internal machinery.

Resources