How to open a project.json dotnet project in VS Studio - visual-studio

I have a dotnet core project that I have created using the project.json and VS Code. So there are no .sln or .xproj files.
How do I open this project in VS Studio 2015?

You can open empty VS instance, then File -> Open -> Project/Solution and open your project.json file. This will generate .sln file, that you can use next time.

There is no way you can open this project directly in VS as ASP.NET Core projects now is able to run without using VS on other platforms. If you have created the solution using Yeoman or dotnet CLI, you have to create a blank new project of ASP.NET Core in VS, and drag all the working files to the solution explorer.
It is recommended that you do it once. If you try again and again, it may fail, as happened with me because IIS configuration can change each time.
Note: If you are cloning the project, using Version Control extensions might be helpful.

Related

how to move a cordova project from intel xdk to visual studio

I'm trying to move a project created in Intel XDK to Visual Studio 2015.
I used the file > new > project from existing code ... option to create a new project in VS from the Intel XDK project.
I commented out the script line for the cordova.js file. because i read somewhere that VS creates and inserts for you.
when i go to build i get:
cordova-build error BLD105: The Cordova build did not recognize your working directory as a Corvova-based project. This is often because the "www" directory is not at the root of your project
I have a www directory in the project folder.
I determine that the cause was i didn't have a config.xml file in the root directory. it seems the XDK application creates the config.xml when it calls Cordova to do a build.
I have the following questions:
What is the best way to get a config.xml file?
Is there any other gotchas from moving the project?
The easiest way is to make a new Cordova project, open config.xml by viewing the code instead of in the designer, select all & copying it to your clipboard. Then, re-open your XDK project, add a new item, call it config.xml and drop your clipboard contents into it.
You may need to re-configure a bunch of settings to get parity with what Intel does, but this should unblock the build.
(Disclosure: I work on the Tools for Apache Cordova in Visual Studio at Microsoft. And thanks for using our tools!)

Add a project.json based project to a .sln file without using Visual Studio

We have developers that are using VS Code on Linux, Windows, and Mac. We also have developers that are using full Visual Studio on Windows. A problem arises when the former (including me) do not add their projects to the solution, and the latter therefor do not see the projects in the solution.
How can developers add their project.json projects to a sln without having to open Visual Studio?
Nowadays .NET Core SDK allows working with sln files.
Imagine you have a root folder for the solution. All the projects are located under src and test folders.
Then from the solution folder run something like this:
dotnet sln add ./src/Insurance.Domain/Insurance.Domain.csproj
dotnet sln add ./test/Insurance.Domain.Tests/Insurance.Domain.Tests.csproj
You can list the projects in the solution runing
dotnet sln list
Note:
The solution provided above is not going to work with project.json files. Anyway project.json format is obsolete now and you can easilty migrage to csprojs with the latest SDK. Just run in your project folder:
dotnet migrate
and you are good to go.

Unity Project doesn't have solution file

I just started learning unity and I created a project. But my project doesn't have a sln file included in. Every time I create a C# script and open it in Xamarin Studio I can't have any intellisense.
Is it normal not to have sln file in unity project?
If not, how can I add solution file to project?
Why that happened?
If "Open C# Project" doesnt create the .sln file, try updating your external tools first.
In Unity, go to Edit > Preferences, and make sure that Visual Studio is selected as your preferred external editor.
This created the sln file for me.
I finally found the answer.
I closed Xamarin and inside Unity went Assets > Sync MonoDevelop Project Doing this created the two .sln projects: -csharp.sln and .sln
For people looking for answers on newer versions of Unity you may have to build your C# project.
To do this go into File > Build Settings then select the option Create Visual Studio Solution. Then build that and your file explorer will ask you for which folder you want your visual studio solution to be placed into. Then Visual Studio should behave correctly.
For people looking for answers on newer versions of Unity you may have to build your C# project.
First install windows build also in unity hub then select target platform to windows. and now you can see visual studio solution checkbox.
To do this go into File > Build Settings then select the option Create Visual Studio Solution. Then build that and your file explorer will ask you for which folder you want your visual studio solution to be placed into. Then Visual Studio should behave correctly.
Like the post by SSchmid suggests, go into preferences and have Visual Studio as your preferred editor.
I was having a sync issue and the Solution wasn't showing the name of the unity project, ultimately interrupting intellisence.
Found in my settings that the code editor was set to General and not Visual Studio specifically.
Setting it to VS solved it for me.
A screenshot to help those who are too lazy to read.

How to stop Microsoft Visual Studio from complaining when missing multiple projects from solution file

I am working with Microsoft Visual Studio and have a problem when opening a solution file. The solution file consists of a core project and multiple plugin projects. During development, there may be instances where every plugin project is not extracted with the core.
When opening this solution file during development, Visual Studio will complain about missing plugin projects and will have a separate pop-up window for each missing project. Is there some setting in Visual Studio to turn off this warning? Ideally, I do not want to have multiple instances of the solution file or create a script to modify the solution file every time a new project is extracted from our repository. I looked through all of the settings and could not find a flag or warning to turn off.
You might have build the project in the previous version (i.e 2008) and trying to open in the newer version (i.e 2010).

Copy/Move Visual Studio Projects/Solutions To Another Computer

So I have a handful of Visual Studio projects that I need to move to another computer. Is it as simple as a copy and paste or will that mess something up? Both machines will have the same version of Visual Studio installed, so that shouldn't be an issue.
Is there an export function that I've overlooked?
If the Visual Studio version is the same, you can just copy the project folder.
Till the time you are moving your solution file and associated files you should be good.
In case you are using any source control update your solution from there.
Hope you have the same VS version and any addon frameworks you have
You can directly copy the project to the projects folder. This worked perfectly for Visual C++ projects for me (and also some other projects). But when I copied my Cordova App from one PC to the other (Both had Visual Studio 2015), I wasn't able to open the project. Whenever I tried to open the project, trying both the ways - directly from the Project file and the open option in Visual Studio, it at first opened but when I tried to open a file, it just got hung and didn't respond.
This problem may occur because Cordova apps have some configuration files that might be different for different PCs. I am not sure that this is the reason for the problem.
A solution that I used was that I created a new Project and copied the files to the project folders (excluding the configuration files).
Can you save the file to cloud? if so then you could potentially upload the file to cloud and download the file to the new

Resources