Error reading project.json, Unterminated string error when performing dotnet restore - macos

Using Visual Studio for Mac to perform a "dotnet restore" but the terminal shows this message:
error : Error reading
'/Users/abc/corefx/src/Microsoft.TargetingPack.Private.CoreCLR/ref/project.json' at line 8 column 1 : Unterminated string. Expected delimiter: ". Path 'frameworks', line 8, position 1.
error:Unterminated string. Expected delimiter: ". Path 'frameworks', line 8, position 1.
project.json:
{
"dependencies": {
"Microsoft.TargetingPack.Private.CoreCLR": "1.2.0-beta-24904-03"
},
"frameworks": {
"netcoreapp1.1.0”: {}
}
}
I have found the file but I cannot identify the cause of the problem. What could cause this error message?

It looks to me like the netcoreapp1.1.0 property name is terminated with a typographic right quote mark ” which is not valid JSON. It should be a standard straight quote " instead.
{
"dependencies": {
"Microsoft.TargetingPack.Private.CoreCLR": "1.2.0-beta-24904-03"
},
"frameworks": {
"netcoreapp1.1.0": {}
}
}

Related

Chainlink Node -Job Run: requestData: while unmarshalling JSON: invalid character '$' looking for beginning of value - bad input for task

It appears that the fetch task is not working. I haven't found any bugs, and compared this task to a job that worked.
Fetch task that succeeded ->
fetch [type=bridge name="armanino-trust-token" requestData=
"{\"id\": $(jobSpec.externalJobID), \"data\": { \"tokenName\": $(decode_cbor.tokenName)}}"]
Fetch task that is failing ->
fetch [type=bridge name="rasp-pi-cpu" requestData=
"{\"id\": $(jobSpec.externalJobID), \"data\": { \"pi-temp\": $(decode_cbor.pi-temp)}}"]
This is the error that appears in my logs ->
requestData: while unmarshalling JSON: invalid character '$' looking for beginning of value; js: {"id": { "__chainlink_key_path__": "jobSpec.externalJobID" }, "data": { "pi-temp": $(decode_cbor.pi-temp)}}: bad input for task
Dashes are not allowed in pipeline variable names. Replace pi-temp with pi_temp and it should work.

VSCode keybinding that inputs large amount of code (Python: Visual Studio Code)

I'm currently trying to add a keybinding in Vscode that inputs multiple lines of code. Below is my current attempt at doing that – but it's not working due to some syntaxical errors. Would anyone know how I'm supposed to format this?
{
"key": "ctrl+y",
"command" : "type",
"args": {
"text": "
leave1 = False
while(leave1 == False):
try:
driver.find_element(By.XPATH, '')
except Exception:
time.sleep(0.5)
else:
leave1 = True
"
}
}

Passing spaces in arguments for Visual Studio Pro 2019

I am trying to debug a command line program inside Visual Studio. I am sharing my configuration with another machine using Box. The paths I am passing have spaces in them and I haven't been successful in escaping the spaces so that instead of 3 arguments I get 9. This is the relevant section from the original launch.vs.json.
{
"type": "default",
"project": "CMakeLists.txt",
"projectTarget": "dispatcher.exe (src\\dispatcher\\dispatcher.exe)",
"name": "dispatcher.exe (src\\dispatcher\\dispatcher.exe)",
"args": [
"C:\\Users\\212434537\\Box Sync\\Edge Agent\\srasku-windows.json",
"C:\\Users\\212434537\\Box Sync\\Edge Agent\\static.json",
"C:\\Users\\212434537\\Box Sync\\Edge Agent\\dynamic.json"
]
}
None of these work.
"\"C:\\Users\\212434537\\Box Sync\\Edge Agent\\srasku-windows.json\""
"\\"C:\\Users\\212434537\\Box Sync\\Edge Agent\\srasku-windows.json\\""
"\\\"C:\\Users\\212434537\\Box Sync\\Edge Agent\\srasku-windows.json\\\""
"\\\\"C:\\Users\\212434537\\Box Sync\\Edge Agent\\srasku-windows.json\\\\""
How can I escape my spaces so that each argument is passed as a single argument instead of three. Note: I saw this question but it didn't solve my problem.
It turns out you need to surround the spaces with singly-escaped double-quotes:
Here is the resultant section:
{
"type": "default",
"project": "CMakeLists.txt",
"projectTarget": "dispatcher.exe (src\\dispatcher\\dispatcher.exe)",
"name": "dispatcher.exe (src\\dispatcher\\dispatcher.exe)",
"currentDir": "C:\\Users\\212434537\\source\\Edge-Agent",
"args": [
"C:\\Users\\212434537\\Box\" \"Sync\\Edge\" \"Agent\\srasku-windows.json",
"C:\\Users\\212434537\\Box\" \"Sync\\Edge\" \"Agent\\static.json",
"C:\\Users\\212434537\\Box\" \"Sync\\Edge\" \"Agent\\dynamic.json"
]
}
A simple workaround for this, is just to include the entire path in quotes, such as:
"C:\Users\212434537\Box Sync\Edge Agent\dynamic.json"
So, the escaped json becomes:
"\"C:\\Users\\212434537\\Box Sync\\Edge Agent\\dynamic.json\""

RUBY : Unexpected end of file and command not found?

I start to learn Ruby and i got some problem when i ran the code on the
Terminal. it says :
desktop/RUBY/boucles.rb: line 1: voyages: command not found
desktop/RUBY/boucles.rb: line 14: syntax error: unexpected end of file.
My IDE is sublim text.
How i can solve that ?
voyages = [
{ ville: "Paris", duree: 10 },
{ ville: "New York", duree: 5 },
{ ville: "Berlin", duree: 2 },
{ ville: "Montreal", duree: 15 }
]
voyages.each do |voyage|
if voyage[:duree] <= 5
puts "Voyage à #{voyage[:ville]} de #{voyage[:duree]} jours"
end
end
Your code is correct and works without any syntax errors. If you were editing in Sublime Text, you might want to make sure that you saved the file first.
Those errors look like they might be coming from your shell, not from Ruby!
How are you running this script? You should be running ruby boucles.rb in your terminal.

Coffeelint indentation in Web Essentials 2013

I have 4 space indentation in my coffee files and when I am compiling those I am getting errors:
CoffeeLint: YourFile.coffee compilation failed: CoffeeLint: Line contains inconsistent indentation; context: Expected 2 got 4
I found that http://www.coffeelint.org/ actually provides option to configure indentation and in Web Essentials menu there is option to edit Global CofeeLint settings. So I changed that option to be:
"indentation": {
"name": "indentation",
"value": 4,
"level": "error"
}
(changed value from 2 to 4)
But it makes no difference I even tried to change level from error to ignore still no success. I even tried to restart VS and Windows, What I am doing wrong?
Update 1.
As requested in comments here is code I have:
if 1
0
And also screenshot of it with View White Space ON:
If you are using coffeelint and you want to change the indentation value to 2 spaces then you must edit the coffeelint/lib/coffeelint.js file and change the value of the "value" to 2 as follows:
module.exports = Indentation = (function() {
Indentation.prototype.rule = {
name: 'indentation',
value: 2,
level: 'error',
message: 'Line contains inconsistent indentation',
description: "This rule imposes a standard number of spaces to be used for\nindentation. Since whitespace is significant in CoffeeScript, it's\ncritical that a project chooses a standard indentation format and\nstays consistent. Other roads lead to darkness. <pre> <code>#\nEnabling this option will prevent this ugly\n# but otherwise valid CoffeeScript.\ntwoSpaces = () ->\n fourSpaces = () ->\n eightSpaces = () ->\n 'this is valid CoffeeScript'\n\n</code>\n</pre>\nTwo space indentation is enabled by default."
};
The file you edited is probably a generated file that is of no consequence.

Resources