How to create an Empty web project (no C#, no MVC, no .Net References) in Visual Studio 2017 - visual-studio-2017

I need a web project that can be deployed to a web server (in this case IIS), however I do not want anything other than static HTML, TEXT and JSON files in the project. I don't want to do a build. I don't want a Properties folder. I don't want a BIN folder. I don't want an OBJ folder. I don't want any NUGET packages. Most of all, I don't want any DLL or .Net references.
I have tried the solution proposed by Microsoft here: https://social.msdn.microsoft.com/Forums/vstudio/en-US/7589fbbf-732d-4c99-b9e9-7fe247f18f5a/how-to-create-static-web-site?forum=visualstudiogeneral
This is not even close to a static site.
And, here: https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ASPNETCoreTemplatePack20173 I found an updated template which says it will create a static site without C#. It does not. Roslyn is included as is .Net CORE. Also at least 1 C# file is still generated and is still needed.
I tried going back to Visual Studio 2015 to see if there was an option there, which I could then just reopen in VS 2017, but I found none there either.
Anyone know how to create a truly empty web project for VS 2017, which can be published, but has only static content?

The solution suggested, that of using a Blank solution, really does not offer a solution at all. The blank solution still has no projects, and adding a project pulls in all the ASP.NET and/or MVC pieces I am trying to ignore.
I did find that I can use 'File->Open Website', browse to a folder with the static content and open the web site in Visual Studio. Once I have altered the content as desired, I have to use 'Website->Copy Web Site' to copy the files to the IIS server. A packaged deployment is not available. The 'Copy Web Site' indicate which files have changed so it is pretty easy to figure out what files need to be updated. To copy one or more files, use the connection buttons at the top of the dialog, then select files as necessary on the left and use the arrows in the middle of the dialog to move/copy files to the IIS server on the right.
Image of Copy Dialog
The result is a project I can open and edit in Visual Studio, which can be easily deployed/updated from inside Visual Studio. I tried the solution in VS 2015 and VS 2017.

Related

Visual studio 2022 .net 6 ckeditor config.js file gets reverted back on build

I am working on a .net 6 MVC web application in visual studio 2022. It has standard ckeditor 4 present in the wwwroot folder. So I wanted to include a plugin called "colorbutton" which is already present in the plugins folder.
So I've used this statement in config.js file "config.extraPlugins='colorbutton';" which is a valid way to include a plugin in ckeditor. So however, after doing this change, if I build the solution, the colorbutton plugin line I've added is reverting back itself, meaning that line just disappears.
I'm not able to understand what's going on with my vs. Please share your thoughts if anyone is willing to.
I have tried by changing properties of config.js file, Build Action to none and Copy to Output Directory to Do not copy. This didn't work

How do I fix Visual Studio 2022 Error E1696 for WinRT

When I generate a new WinRT project in Visual Studio 2022 I get Error E1696 cannot open source file "winrt/Windows.Foundation.h" yet when I look at the Include directories the files do exist at the correct location.
This is an artifact of the way C++/WinRT works. While the header files do exist in the Windows SDK, that's not where the project goes looking for them. Instead, they are generated on the fly into the source tree under the Generated Files directory.
So to fix the issue you will have to compile a newly created project at least once. This by itself isn't sufficient for IntelliSense to pick up the changes in environment. To help IntelliSense out you're going to have to right-click into the source editor, and select Rescan -> Rescan File.
Once that is done, all the IntelliSense errors go away, including E1696.
Historic background
It's easy to get confused why the C++/WinRT header files are part of the Windows SDK, yet the C++/WinRT VSIX templates aren't using them. A look back at C++/WinRT's history helps explain how we landed in this situation:
Initially, the code generator responsible for producing the language projection header files (modern.exe, later renamed to cppwinrt.exe) wasn't published. Instead, the header files were generated by Kenny Kerr, and published through his modern repo.
Publishing the language projection header files through a GitHub repository carried over into the cppwinrt repo owned by Microsoft, and continued to be the deployment channel for several versions of Windows.
This wasn't exactly convenient for developers, so with the release of the Windows SDK for Windows 10, version 1803 (10.0.17134.0) the headers got added to the SDK (including the code generator). This worked, but wasn't an ideal situation either, as the release cycle of C++/WinRT was now tied to that of the Windows SDK, roughly 6 months.
Decoupling the release cycles was crucial in allowing C++/WinRT to progress at its own pace, shipping frequent updates with improvements and bug fixes. This was enabled by deploying the code generator as part of a NuGet package that the C++/WinRT project templates reference. The MSBuild project drives generation of the language projection headers, and clients can freely decide, which version of the C++/WinRT library they wish to use, controlled through the NuGet package reference.
This is how things work today, but the language projection headers can no longer be yanked from the Windows SDK. They were published, with clients relying on finding them there, and expecting an SDK update to not break their builds. And this is why the Windows SDK contains header files you aren't meant to be using.
Often a Build --> Clean Solution followed by a Build --> Build Solution is enough to resolve the issue. Give Visual Studio a few seconds to complete any background work.
If that fails try reinstalling the Microsoft.Windows.CppWinRT NuGet package.
Go to Tools --> NuGet Package Manager --> Manage NuGet Packages For Solution...
In the NuGet Solution pane choose the Installed option.
Tick the CheckBox next to your Project name in the Window to the right.
Click the Uninstall button
And click Ok in the Change Preview dialog box.
The CPPWinRT package will now be removed.
Change to the Browse option in the NuGet Solution pane.
Type "cppwinrt" into the Search text box of the pane.
Select the Microsoft.Windows.CppWinRt package and install it.
Finally choose the Build --> Build Solution option.
After the Build has been completed give Visual Studio a few more seconds to complete any background work and the errors should be gone.

In Visual Studio, can you add a folder-based project in a solution?

Visual Studio finally has the ability to open folder-only projects, which makes it great for simple web sites that serve from the file system, etc. However, I can't find a way to add one of these projects to my existing solution. Whenever I try opening it, it tells me to close it.
So, how can you add a folder-based project to Visual Studio solution? Or can you?

How to hide items in the solution explorer in Visual Studio 2017

I've got an Entity Framework Core 2.1 project in which for some reason VS has decided to spam my solution items with dlls, props and target files as you can see below.
Is there any way to hide these files? Strangely enough they're not even in that file location.

"Manage Client-Side Libraries" menu not appearing

I'm trying to use the new Library Manager (LibMan) feature in Visual Studio 2017 (I'm using Version 15.7.1) but it is not appearing on either the project context menu or the Project menu.
I have tried various web projects but I can't see it for any of them. The only project type I haven't tried is ASP.NET Core 2.1 (I don't have the preview installed) but I can't find any docs that say it only works with ASP.NET Core 2.1
Here is a screenshot to prove it's not there:
had the same issue. I found the answer two it on another site, but for the life of me cannot find it for reference right now. The easiest thing to do is to build it yourself and install it. Works perfectly fine, I did it and now have the Manage Client Side libraries showing up.
Clone / download the Library Manager from GitHub. (https://github.com/aspnet/LibraryManager/)
Build it in Visual Studio 2017
Run the .Vsix installer
Begin to use the Manage Client Side Libraries from the context menu or project menu.
Hope this helps.
For me, in VS 2022 the context menu option appears but the dialog doesn't show. I found out that instead of right-clicking on project item i have to right-click on wwwroot item and then the dialog is shown
Even though Visual Studio Community 15.7.5 references the "Library Manager" it looks like it is still in Preview and to be released with VS 15.8.
If you would like to use the Library Manager now it is fairly easy but there are a few work arounds right now to get it to install, probably a reason it is still in Preview.
Clone or Download the source code
Note: This requires the Visual Studio extension development Workload to be installed (Tools -> Get Tools and Features under "Other Toolsets").
According to this issue on GitHub it will not install, before compiling the Extension open the project file for the LibraryManager.Vsix project
[LibraryManagerDir]\src\LibraryManager.Vsix\Microsoft.Web.LibraryManager.Vsix.csproj
and update (line #30)
<IsProductComponent>false</IsProductComponent>
After 15.8 comes out this needs to be reset back to true to be able to install it.
Open the LibraryManager.sln and make sure to change the Configuration to Release and Build the Solution.
This will create a .vsix install file:
[LibraryManagerDir]\src\LibraryManager.Vsix\bin\Release\Microsoft.Web.LibraryManager.vsix
Open Microsoft.Web.LibraryManager.vsix to launch the Visual Studio Installer.
Then you will have the Add->Client Side Library in your Context Menu.