As you might have noticed, there is no Paste as XML option under Edit –> Paste Special in the menu when you are working on .net Core applications.

The reason is actually very simple. The current project type has no build in serialization support for XML.

I only realized it after reading this post from codecalculated.com. But it has been mentioned in the Asp.Net Standup before. 

However, I have a workaround available for those who have Visual Studio Code installed. You should have it on your machine! It is so fast, responsive and lightweight (and free).

Fire up Visual Studio Code and hit Ctrl+P and type: ext install smartpaste

snip_20161130105646

if you have it installed and reloaded Visual Studio Code you can invoke it with: Cltr + Shift + P and type: smart paste.

Select “Paste XML as JSON” (since xml to classes is not finished yet)

Copy the JSON output and switch to Visual Studio 2017 RC.

snip_20161130105859

You can now paste your JSON as Classes Smile

 

Good luck!

Pin on pinterest Plus on Googleplus Post on LinkedIn
0 Comments

This is my solution explorer:

solution-explorer

and this is my nuget package manager:

nuget

So The XmlSerializer is installed. Somehow the Newtonsoft.Json gives a yellow icon in the solution explorer. But no errors from that lib in the output window.

I thought that the nuget packagemanager or visual studio would auto restore all packages for me. Somehow it was fixed by manually running dotnet restore from the cli.

The whole tooling for .net core is still work in progress and I really liked working with preview 2 (1.0.1) in vs code with the project.json files.

Switching back to the csproj file makes it imho harder to work with vs code and makes using Visual Studio 2017 (community) almost required.

I really enjoyed working through the jonhilton tutorial for dotnet core.

But that does not work anymore, because 1.1 is out and project.json is gone.

I have used dotnet migrate to move from project.json to projectname.csproj and it returned zero errors/issues. But did not launch. No project was found according to msbuild. And after changing task.json it gave a lot of reference issues. So I started over in Visual Studio 2017 RC and have a lot more setup by default and less issues.

I see that the whole development of dotnet core is moving forward fast. But I really enjoyed the development experience with vs code and the jonhilton tutorial. I hope that it will come back, or that someone will make a similar tutorial for vs code with dotnet 1.1 and mvc (and kestrel, because vs2017 has iis express as default webserver)

Looking forward to all the new bits and pieces and will keep updating vs code (insider) and dotnet core.

I hope the suggestion of the manual dotnet restore helped someone.

 

good luck!

Pin on pinterest Plus on Googleplus Post on LinkedIn