T4 Template,debugging without error when save an error - t4

Code here!
T4 Template,debugging without error when save an error!!!
The code I can make sure there is no problem,And the debugger is normal, files are generated!
ERROR:
T4MVCGenerateInfo`2[TModel,TDbContext]' violates the constraint of type parameter 'TDbContext'
Error detail:
错误 4 正在运行转换: System.TypeLoadException: “Microsoft.VisualStudio.TextTemplatingEB3B19F9ED2A1CD8FC4B21815C1AACB477DD055C49C5754AF0754E9D44596039EB9CA531F9F56BFB60B31D13311A2A84214359163B64F650FF3E2A2DDF6E869D.GeneratedTextTransformation+T4MVCGenerateInfo`2[TModel,TDbContext]”上的 GenericArguments[1] (“Magicodes.Admin.Models.AdminContext”)与类型参数“TDbContext”的约束冲突。
在 Microsoft.VisualStudio.TextTemplatingEB3B19F9ED2A1CD8FC4B21815C1AACB477DD055C49C5754AF0754E9D44596039EB9CA531F9F56BFB60B31D13311A2A84214359163B64F650FF3E2A2DDF6E869D.GeneratedTextTransformation.TransformText()
在 Microsoft.VisualStudio.TextTemplating.TransformationRunner.PerformTransformation() D:\CloudDriver\Git\Magicodes.NET\Plus\Magicodes.Admin\Controllers\SiteAdminNavigationsController.cs.t4 1 1 Magicodes.Admin

Related

Royale setup in VSCode

New to Royale, copied checkbox mxml code from Tour de Jewel to learn Royale. Compilation with errors.
Followed instruction from https://github.com/BowlerHatLLC/vscode-as3mxml/wiki/Install-the-ActionScript-and-MXML-extension-for-Visual-Studio-Code and setup VSCode successfully.
Compilation error:
MXMLJSC
+royalelib=d:\Apps\Installations\apache-royale-0.9.6-bin-js\royale-asjs\frameworks
--debug=true
--targets=JSRoyale
--source-map=true
--
src/Main.mxml
d:\Workspace\VSProjects\Project02\src\Main.mxml(13): col: 10 Error: In initializer for 'j:initialView', type org.apache.royale.jewel.Card is not assignable to target type 'org.apache.royale.core.IApplicationView'.
<j:Card width="350">
^
1.319005 seconds
The terminal process terminated with exit code: 3
<j:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:j="library://ns.apache.org/royale/jewel"
xmlns:html="library://ns.apache.org/royale/html"
xmlns:js="library://ns.apache.org/royale/basic">
<j:valuesImpl>
<js:SimpleCSSValuesImpl />
</j:valuesImpl>
<j:initialView>
<j:Card width="350">
<html:H3 text="Jewel CheckBox"/>
<j:CheckBox text="Not Checkbox"/>
<j:CheckBox text="Checked" selected="true"/>
<j:CheckBox text="Disabled">
<j:beads>
<j:Disabled/>
</j:beads>
</j:CheckBox>
<j:CheckBox text="Checked And Disabled" selected="true">
<j:beads>
<j:Disabled/>
</j:beads>
</j:CheckBox>
</j:Card>
</j:initialView></j:Application>
You missed j:View:
<j:initialView>
<j:View>
<j:Card/>
</j:View>
</j:initialView>

I am getting exception on a post request logged in stackify but not able to find cause of the error

Following is the exception stackify shows me on dashboard:
ERROR The string was not recognized as a valid DateTime. There is an unknown word starting at index 0.
System.FormatException: The string was not recognized as a valid DateTime. There is an unknown word starting at index 0. ---> System.FormatException: null is not a valid value for DateTime.
at System.DateTimeParse.Parse
at System.ComponentModel.DateTimeConverter.ConvertFrom
--- End of inner exception stack trace ---
at System.ComponentModel.DateTimeConverter.ConvertFrom
at System.ComponentModel.NullableConverter.ConvertFrom
at Microsoft.AspNetCore.Mvc.ModelBinding.Binders.SimpleTypeModelBinder.BindModelAsync
I am not able to understand which field of the viewmodel causes the issue like this. How can I catch this exception on my local code?

How to correct Knapsack compiling error MiniZinc?

What can I do for correcting errors in the following program
item= record( int: id, profit, weight);
set of item: All_Items ;
int :Max_Capacity;
var set of item: Selected_Items;
I have the following code for solving knapsack in MiniZinc, but it has many errors.
constraint sum([holds(X in Selected_Items)*X.weight | X in All_Items])=< Max_Capacity;
constraint Selected_Items >= All_Items;
maximize
sum([holds(S in Selected_Items)*S.profit |S in All_Items]);
Errors List
Compiling knapsack1.mzn
C:/Program Files/MiniZinc IDE (bundled)/examples/knapsack1.mzn:3.7-12:
item= record( int: id, profit, weight);
^^^^^^
Error: syntax error, unexpected record
C:/Program Files/MiniZinc IDE (bundled)/examples/knapsack1.mzn:11.45:
constraint sum([holds(X in Selected_Items)*X.weight | X in All_Items])=< Max_Capacity;
^
Error: syntax error, unexpected $undefined, expecting ]
C:/Program Files/MiniZinc IDE (bundled)/examples/knapsack1.mzn:15.1-8:
maximize
^^^^^^^^
Error: syntax error, unexpected maximize, expecting end of file
Process finished with non-zero exit code 1
Finished in 89msec
Although MiniZinc currently does not contain any record-types (read struct like types), they are a possibility for the future. To prevent breaking models in the future, the word record is therefore already a reserved keyword and can not be used in as an identifier in your model. Changing the name from record to something else will fix your problem.

Form view triggering error when submitted

I am very new to NativeScript (few hours) and I am trying to follow the tutorial on their site. When running the code at step 12 of the tutorial, the app is failing (when I submit the login form only) and crashes with the following error stack:
2018-10-10 20:35:06.321 nsplaydev[2295:419329] *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: TypeError: user.login is not a function. (In 'user.login()', 'user.login' is undefined)
at
1 signIn#file:///app/views/login/login-page.js:17:15
2 notify#file:///app/tns_modules/tns-core-modules/data/observable/observable.js:110:31
3 _emit#file:///app/tns_modules/tns-core-modules/data/observable/observable.js:127:24
4 tap#file:///app/tns_modules/tns-core-modules/ui/button/button.js:207:24
5 UIApplicationMain#[native code]
6 start#file:///app/tns_modules/tns-core-modules/application/application.js:272:26
7 run#file:///app/tns_modules/tns-core-modules/application/application.js:300:10
8 anonymous#file:///app/app.js:2:22
9 evaluate#[native code]
10 moduleEvaluation#[native code]
11 #[native code]
12 promiseReactionJob#[native code]
', reason: '(null)'
*** First throw call stack:
(0x211e5bf78 0x211054284 0x102e67e60 0x102e8d2e4 0x10378f088 0x1037901b4 0x21104f900 0x23f731a98 0x23f19be18 0x23f19c14c 0x23f19b0ec 0x23f76d208 0x23f76e468 0x23f74cb70 0x23f81d024 0x23f81fb50 0x23f81fec8 0x23f81854c 0x211de8a50 0x211de89cc 0x211de8284 0x211de2f64 0x211de2844 0x214091be8 0x23f73031c 0x103790044 0x10378e7a4 0x10378e26c 0x102e45630 0x103440e14 0x103449a24 0x103449a34 0x103449a34 0x103442ee0 0x1033dc198 0x1033b1e94 0x103546b9c 0x102e5a354 0x1035e2964 0x10344a494 0x103449a34 0x103449a34 0x103449a34 0x103442ee0 0x1033dc198 0x1033b1e94 0x103546c80 0x1035de8e0 0x102e51898 0x102e97f50 0x102ac8198 0x10257d3dc 0x211898020)
libc++abi.dylib: terminating with uncaught exception of type NSException
2018-10-10 20:35:06.321 nsplaydev[2295:419329] PlayLiveSync: Uncaught Exception
To learn the framework, I was purposefully typing each line manually to learn. Thought that could have introduced the error, so I went back and copy pasted their exact code. Still getting an issue.
Update: The link to the tutorial is here
Thanks
Based on the error log it looks like you haven't defined login function in your view model.

Get the node name for xpath in Robot Framework

Can't find the solution to my issue.
I have nodes to be identified, I mean - I have to get nodes names for following case:
<content-scope scope-data="scopeData">
<link-group data="scopeData[0]">
<text-img data="scopeData[1]">
</content-scope>
When I'm using following syntax (FirePath, directly from browser)
name((//content-scope[#scope-data='scopeData']/*)[1])
or
name((//content-scope[#scope-data='scopeData']/*)[2])
then I get node name ( link-group and text-img).
In robot-framework it doesn't work with keywords Get Text or Get Value. I get message:
"InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression name((//content-scope[#scope-data='scopeData']/*)[1]) because of the following error:
TypeError: Failed to execute 'evaluate' on 'Document': The result is not a node set, and therefore cannot be converted to the desired type.
(Session info: chrome=44.0.2403.157)"
Here is a RF code (little simplified):
*** Settings ***
Documentation Cards keywords library
Library ExtendedSelenium2Library
Library Collections
*** Variables ***
${cardsXpathNameStart} xpath=name(//content-scope[#scope-data='scopeData']/*)[
${index} 1
*** Test Cases ***
Getting Card Xpath Type
Get Card Xpath Type
*** Keywords ***
Get Card Xpath Type
: FOR ${index} IN RANGE 1 2
\ ${cardXpathType} Get Text ${cardsXpathNameStart}${index}]
\ Log ${cardXpathType}
How to build correct xpath which is interpreted by RF or which keyword should be used?
I have the solution from WarBar (google groups, robotframework-users):
RF code:
Open Browser file:///D:/temp/rf/a.html
${elements} Get Webelements //content-scope[#scope-data='scopeData']/*
log ${elements[0].tag_name}
gives result:
20150826 10:37:37.551 : INFO : Creating an instance of the Firefox WebDriver
20150826 10:37:40.326 : INFO : Opening url 'file:///D:/temp/rf/a.html'
20150826 10:37:40.474 : INFO : ${elements} = [<selenium.webdriver.remote.webelement.WebElement object at 0x03FCBA10>]
20150826 10:37:40.485 : INFO : link-group

Resources