Kestrel port settings under VS2017 are ignored - visual-studio-2017

I have an issue with starting Kestrel server from VS2017. In VS2015 in launchSettings.json I was able to set the port like this:
"Kestrel": {
"launchUrl": "http://localhost:5010/api",
"environmentVariables": {
"ASPNETCORE_URLS": "http://localhost:5010"
}
Now this setting is ignored by kestrel. If I change the name of the setting to: "ASPNETCORE_SERVER.URLS" I'm getting the warning about the setting being deprecated, which suggests that the launchSettings.json file is still being processed.
I also tried other options of setting the port - setting environment variable (ASPNETCORE_URLS) still works, but using dotnet run --server.urls http://0.0.0.0:5010 doesn't.

On VS2017 something like this works for me
"profiles": {
"Kestrel": {
"commandName": "Project",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:2287"
}
}
Running the app on port 2287

Related

Webpack Module Federation Error ScriptExternalLoadError: Loading script failed

NOTE: I tried accessing this directly in the browser https://localhost:5007/accom-web/dist/js/assets/browser-bundle/remoteEntryTest.js and I'm served the remoteEntryTest.js file.
This is my webconfig in host.
This is webconfig of remote application.
Optimization config for remote application is below.
optimization: {
runtimeChunk: false,
emitOnErrors: true,
splitChunks: {
minSize: 256000,
minChunks: 1,
maxAsyncRequests: 10,
automaticNameDelimiter: '-',
cacheGroups: {
chunks: 'initial',
.....
},
},
.....
}
I looked at the GitHub issues regarding this too but didn't help much.
https://github.com/module-federation/module-federation-examples/issues/307
https://github.com/module-federation/module-federation-examples/issues/1273
https://github.com/module-federation/module-federation-examples/issues/692
Any suggestions on this how to fix it?
I had a similar issue with specifying shared dependencies on a remote. I ended up having to disable splitChucks after reviewing your Github references. I'm sure you tried that as well but this got my remote working again recently.
optimization: {
splitChunks: false,
},

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.

How to access Debug and Launch Settings if greyed out?

I'm trying to edit my launch settings for a CMake project in Visual Studio, but the option is greyed out. I can manually open launch.vs.json file, but the settings there won't behave.
Probably the greying out and the fact that the settings won't behave are linked.
I am running the x64-Debug configuration.
This is how launch.vs.json looks like for me:
{
"version": "0.2.1",
"defaults": {},
"configurations": [
{
"type": "default",
"project": "CMakeLists.txt",
"name": "CMakeLists.txt",
"args": [
"first-argument"
],
"currentDir": "C:\\repos\\myproject"
}
]
}
Since the type of the configuration is "default", I would assume it applies for any configuration that isn't configured. But it doesn't because my "first-argument" is not read.
int main(int argc, char* argv[])
{
if (argc>1)
{
cout << argv[1];
exit(EXIT_SUCCESS);
}
else
{
exit(EXIT_FAILURE);
}
}
The above yields failure.
How to properly configure the debug parameters and how to ungrey Debug and Launch settings?
The Configure CMake debugging sessions documentation says that
If you don't have a debug target selected, this option is grayed out.
Running the x64-debug configuration sounds like the option shouldn't be greyed out, but it still is because you're debugging the Current Document as a target, which Visual Studio doesn't consider a real target. This means that Current Document is neither a Debug, nor a Release target, so the option is greyed out, even if you run it with the configuration named x64-Debug.
Real targets have a drop down menu on the right, usually with a single item mentioning the type of the selected target.
This means you need to select a real target, which should be something like myproject.exe for you.
According to the launch.vs.json schema reference (C++) documentation page, "type": "default" refers to whether the project is a library or an executable, and default just means that it's an executable. It has nothing to it being the default configuration.
The relevant setting to link debug configurations to targets is projectTarget, which is not set in your case. It could be that it used to be that the default would make this configuration available for all targets, including the virtual Current Document, but this would have been an undocumented feature that was unexpectedly deprecated without notice in a new Visual Studio release. This could explain, why it used to work, but it doesn't anymore.
According to the launch.vs.json schema:
projectTarget must exist already and match the name in the Debug Target dropdown.
The easiest way to create a real launch and debug configuration is to
delete your launch configuration,
select a real target, such as "myproject.exe", and make sure it says Debug on the drop-down menu on the right.
Go to Debug -> Debug and Launch settings for myproject.exe, which should open launch.vs.json with a valid configuration, now fill in the "args" parameter as you wish.
Your final configuration should probably look like similar to this:
{
"version": "0.2.1",
"defaults": {},
"configurations": [
{
"type": "default",
"project": "CMakeLists.txt",
"projectTarget": "myproject.exe (myproject\\myproject.exe)",
"name": "myproject.exe (myproject\\myproject.exe)",
"args": [
"first-argument"
],
"currentDir": "C:\\repos\\myproject"
}
]
}
I hope this will serve me as a good reminder to spend more time on documentations and less time messing around.
The answer for me was that somehow the "Startup Item" magically got deselected, so there was no context for Debug and Launch Settings.
In Solution Explorer, right-click on the executable that is the target of the Debug Launch -- "myproject (executable)" in this case -- and select Set as Startup Item.
Now, whenever this executable is selected in the Solution Explorer, the option "Debug and Launch Settings for myproject" appear in the Debug dropdown menu.

How to run C++ code inside terminal in Visual Studio Code?

I am unable to input values in output tab and wanted to run code directly inside the terminal.In previous version I was able to do so with the changes in settings.json file which is mentioned below but in the latest version 1.38 I was unable, Help.
[
{
"color-highlight.markerType": "dot-before",
"editor.formatOnSave": true
"explorer.confirmDelete": false
},
{
"code-runner.runInTerminal": true
}
]
Have you ever tried using CodeLLDB?
https://github.com/vadimcn/vscode-lldb/blob/master/MANUAL.md##stdio

Why is this configuration for ESLint in Visual Studio 2017 not working?

I am currently wondering, why ESLint is not working in my project in Visual Studio 2017. There is the file ".eslintrc" in the project-root:
{
"extends": "defaults/configurations/eslint",
"env": {
"browser": true
},
"globals": {
"xhr": true
},
"rules": {
"eqeqeq": [ "error", "always", { "null": "ignore" } ]
}
}
If I remove the line with "eqeqeq", everything is working fine. But as soon as I add this line, no errors will be displayed at all.
Question 1: Is there any way to see an error-message about the issue ESLint obviously has?
Question 2 as a fallback: What is the issue with this line?
Thanks to btmills I took a dive into the sources and found the version: VS 2017 uses ESLint 2.0.0 (released 2016-02-12).
The correct configuration is:
"eqeqeq": [ 2, "allow-null" ]
Documentation is available here:
Getting started
Rules
The links from the error-list in VS 2017 lead to the current documentation, where you can find many features that do not work in version 2.0.0.