React in Visual Studio without ASP.NET Core - reactjs

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

Related

How to bundle windows visual studio VSIX with other built application?

I found that the windows visual studio extension is targeted to .net framework and only .net framework (which seems not clearly described in the docs?), after switching our custom mono debugger extension to .net 7.0, with framework not compatible (between vsix project's .net framework 4.8 and debugger project's .net 7.0) error when building the vsix project.
If I switch the debugger project target back to .net framework 4.8 then I can build the extension along with the debugger and create a vsix bundle them togeter successfully.
I tried the previewing visual studio extensibility tools: the out-of-process solution, but the out-of-process way seems not have access to the dte object, thus no way to send the debug adapter launch command. If I use the in-process solution, then we head back to the .net framework target :(
The mono debugger extension is a "3rd party executable file" that launched by visual studio debug adapter. If I manually paste the .net 7.0 version mono debugger to the extension install location, the extension can still work with the debugger. I manage the debugger project and the vsix project within a solution is for easier project management only, in fact they are not referenced directly in code.
I switched our mono debugger project to .net 7.0 is for trying to upgrade our toolset to the newest unified framework (every other tool in our team are upgraded to .net 7.0).
TL;DR, how can we bundle a none .net framework targeted project along with a windows visual studio extension, which is targeted to .net framework only? Or how can we integrate/bundle/add built exe,dlls into the vsix container?
There are some solutions from other stackoverflow answers such as add dlls using vsixmanifest, but it can only add dll file, and the way it handle asset file seems not quite right, it just copy the dll to vsix project folder once, meaning it won't get updated when the dll's project rebuild.
Here I managed to bundle the files in a wonky way:
I create a publish folder under vsix project folder,
then copy the published debugger project file to it, add them as existing file to vsix project, and configure them as vsix content, copy to vsix,
then add a pre-build event for the vsix project, publishing our debugger project and output to this publish folder.
With process above, I can package the published file into vsix when trigger vsix project build.
For anyone have similar issue, you can have a try.

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

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

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.

Creating a (.NET 6 based) website project with ASP.NET Core and React (TypeScript) in Visual Studio 2022?

I have been trying to set up an ASP.NET Core + React (TypeScript) web app project in Visual Studio 2022, but couldn't succeed in doing so. There are no proper stacks/suites(?) in the Visual Studio 2022 create project dialog (File > New > Project...) that suit my needs.
I then tried what these docs say - and it works - but when I do the same for React TypeScript (i.e., using Standalone TypeScript React Template instead of Standalone JavaScript React Template) it doesn't work because this template doesn't have an Add integration for Empty ASP.NET Web API project. option in its setup (but the JavaScript template does).
How do I create an ASP.NET Core + React (TypeScript) project then?
I did see some modified and new files when the ASP.NET Core Web API integration option was enabled during the React.js (not TypeScript) setup. Can I copy those ASP.NET Core Web API integration files and their content, re-write the JavaScript files in TypeScript, and add those files (*.ts instead of *.js, etc.) in the TypeScript template? Or is there any other (official) method to properly set up an ASP.NET Core + React (TypeScript) project in Visual Studio 2022?
This is the guide do you need, just a consideration I changed this piece of code in aspnetcore-react.ts
fs.writeFileSync(
'.env.development.local',
`BROWSER=none
HTTPS=true
SSL_CRT_FILE=${certFilePath}
SSL_KEY_FILE=${keyFilePath}`,
);
BROWSER=none Start without opening url in the browser because should be opened by .NET proxy
HTTPS=true Dev server to serve pages over HTTPS. Uses the .NET self-signed certificate

how to create ClickOnce type setup in Visual Studio

Please tell me how to Deploy application, which installs all it's dependencies like .net framework, MSSQL, etc. itself.
I have added all the dependencies in my setup Project, but when I install my setup it show message like .net Framework 4.0 is not installed. Download it from Microsoft's Website and then Install
It's not installing dependency which is in setup.

Resources