Z
Zappo1980
Guest
Hi all,
I have a project that is a SPA that runs entirely in the browser. It only needs a web server to serve its files. It does not talk back to the server in any way or fashion. It's 100% HTML and TypeScript, and does not actually use any .NET.
So far, I have used a "website" .csproj to do this. In order to debug the application, I would right-click on an HTML file, "set as startup page", and hit F5. VS would start an IIS instance, serve the page, and all was well.
Now, I want to switch this project to the new SDK-style project format.
I am trying to use Microsoft.NET.Sdk.Web as the SDK. The project builds, but I can't debug it. If I try, I get a "RunCommand property is not defined". I don't have any way to set the startup page either.
Overall, I have the impression that I just can't use SDK-style projects for a "website" type project. What SDK should be used, and what properties or settings, to be able to have VS start IIS and serve a page when I start debug?
These are the relevant bits of my .csproj. Note that I've set OutputType to Library because otherwise csc would complain about not having a main.
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<!-- Prevents CS5001 -->
<OutputType>Library</OutputType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="3.6.4" />
</ItemGroup>
</Project>
Continue reading...
I have a project that is a SPA that runs entirely in the browser. It only needs a web server to serve its files. It does not talk back to the server in any way or fashion. It's 100% HTML and TypeScript, and does not actually use any .NET.
So far, I have used a "website" .csproj to do this. In order to debug the application, I would right-click on an HTML file, "set as startup page", and hit F5. VS would start an IIS instance, serve the page, and all was well.
Now, I want to switch this project to the new SDK-style project format.
I am trying to use Microsoft.NET.Sdk.Web as the SDK. The project builds, but I can't debug it. If I try, I get a "RunCommand property is not defined". I don't have any way to set the startup page either.
Overall, I have the impression that I just can't use SDK-style projects for a "website" type project. What SDK should be used, and what properties or settings, to be able to have VS start IIS and serve a page when I start debug?
These are the relevant bits of my .csproj. Note that I've set OutputType to Library because otherwise csc would complain about not having a main.
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<!-- Prevents CS5001 -->
<OutputType>Library</OutputType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="3.6.4" />
</ItemGroup>
</Project>
Continue reading...