Visual Studio publish doesn't report errors - c#

I have a WCF web service using Visual Studio 2015. If I have a compile error in C# code, when I publish the web service (to a file location) the "build" will succeed, and continue through a successful publish:
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========
If I then deploy to an IIS web server and call the web service there, the call fails and returns a page describing the compilation error.
When publishing, the output in VS starts with Build started: but apparently it isn't really doing a build because any build would have failed, and in fact if I do a build instead of publish, it does report the error(s). Do I have to remember to build before publishing to check for errors, or is there a way to get it to really for realz compile the code?

If solution has many projects then try building them one at a time.
Try below steps:
Restart Visual Studio.
Restart Computer
Rebuild all
Clean Solution then Rebuild All
Also you can check below
Setting the MSBuild project build output verbosity (in Options > Projects and Solutions > Build and Run setting area) to "Diagnostic" as shown below. This then showed that the custom action was what had failed.
https://blogs.msdn.microsoft.com/saraford/2008/10/07/did-you-know-you-can-configure-the-msbuild-verbosity-in-the-output-window-329/

Related

Publish WinForm on ftp with subsequent updates

I've been trying for a while to find a reliable and straightforward way to implement auto-updating for my WinForm applications.
I've researched examples in which I ought to implement a new class and do the whole process manually. This is not what I want to do.
Instead, I want to use the VS publish to ftp option, as shown below.
I preselected all of the update options I want as shown below.
I get the following output:
2>------ Publish started: Project: MyApp, Configuration: Debug Any CPU ------
Connecting to 'ftp://ftp.mysite.com/'...
Publishing files...
Publish success.
Warning: Unable to view published application at ftp://ftp.sigmoidgroup.com/.
ftp://ftp.mysite.com/
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========
When I log-in to my server, I can see the following files:
My question now is... how do I implement the installation for the client? Do I have to create a separate mini-app that downloads the files from the ftp (checks the latest version) or is this already pre-defined in VS?
The auto-update should just work if you deploy to the same folder location. (If users have a shortcut to the manifest on the ftp site, ClickOnce handles the updating of files). I see you have different folders for different versions, you shouldn't need more than one unless users need to access older versions. See this for more ClickOnce info.

Visual Studio 2015. Unable to publish my project - appears to build fine

Visual Studio 2015.update3 - fully updated & patched - windows 8.1 - .net 4.7.1
2>------ Publish started: Project: Prometheus, Configuration: Release x64 ------
2>Connecting to C:\Temp\publish...
2>Project "test.csproj" (GatherAllFilesToPublish target(s)):
2> Building with tools version "14.0".
2> Target "ValidateMSBuildToolsVersion" skipped. Previously built unsuccessfully.
2>Done building project "test.csproj" -- FAILED.
2>
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, **1 failed**, 0 skipped ==========
I have searched and tried every solution online - no joy. Have spent over 3 days trying to sort this out - getting super frustrated now. It appears to build fine but always fails to publish to a local folder on the pc.
Hoping someone can point me in the right direction.
Note: I have tried Any CPU, Debug, and Release configurations - all end the same. I have configured the build to output diagnostic information which is available on request.

Can't publish a ClickOnce Application using the Publish Wizard

I' trying to publish ClickOnce Application to a webserver through sftp (Using Visual Studio 2015. The server is Centos 6.7).
My final config in the Publish Wizard:
The application will be published to:
sftp://10.1.0.88/home/www/sample/web/desktop/
Users will launch this application from:
http://sample.example.com/desktop/
When I published: (Output)
Connecting to 'sftp://10.1.0.88/home/www/sample/web/desktop/'...
Publishing files...
Publish success.
Warning: Unable to view published application at http://sample.example.com/desktop/publish.htm.
http://sample.example.com/desktop/publish.htm
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========
Nothing was added in /home/www/sample/web/desktop/. But it says Publish success.
What should I do?
It turned out the deployment files were added to /root/home/www/sample/web/desktop/instead of /home/www/sample/web/desktop/
So I change publishing folder location from
sftp://10.1.0.88/home/www/sample/web/desktop/
to
sftp://10.1.0.88/../home/www/ecr/web/desktop/

Microsoft.Lightswitch.Build.Tasks.Targets(168,5): application definition contains critical errors

I have a complex lightswitch application that was created using visual studio 2013, and then I upgrade it to using visual studio 2015. the solution was working fine, I even did a couple of deployment for it. Now I am trying to build it from a new machine and the build hangs (it never finishes). The output console is displaying an error: Microsoft.Lightswitch.Build.Tasks.Targets(168,5): application definition contains critical errors
I tried Google for a solution but could not find one that works in my case, I already checked the Link1 and this one Link2
When I cancel the build another similar error is displayed this is the output console:
------ Build started: Project: Agency Tool.Server, Configuration: Debug Any CPU ------
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\LightSwitch\v5.0\Microsoft.LightSwitch.Build.Tasks.targets(168,5): error : Application definition contains critical errors.
------ Build started: Project: Agency Tool.DesktopClient, Configuration: Debug Any CPU ------
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\LightSwitch\v5.0\Microsoft.LightSwitch.Build.Tasks.targets(217,5): error : Application definition contains critical errors.
------ Build started: Project: Agency Tool, Configuration: Debug Any CPU ------
The data necessary to complete this operation is not yet available. (Exception from HRESULT: 0x8000000A)
========== Build: 0 succeeded, 3 failed, 0 up-to-date, 0 skipped ==========
Resolved:
We noticed that in the main project properties--> extensions tab, Microsoft Lightswitch Extensions was not selected (I don't know what caused it to be unchecked, but I did not do it manually). However when we checked it the error disappeared.

Error in code publishing

If I publish the code then it is not copying in web folder that exists in wwwroot .
Empty folder is there but while publishing it is saying that Site was published successfully.
After that it open blank browser with message (To Parent Directory)
It is giving no error.
Building directory '/project/Users/'.
Pre-compilation Complete
------ Publish started: Project: F:\...\project\, Configuration: Debug Any CPU ------
Connecting to site E:\project...
Publishing directory /...
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========
I got the solution
Publish in debug mode first then change settings and publish in release mode. it will surely work :)

Categories

Resources