Visual Studio 2013 Web Deploy Package Issue - c#

I've been using the Web Deploy Package to publish a site I'm working on to our test server but for some reason its started including the .sln file and it doesn't seem to be compiling the solution anymore. I've checked the configuration and its using the release build but when I deploy all of the .cs and .designer.cs are included. I'm deploying a second site using the same setting and that is deploying OK.
Has anyone else experienced this? I've cleaned and rebuilt the solution and I've deleted the publish profile and created a new one but nothing has helped.
Any pointers would be appreciated.

I've sorted this now. It turns out in the project properties > Package/Publish Web Tab I had the Items to deploy drop down set to "All files in this project". I changed to "Only files needed to run this application" and everything worked as expected.

Related

Visual Studio "Unable to copy file" during publishing

I keep getting this error during the publishing of my VS 2019 C# win forms project
Unable to copy file "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.TextManager.Interop.8.0.dll" to "bin\Debug\app.publish\Application Files\Database Client_2_0_0_47\Microsoft.VisualStudio.TextManager.Interop.8.0.dll". Could not find a part of the path 'bin\Debug\app.publish\Application Files\Database Client_2_0_0_47\Microsoft.VisualStudio.TextManager.Interop.8.0.dll'. Database Client
This also happens with 4 other DLL's with some being from VS 2019 itself and some from NuGet packages
This has only started happening recently so I'm unsure whether this is an issue with VS 2019 as no fundamental code has been changed and the only thing that has is some logos on a few .rdlc documents (Microsoft Report Viewer).
I'm running VS 2019 Community on version 16.11.4 with only .Net Desktop development, Office/Sharepoint development and a few individual packages installed.
I've looked around and can only seem to find people having issues with the .exes themselves due to them still being open however this is not the case for me as I have checked and there are no background processes like devenv.
What's strange is both the Debug and Release build fine with no issues whatsoever.
I've also tried deleting the \bin and \obj folders to no avail.
Below are some images of my settings that involve publishing
Publishing Main Settings
Prerequisites
Deployment
It seems the solution to this problem, as #HansPassant commented, was to shorten the build path as it was exceeding the MAX_PATH variable.
Once my project was moved from the default C:\Users\Drew\source\repos\ to just the C:\ drive my project was able to publish successfully.

Unable to debug and publish Azure Function from Visual Studio 2017

I used to debug and publish my Azure Function Project using Visual Studio 2017.
However suddenly everything stopped working.
When i tried to debug the project i got the error "A project with an Output Type of Class Library cannot be started directly.".
When i tried to publish the project, the option to publish to Azure disappeared and i'm only offered to publish to a folder.
When trying to create a profile i can also only choose the Folder Profile type.
I saw a similar behavior once in a Web Project when the "Project Sdk" Attribute in the .csproj file was wrong but i doublechecked it with a newly created Azure Function Project and it was the same.
When i create a new function project, i can publish to Azure as i could before.
I'm using the following packages:
along with .NET Framework 4.7.1.
Also i'm referencing some other projects from my solution containing Business Logic.
I ended up creating a new function project, copying everything there and now it's working again as expected.
Does anybody know how this could happen and how to fix it without creating everything from scratch?
In my case I was able to fix it by ensuring the NuGet package for Azure Functions was referenced:
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.14" />
I just had this same thing happen to me. I added a new Azure Function project to an existing solution, and it wouldn't let me debug it. I added an additional Azure Function project just to test it, and it worked fine. Compared the .csproj files, they were both correct.
I restarted Visual Studio and I was able to debug both Function projects, though I don't know if that will always fix the problem.
I had the same problem. I went in to the Visual Studio Installer and (re?) installed the "Azure development" workload. That fixed it for me.
Azure Functions tooling for Visual Studio is not always as stable as one would wish - but it's getting better for every release.
I had a similar problem after updating to Visual Studio 2017 v15.3 and then again when updating to v15.5. Both problems disappeared after updating or reinstalling the Azure Functions plugin.
But if you already have opened (and saved) to solution with a non-working VS setup then VS seems to 'destroy' the project sometimes.
You could look in your non-working project to see if your .csproj-file(s) contain:
<ProjectGuid>{0EC16A67-C60A-4950-A533-07D8783C88B0}</ProjectGuid>
...which is the guid for Azure Functions projects.
If your ProjectGuid is different then you could try changing it to the above and it should(might?) work.
It could be because the wrong project is set as startup project. In the solution explorer, you'll notice that the startup project is in bold. If it is not the right project, try right clicking on the correct one and click Set as startup project.
Solved it for me.

How to deploy a "Release" build of an ASP.NET MVC5 application

So It's the first time I'm trying to deploy an ASP.NET MVC application to a Windows host.
I set the compile mode to "Release" in Visual Studio 2015 and I compile it but don't know which folder(s) to zip and upload to server...
I see an obj folder in project directory that has two folder inside it. "Debug" and "Release". I'm not sure about them though.
On the other hand in project directory root, there is a folder with the same name as project, inside it I can see controllers so I'm pretty sure that folder is not a "Release" build.
My host is running Plesk and IIS 8.
What should I do?
You should use the Publish wizard of visual studio. As a shortcut --> Right click on the MVC project and click publish. You will find many option here.
Make sure you configure your publish profile in release mode if you are publishing on server

IIS and Azure using old assemblies

As I am building my project in visual studio, I build my entire solution and check http://localhost for my dev environment (using standard iis webapp), and when I want to push to staging I publish to my azure env. All of a sudden, whenever I build out my solution, its referencing some old compiled .dll of my projects because the same bugs keep coming up. I am sure of this because when I go into myproject/bin folder and take those dlls out seperately and overwrite them in my iis bin folder or on my azure server, the bugs are gone and my most recent code is there. Im not quite sure why it keeps doing this.
I went into visual studio under my references and selected my dlls and changed "Specific Version" to true, then rebuild the solution, then turn "Specific Version" back to false. It's weird because its not 100% consistent but it works most of the time.

Visual studio 2012 web deployment fails silently, did any one has workaround for this issue?

I am using VS 2012 Ultimate and I did web deployment using file system. It say publish success. but when I look the folder where I deployed doesn't have any files in it.
Have you tried going to the settings tab on the publish dialogue box and then changing the configuration to: Release - Any CPU.
I had the same issue as you and changing this fixed it.

Categories