Don't show Vaadin messages during TestBench test run (#PreserveOnRefresh, reload) - vaadin-testbench

How can I get rid of the dismiss messages displayed during a Vaadin TestBench test run in the right lower corner? Clicking by human does not help. Messages will appear on next test run.
image: dismiss messages
#PreserveOnRefresh enabled
Java live reload unavailable
Vaadin 23

You should run tests in Production Mode by setting vaadin.productionMode to true. This will disable the developer mode widget. If you're using Maven, you might have a separate profile for this purpose, such as
<profile>
<!-- Production mode is activated using -Pproduction -->
<id>production</id>
<properties>
<vaadin.productionMode>true</vaadin.productionMode>
</properties>
<!-- ... -->
With Gradle, put
vaadin {
productionMode = true
}
in your build.gradle file.

Related

how to exclude(disable) PackageReference's (transitive)dependency in MSBuild?

I'm using a package Xamanimation which has a dependency of Xamarin.Forms 4.1.0( written in its nuspec file):
<dependencies>
<group targetFramework=".NETStandard2.0">
<dependency id="Xamarin.Forms" version="4.1.0.581479" exclude="Build,Analyzers" />
</group>
</dependencies>
but I have built the Xamarin.Froms for my own and added the output dll files into my project's reference:
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\thirdparty\xforms\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
according to the nuget's doc, I add the ExcludeAssets attribute(and other tests) to the section of PackageReference of Xamanimation:
<PackageReference Include="Xamanimation">
<IncludeAssets>compile</IncludeAssets>
<!-- <ExcludeAssets>compile</ExcludeAssets> -->
<!-- <PrivateAssets>all</PrivateAssets> -->
<!-- <ExcludeAssets>buildtransitive</ExcludeAssets> -->
<Version>1.3.0</Version>
</PackageReference>
but none of them work!
MSBuild will always use the trasitive dependency Xamarin.Forms.4.1.0 and ignore my own build ones( in which I have add new classes and use them in the main project so the linking failure is indicating the choosen is the old one).
so what's the correct method to exclude the transitive dependency?
I spend a whole day learning into this question and finally got a reasonable answer.
so I'd like to post my first LONG answer in stackoverflow by my poor english.
TL'DR:
the MSBuild's nuget plugin's ResolveNuGetPackageAssets target do the evil thing, make a custom target to revert it, go to bottom for the task code.
Studying story
first, I made a similar but simpler copy of this problem for studying.
after all, building a xamarin project is too slow,
the demo source is in github,
it has four project:
ConflictLib: the library used both by another lib and main application
DirectLib: the library used by main application, and is using ConflictLib
MyAppDev: the main application, with above two library as ProjectReference
MyAppConsumer: the other application, using DirectLib by PackageReference, and ConflictLib as ProjectReference. to test this situation, I pushed the ConflictLib and DirectLib to nuget.org, then made modify to local version of ConflictLib, so I can verify which one is using.
these projects and their relationship are very similar to my origin problem, the key point is : when application use a library with two different version simutanously, will(should) the local one(ProjectReference or HintPath) win?
for my origin case, xamarin project, it's No, so I come to study it.
for the test case, a dotnet core console project, it's Yes, so there must be something mysterious in the building process: MSBuild, which is a huge system, but now I'm going to dig into it.
then, I need a inspecting tool to find out what MSBuild does when building a project.
the simple tool is just invoke it in command line, it will display all the targets executed. a msbuild target is something like a target in makefile, and the tasks in target are similar to commands in makefile, the concept exist with slightly different term in many other system such as gradle, so it's easy to understand.
but, there are so many targets and tasks, and all they depend on others and interactive though Property and Items, it's hard to learn which target break my need from the text log.
fortunately, there's an advanced tool for inspecting everything in MSBuild: it's called MSBuild structured log viewer, I learn it from here.
now build the project with /bl option, it will produce a binary log file with full info, open it by the viewer mentioned above:(my origin xamarin project's build log)
obvious, the ResolveNuGetPackageAssets target changes the Reference items, which decides the final linked library assembly.
but why it doesn't make the wrong decision in the test case? let's view its log:
got the difference? -- there's no ResolveNuGetPackageAssets target!
it's same from ResolveReferences to ResolveAssemblyReferences, but diff in the nuget part.
while double clicking at ResolveAssemblyReferences, the viewer will open the targets file in which the target be defined.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets
it's still same for both case:
ResolveAssemblyReferences doesn't depend on ResolveNuGetPackageAssets, so where does the later come? just click at it, the file opens:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\NuGet\16.0\Microsoft.NuGet.targets
it overrides ResolveAssemblyReferencesDependsOn and add the ResolveNuGetPackageAssets to dependency of ResolveAssemblyReferences.
the last question: why the above NuGet.targets file not appear in the test case? it could still answered by the viewer's Evaluation section:
clearly, this file is not imported because a property SkipImportNuGetBuildTargets set to true. after a simple search, I confirmed it's the default value in test case: it's set in Microsoft.NET.Sdk.targets. but in xamarin case, it's not set and means false, so all the things happened.
finally, I have to figure out some measures to fix the problem.
first of all, I won't add the SkipImportNuGetBuildTargets property to xamarin project, because I think it's a framework design and maybe has a great impact on others, I just want to fix a little, specific problem.
I decide to add a custom target immediately after the ResolveAssemblyReferences, remove the Nuget's Xamarin.Forms and add my own ones -- just revert what ResolveNuGetPackageAssets does.
the task code is simple (only just after I have written, actually it cost me lot of time to search for grammar/builtin function/etc and test):
notice how the Remove Item(see msbuild doc) works (and not work: the commented lines), I still don't understand it exactly, but it did work!

UWP app errors when built in .Net Native

We've got a Windows 8.1 app that we've converted to a Windows 10 UWP app. The app works fine in debug, but when running in Release (.Net Native), we are getting a runtime error on app load. It's not at all clear what's causing the error. The error happens in the OnLaunched event in App.xaml.cs where some data is being initialized. The error:
An exception of type System.NullReferenceException occurred in
System.Private.CoreLib.dll
Additional information: Arg_NullReferenceException
We're using the latest versions of MVVM Light.
I know this isn't a lot of info, but it's really all we have right now and are pretty stumped. Anyone seen and issue like this or know where to start in tracking it down?
If, you're still using SQLite or any Reference.
Please Right Click to your Project => Add => Reference => Make sure your DLL of Nuget is checked.
Please Check this solution.
I had this exact problem in that I converted an 8.1 app to UWP. This was resolved by including a file called Default.rd.xml in the Properties folder. This was not mentioned in the migration guide that I had used.
Not including it means some pretty common coding patterns such as reflection will not work, and this includes in imported .dll's.
A basic Default.rd.xml file looks like the following ...
<!--
This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
developers. However, you can modify these parameters to modify the behavior of the .NET Native
optimizer.
Runtime Directives are documented at https://go.microsoft.com/fwlink/?LinkID=391919
To fully enable reflection for App1.MyClass and all of its public/private members
<Type Name="App1.MyClass" Dynamic="Required All"/>
To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
Using the Namespace directive to apply reflection policy to all the types in a particular namespace
<Namespace Name="DataClasses.ViewModels" Serialize="All" />
-->
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Application>
<!--
An Assembly element with Name="*Application*" applies to all assemblies in
the application package. The asterisks are not wildcards.
-->
<Assembly Name="*Application*" Dynamic="Required All" />
<!-- Add your application specific runtime directives here. -->
</Application>
</Directives>
If this does not work, then try creating a new empty UWP project to get the latest format for the file.

When Spring Boot application running by Intelij Idea views can`t be resolved

I have encountered a strange situation, the decision which I cant find.
I`m runnig simple demo application using Spring Boot 1.3.0 and Intelij Idea 14.1.3
The problem is that Spring MVC cant resolve the view:
javax.servlet.ServletException: Could not resolve view with name 'home' in servlet with name 'dispatcherServlet'
Oddity is that when I run application by Maven Spring Boot-plugin
mvn clean spring-boot:run
everythig works fine.
Both views ("home.jsp" - returning from Controller and "start.jsp" - described in Configuration class) resolve correctly.
Full source code you can see here
I`ve downloaded another demo project - the same situation.
So, I think that something wrong with my IDE configuration.
But what is going wrong - I don`t know.
In File->Project Structure
I have added Spring and web module in "Modules" tab, the same I`ve made in "Facets" tab.
What is possible to do to make application run correctly using IDE?
Problem was in dependecies configuration in pom.xml
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
I have change <scope>provided</scope> to <scope>compile</scope> and it works well.

I have an issue running an imported project on flex 4

Process terminated unexpectedly.
initial content not found
Launch command details: "C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.0.0\bin\adl.exe" -runtime "C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.0.0\runtimes\air\win" "C:\Users\acer\Adobe Flash Builder 4\Dental Clinic_2\Main-app.xml" "C:\Users\acer\Adobe Flash Builder 4\Dental Clinic_2"
I get this error when I try to run the program...this is my first time to import other projects.. I dont have this problem with my own program this just appeared from the project I imported...could someone help me..
change application tag and version to 1.5:
Process terminated without establishing connection to debugger.
Invalid application descriptor. Unknown http://ns.adobe.com/air/application/3.1
I could not get any flex air project to run in my flash builder, changing this line in the Main-app.xml allowed the project to run. Something about flex air requiring a minimum of the 2.6 SDK to run, even though I am going through the flash 4.5.1 SDK.
<application xmlns="http://ns.adobe.com/air/application/2.6">
I encountered the same error when I was developing a mobile application in Flash Builder 4.7 (Flex 4.6.0, Air 3.5). It turned out that auto-formatting the application-descriptor XML-file (Main-app.xml) was the problem.
In an application-descriptor XML-file there should be a <content> element like
<!-- The main SWF or HTML file of the application. Required. -->
<!-- Note: In Flash Builder, the SWF reference is set automatically. -->
<content>[This value will be overwritten by Flash Builder in the output app.xml]</content>
Now when the application is built the build-script copies the application-descriptor to the output directory (for examle bin-debug) and should replace the contents of the <content> element with the name of the generated SWF-file, for example <content>Main.swf</content>.
After auto-formatting the application-descriptor (pressing [ctrl] + [shift] + [F] in Flashbuilder) the element looked like
<!-- The main SWF or HTML file of the application. Required. -->
<!-- Note: In Flash Builder, the SWF reference is set automatically. -->
<content>[This value will be overwritten by Flash Builder in
the output app.xml]
</content>
Note the linebreaks that have been inserted within and after the text-contents.
Now the build-script was no longer able to replace the text-contents with the name of the SWF-file. So in the resulting application-descriptor in the output folder (bin-debug) the <content> element still contained the formatted place-holder content. Hence the SWF-file could not be found and the 'initial content not found' error occured.

flashdevelop not compiling correctly

When I try to compile my application in flash develop. it wont compile. even if I put a simple trace in the Main class. Nothing happen. the sdk is in the correct place.
You can try a few different things. But make sure for these tests that you have a trace in your main constructor.
First, go to your project settings (Project > Properties). On the Output tab un-check "no output", and select "Play in popup" in the "Test Movie" drop down menu. Then test your application (F5).
Take not of a few things; What appears in the output panel (if you don't have it open, go to View > Output Panel). Does it show something like this?
/*
Running process: C:\Program Files\FlashDevelop\Tools\fdbuild\fdbuild.exe ...
Using the Flex Compiler Shell.
Building ProjectName
mxmlc -load-config+=obj\ProjectNameConfig.xml -debug=true ...
Starting new compile.
Loading configuration file C:\Flash\flex_sdk_3\frameworks\flex-config.xml
Loading configuration file C:\Flash\Projects\ProjectName\obj\ProjectNameConfig.xml
obj\ProjectName634012614944137992 (228743 bytes)
(fcsh)Build succeeded
Done (0)
[Capturing traces with FDB]
*/
Are you missing any of the above lines in your output panel while testing you application?
If you don't see any of this in your output, or your own trace, then create a new test project, add a trace, and try again.
do you have it linked to the compiler correctly?
There is a chance that upgrading the compiler or FD could have changed the setting.
Also you could try compiling through the Flash IDE. As a test or a solution.

Resources