How can I import an existing React project in Visual Studio? - reactjs

How do I properly import an existing React project being developed in Visual Studio Code into Visual Studio 2022?

Here is how you open a React application in Visual Studio without all of the overhead of other project types.
When you open Visual Studio (I'm using 2019) there is an option that says "Open a Local Folder". Choose that and select the folder that contains the React application. Once it opens, if you right-click on the package.json files there is an NPM menu that contains your NPM tasks. Visual Studio creates a csproj file and if source control is configured in Visual Studio it will hook you up to your repository.

Related

MS Visual Studio cannot create React JS project

I've got a solution in MS Visual Studio with ASP Net Core Web API project.
I want to add standalone React JS project to this solution.
NPM creates folder with project in \AppData\Local\Temp\ folder but cannot copy it to the folder where my solution is with error:
Couldn't find a part of the path.
If I run npm start in temp folder, it starts fine server and shows default page.
How can it be solved?
I use Microsoft Visual Studio Community 2022 (64-bit) - Current
Version 17.2.0

Visual studio pack NuGet without building folder

I have a working visual studio 2019 project with a simple nuget package, where if I right click 'ClassLibrary2' and click 'pack' it packages my project into a NuGet package
I want to package this folder NxTestware, when I include the folder in my project and try to pack again, it results in errors that come from inside the source folder, like it is trying to build the contents of that folder
Is there some way in visual studio I can tell it that when I click 'pack', do not build the contents of the NxTestware folder?
After trying I can't reproduce your issue on my side, please check your project's csproj file, and refer to this document: How to: Exclude files from the build.

React in Visual Studio without ASP.NET Core

Can you use Visual Studio to launch React applications without ASP.NET Core?
The template in Visual Studio creates a React application hosted on top of ASP.NET Core, but I have no need for ASP.NET and just want a pure React application.
But when the React application is a ASP.NET Core project then Visual Studio lets me run the project and it opens the project in the web browser for me.
But when the React application is standalone by itself without ASP.NET Core then Visual Studio does not show any run button.
Open the React application folder with Visual Studio.
Open Package Manager Console and navigate to the project's root folder.
Type npm start or yarn start according to your project's structure
or
You can use a Visual Studio plugin like NPM Task Runner

Upgrade GoogleTest to Visual Studio 2013 with command line

I've been attempting to automate the cloning and building of google test by using a batch script. However I can't seem to get visual studio to upgrade the solution.
I tried using the devenv "path" /upgrade command however it fails to upgrade the projects. The error I am getting for each of the projects is:
gtest_main-md.vcproj: The application which this project type is based on was not found. Please try this link for further information: http://go.microsoft.com/fwlink/?LinkID=299083&projecttype=8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942
Which just defaults to the VS2015 C++ projects page. The solution also states that it does not need to be upgraded. If I open the solution in visual studio I can simply perform the one time upgrade on each project with no issue.
Is there a way to do this without having to open visual studio?

Visual Studio 2015 Javascript / AngularJs not functioning correctly

My intellisense is not working in visual studio 2015.
I have a _references.js file under the scripts directory that points to all my angular files.
I have angular.intellisense.js in my options set up under Implicit (Web)
My project is a MVC/WebAPI project created in Visual Studio 2013.
Could this be the issue because I didn't create the project in VS2015?
My angular structure.
-app
--admin
--components (all angular and js files for site go here)
--core
--dashboard

Resources