ASP.NET Core precompiled views on publish - asp.net-core-mvc

I've previously created an ASP.NET Core project with .NET Core 2.0 preview 1 and Visual Studio 2017 15.3 preview. Just the default stuff from the project template, no custom code yet. Then I used the Publish command and have everything copied to the directory bin\Release\PublishOutput. All nice and good. 5 MB, can be deployed to the production web server and it works.
Now I've tried the same thing with VS Code and just won't get anywhere. I created the project with dotnet new mvc and opened it in VS Code with code .. After closing and opening it a few times and editing .cs files, I think I've now jumped over all the hurdles that VS Code comes with. I can run the application locally.
But the publishing doesn't quite produce the desired result. I run dotnet publish -c Release manually because VS Code doesn't seem to offer anything here. I get tons of files in bin\Release\netcoreapp2.0, along with a subdirectory called publish. Both have a copy of MySite.dll and MySite.pdb, but no precompiled views DLL. Also, the publish directory has 54 MB of runtime DLLs that weren't required for what Visual Studio gave me.
What is the intended method to publish an ASP.NET Core MVC application with VS Code? Everything is the latest version, downloaded and installed today.
Do I need components from the full Visual Studio to get the complete publishing experience, with all the advertised features?

For the record, I have recently discovered in ASP.NET Core 2.0 preview 2 that this has been resolved. A project created with dotnet new mvc has the MvcRazorCompileOnPublish property set in the csproj file, and dotnet publish does the same as publishing through Visual Studio 2017 (15.3) now.

Related

Error publishing .NET MAUI project: the target "_GenerateAppxPackage" does not exist

I have a .NET MAUI project that was created with VS2022 Preview 2, and it builds without errors or warnings and works as expected in the debugger. Prior to updating Visual Studio to Version 17.4.0 Preview 4.0 I was able to publish the project as a sideloadable MSIX from within VS.
Since updating, I get the following error when I click Create in the Create App Packages wizard:
MSB4057 The target "_GenerateAppxPackage" does not exist in the project.
The error is listed against the MAUI project's .csproj file.
I've tried creating a separate new, default MAUI project in the new preview - this publishes ok and (as far as I can see) doesn't contain _GenerateAppxPackage anywhere within its files or project structure. So for now I'm assuming this isn't something new that was added with the preview.
I found some references to _GenerateAppxPackage on the web but they appear to refer to Azure integration. My project is a stand-alone data transformation app that doesn't even access the net.
I'm at a loss what to try next. I don't know what this target refers to, where it should "exist" within the project, or what it does. Can anyone help me understand the problem and/or point me to a solution?
Update: 2022-10-28:
I tried deleting the project structure and creating it from scratch with File -> New Project, then adding back only the .cs and .xaml files. Publishing the recreated project gives me the same error.
I also tried uninstalling the VS preview and re-downloading and installing it. Again, publishing the project gives me the same error.
I still have no idea what is causing this, or even where to start looking.
I faced with the same problem at Visual Studio 2022 17.4.0 (net6.0-windows10.0.19041.0).
The simplest solution for me was be using the command dotnet publish directly.
At root of project just write in terminal:
dotnet publish -f net6.0-windows10.0.19041.0 -c /p:RuntimeIdentifierOverride=win10-x64
I learned today that MAUI is now in the mainline Visual Studio 2022 edition, I've tried using that instead of the preview, and I can confirm that the problem goes away. I wish I'd known about this earlier...

Visual Studio 2019 is not working correctly for Windows Forms Projects

We are worming on Windows forms project which uses CAB Architecture and Infragistics Ultra Win Controls .
We have a common project which is being used in almost every project and have custom controls (Wrapper over infragistics controls).
Till .Net framework 4.7 and Visual Studio 2017 everything was working fine but when we have upgraded our solution to .net framework 4.8 and visual studio to 2019 (16.6.4 current version) along with infragistics control latest version, it starts creating issues for us. Below things stopped working at all.
Edit & Continue (Tried all possible combinations from stackoverflow and google responses)
IntelliSense (works on few projects)
References Navigation (works in few files)
After upgrade, we have removed all obj and bin folders, deleted .vs folder and rebuild solution. Also refreshed each project one by one.
I can rebuild, run and debug the application but can not edit code during debugging.
If anyone have any solution, then it will be a great help. We are feeling like coding in NotePad due to above issues.
Here is my Visual Studio Configuration
Issue was with the Windows Form project which uses CAB architecture and custom controls.
After reporting it to microsoft they have pushed some updated in the newest version and now everything is working fine.

Unable to create Cross-Platform .NET Standard Plugin Templates project

I am trying to develop my own plugins in xamarin form. I installed Cross-Platform .NET Standard Plugin Templates in VS 2019. I can see in description Cross-Platform .NET Standard Plugin Templates works with 2017 and 2019.
When I try to create new project it keeps going on saying creating project.
When I look in the directory, I can see some files being generated.
It's an existing issue with VS2019
Creating a new Project with VS2019 shows missing references / they cant be loaded. Appeared after last VS Update.
If you wait long enough you can do the following :
Note- after last VS 2019 update- edit the csproj file and update the MSBuild.Sdk.Extras to version 2.0.54 so all dependencies load and the project will build.
UPDATE:
Had to download Visual studio 2017 to create the project

Code Changes in visual studio are not taking place when deployed on IIS

I have cloned a .net web application to Visual Studio 2017.I have made some changes to source file in a project and cleaned and built it. my solution file has 52 projects and all the projects will build without any error. Once I deploy it in IIS server and attach the process to visual studio, it hits the breakpoint but runs the old code itself.
Any help will be appreciated as this is delaying the work!!!!

Cannot convert existing ASP.NET MVC 2 solution to Azure Web Role in Visual Studio 2010

I've been working on an ASP.NET MVC 2 (.NET 4.0, Visual Studio 2010) application for a while and have decided that I would like to deploy it as an Azure application.
After installing the latest (June 2010) Azure tools (through Visual Studio itself) I've added a blank CloudService to my solution. Whenever I try to add a "Web Role Project in Solution", however, I get the following error:
An error occurred trying to load the project properties window.
Close the window and try again.
Cannot evaluate the item metadata "%(FullPath)".
The item metadata "%(FullPath)" cannot be applied to the path
"obj\Debug|Any CPU\Cloud.dll". Illegal characters in path.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets
I get this same error whenever I try to Save All or view the properties page for the CloudService project.
I imagine it's having trouble with the Debug|Any CPU part of the path, but can I remove it or word around it?
Thanks in advance
Well, what do you know. When had already sort of given up on this, seeing as how I could run en deploy the application anyway I decided to try one last time and ended up finding the solution on this article:
http://tomkrueger.wordpress.com/2010/07/27/azure-deployment-issue-after-upgrading-to-visual-studio-2010-and-net-4-0/
The problem started because I actually added an Azure project to an existing ASP.NET MVC solution there were some unnecessary settings left over in the web.csproj file.
All I had to do was open web.csproj in notepad and remove all occurrences of the <PlatformTarget> element.
My MVC prjoject was x86 and of course Azure works on x64 only. Even though I had the platform target set up as AnyCPU somehow Azure couldn't quite get along with it.
Have you downloaded the latest Azure SDK? .NET 4 was not supported before the June 2010 version of the SDK.
Windows Azure Software Development Kit (June 2010)
Windows Azure Tools for Microsoft Visual Studio 1.2 (June 2010)

Resources