asp.net 5 using DNX - cookies

I am running into an issue trying to include the following in the project.json:
"Microsoft.AspNet.Security.Cookies": "1.0.0-beta3",
It gives me the following error:
The dependency Microsoft.AspNet.Securitu.Cookies 1.0.0-beta3 in project TestApp does not support framework DNX, Version=v4.5.1
as well as:
The dependency Microsoft.AspNet.Securitu.Cookies 1.0.0-beta3 in project TestApp does not support framework DNXCore, Version=v5.0
These are my framworks specified:
"frameworks": {
"dnx451": { },
"dnxcore50": { }
},
And here is my complete list of dependencies:
"dependencies": {
"EntityFramework.Commands": "7.0.0-rc1-final",
"EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
"Microsoft.AspNet.Diagnostics": "1.0.0-rc1-final",
"Microsoft.AspNet.Diagnostics.Entity": "7.0.0-rc1-final",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Security.Cookies": "1.0.0-beta2",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.Server.WebListener": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Microsoft.Framework.CodeGenerators.Mvc": "1.0.0-beta5",
"Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4",
"Microsoft.Framework.Logging": "1.0.0-beta7",
"Microsoft.Framework.Logging.Console": "1.0.0-beta8",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc1-final"
},
So the question is, if it is not supported "cookies" what can i use instead?, i have tried to look around but have not had any luck.
I want to add security to a small app i am building, any better suggestions would be much appreciated.

There are a few things incorrect about what you're doing:
You are mixing beta2, beta4, beta5, beta8, and rc1 packages. Since there's a lot of churn between releases, that's a recipe for disaster. Try to stick to a single release (rc1 is the latest stable).
Microsoft.AspNet.Security.* has been renamed. If you have other packages for which you cannot find the rc1 version, search the Announcements repo to see if they got renamed.

Related

Running JUnits with JavaFX dependencies on Jenkins

I'm trying to setup pipeline on Jenkins for our JavaFX application. Everything works fine, but I have one problem by starting unit tests. Each test, which somehow uses JavaFX classes fails with following root cause:
Caused by: java.lang.IllegalAccessException: class net.bytebuddy.description.annotation.AnnotationDescription$ForLoadedAnnotation cannot access interface com.sun.javafx.beans.IDProperty (in module javafx.base) because module javafx.base does not export com.sun.javafx.beans to unnamed module #7ee955a8
I tried a following things:
setting env variable JAVA_OPTS
JAVA_OPTS=--module-path /path/to/javafx --add-modules javafx.controls,javafx.base
adding compiler options in gradle
tasks.withType(Test).configureEach {
doFirst {
options.compilerArgs += [
'--module-path', '/path/to/javafx',
'--add-modules', 'javafx.controls,javafx.base',
]
classpath = files()
}
}
but nothing changed. I'm using the OpenJDK compiled by Azul. I took the version with JavaFX (JDKFX) but I'm not able to make this tests running (tests without any references to JavaFX are running fine). I'm also able to compile the application. Do you have any sugestions?
The problem was, like mentioned in comments, that it should not be added to the compilerArgs but to the runtime and additionally I placed it in wrong build.gradle file. The final configuration which solved all problems was to add following to the main build.gradle file:
allprojects {
tasks.withType(Test).configureEach {
jvmArgs += [
'--add-modules', 'javafx.controls,javafx.base,javafx.graphics',
'--add-opens', 'javafx.graphics/com.sun.javafx.application=ALL-UNNAMED',
'--add-opens', 'javafx.base/com.sun.javafx.beans=ALL-UNNAMED',
]
}
}

vcpkg does not use registry defined in `vcpkg-configuration.json`

I'm trying to use a modified version of imgui through vcpkg.
I've created a git repository to be used for the registry (https://github.com/altschuler/vcpkg-custom-ports), and copied over the imgui port configuration, and made the changes I needed (following guides like this and this).
However, vcpkg seems to ignore the entry for the custom repo in vcpkg-configuration.json, it simply doesn't load anything from it (I know because I tried changing the repository url to something that doesn't exist). If I set the default-repository to my custom one it does load stuff, but then all the packages I want from the builtin registry obviously fail to install.
Note: the reason I need a custom port for imgui is that I need to compile some definitions (basically just do target_compile_definitions in its CMakeLists). If you know of an easier way to do that I'm all ears.
vcpkg-configuration.json:
{
"registries": [
{
"kind": "git",
"baseline": "e3b33f3a548f20ba06b2959aa3701bd50ece0638",
"repository": "https://github.com/altschuler/vcpkg-custom-ports.git",
"packages": ["imgui"]
}
]
}
vcpkg.json:
{
"name": "tester",
"version-string": "0.1.0",
"dependencies": [
"lager",
"sdl2",
{
"name": "imgui",
"features": ["docking-experimental", "sdl2-binding", "opengl3-binding"]
},
"immer",
"cereal",
"rxcpp",
"range-v3",
"glew",
"boost"
]
}
Try setting an environment variable
VCPKG_FEATURE_FLAGS=manifests,binarycaching,registries
AFAIK, some features are not enabled by default. Seems that manifests are automatically enabled, so vcpkg.json gets picked up, but perhaps "registries" are not enabled by default. (Disregard "binarycaching", if you don't use it).
This is what is working for me.

VS Code does not recognize unit tests in Flutter

Visual Studio Code does not recognize unit tests grouped in group(...). But it recognizes unit tests which are not grouped. I mean they are standalone test(...). I want to use group, because I need setUp().
There is Run | Debug link above group. When I click Debug or Run the Debug console shows No tests match regular expression "^LocalRepository$".
The tests are running correctly with flutter test command.
Dart SDK: >=2.1.0 <3.0.0
Flutter channel: master
Edit: I found workaround - I just don't use group callback. But I can't run all tests by clicking Run above group.
Make sure you name you test file ending with _test.dart and you will see the run | debug options
I have a Flutter project with two separate test files, both ending in "..._test.dart".
Using the following two test scenarios, one of the files passes, while the second doesn't load and that test fails.
Using launch.json configuration:
{
"name": "Dart: Run all Tests",
"request": "launch",
"type": "dart",
"program": "./test/"
}
Using the VS Code menu item Debug > Start Debugging (F5), which I suspicion just uses the above launch.json configuration, yields the same result.
However, using the VS Code menu item Debug > Start Without Debugging (Ctrl+F5), or "flutter test" from the command line, both tests pass.
I suspect this is an internal configuration issue with the VS Code Dart/Flutter extension, as opposed to a problem with Dart/Flutter code structure.
Are your tests/groups spread across multiple files? There are some limitations to the integration between the VS Code extension and the test package that you may be hitting.
There was a fix in v2.23 (released a few days before your question) that should have improved this a little (removing those Run/Debug links in some places they wont' work) but if you're already on that version then maybe it didn't cover your case.
If you can post a small repro on GitHub I'd definitely like to see if I can improve this. Thanks!
Ensure the test has a name different from ''
Change
test('', () {
...
});
to
test('xxx', () {
...
});

Nuget error during build

I grabbed this repo CommandLIneParser
and opened it in Visual Studio 2017. Build fails because Nuget fails. In the nuget package manager I see messages like this:
Dependency '"CommandLine": {
"target": "project"
}' has invalid version specification.
What does that mean and how can I resolve it?
Second problem (may be caused by the first). During build I get this error:
Error occurred while restoring NuGet packages: Invalid restore input.
UAP projects must contain exactly one target framework. Input files:
C:\Users\Jerry\Source\Repos\commandline\tests\CommandLine.Tests\CommandLine.Tests.csproj,
C:\Users\Jerry\Source\Repos\commandline\tests\CommandLine.Tests\project.json.
but both projects do, in fact, target the same framework (.net 4.5, in this case). So I'm guessing that the error message means something else?
Update:
Now that I'm looking at the two files in the error message, I'm getting a clue:
CommandLine.Tests.csproj has:
<TargetFrameworks>netstandard1.5;net40;net45</TargetFrameworks>
project.json has:
"testRunner": "xunit",
"frameworks": {
"netcoreapp1.0": {
"buildOptions": {
"define": [ "PLATFORM_DOTNET", "SKIP_FSHARP" ],
"keyFile": "../../CommandLine.snk"
},
So I see the mismatch. But that just leaves me with the somewhat-rhetorical question: "How did the last version ever build?"

How to build production environment with canary flags?

I would like to use one of canary flags currently available in ember-data 2.4.0-beta.2. When I use ember serve it works as expected. But with ember build --prod it throws error on code that requires that flag. I assume I have to enable it somewhere but didn't have any luck finding any documentation for it.
// I added flag into environment and made sure that it is not overridden on production
EmberENV: {
FEATURES: {
'ds-references': true
}
},
It was bug that is fixed now. Fixup feature flagging infrastructure.