Build succeeded but publish failed in VS 2013 for WCF - c#

This question was already asked so many times. But the said solutions did not help. I tried to publish the WCF project. But it build successfully but failed on publish. I get the following message in output window.
I tried the following things
Checked the VS2013 having administrator rights.
Folders have permission to modify.
Changed the "MSBuild project build output verbosity" option to "Detailed"
above things did not give me solution. I attached my solution explorer for reference.
How can I resolve my problem?

I've ran into this issue before, the latest was while upgrading a WCF project from Visual Studio 2013 to 2015. The solution (with multiple projects) would build and run fine within VS but would fail when publishing the WCF service. No error in the publish step just the message:
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
The solution has always been in the project properties. In the latest case, was the Build > Platform Target which was setup as x64 by default in VS2015, which I changed to "Any CPU" and resolved my issue. I hope it helps.

Related

MSBuild publish not working for Office VSTO

I have been going crazy trying to fix this publishing issue for days. I have a VSTO application for Office that builds using MSbuild.exe successfully, in both debug and release. The problem arises when I try to run MSbuild like such: MSBuild -t:publish. The funny thing is, when I use the publishing wizard in Visual Studio 2019 Community, my application publishes properly. I only have issues when trying to use MSBuild.exe with the publish target, not with normal builds.
By right-clicking my project in VS 2019 and clicking Publish, I see this wizard which produces the expected result.
Expected Result:
MSbuild produces a publish directory with a .vsto file for my application along with a a reference directory with dependencies and/or a setup.exe
The expected result of running MSbuild with the publish target.
Actual Result:
When running MSBuild -t:publish in a command line that is CD'ed to the directory of my project, I get this error:
Project "D:\repositories\myapp\myapp.sln" (1) is building "D:\repositories\myapp\myapp
.csproj" (2) on node 1 (Publish target(s)).
_DeploymentUnpublishable:
Skipping unpublishable project.
Things I tried:
I tried a lot of things to get this to work. I read these threads:
First thread : Applies to ASP.net applications not VSTO, also says that McAfee can cause issues. I disabled all antivirus on my machine, still no luck. I have tried adding properties such as: /p:DeployOnBuild=true /p:OutputPath="publish/" /p:PublishDir="publish" /p:VisualStudioVersion=16.11 (my version) and all combinations of these and it never worked. I tried using /t:Package but I get the error: error MSB4057: The target "Package" does not exist in the project.
Adding <OutputType>winexe</OutputType> to my .csproj does not work because this application produces a DLL on normal builds, not an executable.
Second thread
I already have this installed. I'm testing the command line publish on my local development machine before I try this on the build server.
Third thread I am not using a shared add-in.
Fourth Thread ITT and others, they recommend using a .pubxml but I cannot figure out how to make one of those, AFAIK they are generated by ASP.net applications and not applicable to a VSTO application. I could be wrong, but again I don't know how to create one properly.
Fifth Resource This is a lot of stuff to do, and I am confused if it will even work. I DO have VS 2019 installed, my program builds successfully and runs successfully, and even publishes successfully when using the publishing wizard. I am not using TFS. I am just trying to produce the VSTO via command line.
For anyone who runs into this problem, it is because you are not loading:
Microsoft.VisualStudio.Tools.Office.targets
I wish the log would have been more specific about that.

VS 2015 - WP8 - "A specified communication resource (port) is already in use by another application."

I have a solution with the followings:
WP8 project
WP8.1 project
UWP project
Xamarin.Android project
PCLs
I have both VS2013 with Update 5 and VS2015 with Update 1 installed on my PC.
The OS is Windows 10.0.10586.318.
It is a fresh install as I reinstalled the whole PC due to other reasons.
Note: Before the reinstall I used VS2015 with Update 2 (and VS2013 with Update 5) but the same issue occured. So installing Update 2 does not seem to be a solution.
In the Configuration Manager the Android, WP8 and WP8.1 projects are checked in "Deploy" column.
I would like to use the WP8 emulator to debug my WP8 project.
In VS2013 it works as expected.
In VS2015 I can debug the WP8 app in the WP8.1 emulator but not in the WP8 emulator.
The deploy is successful but the following error message appears:
A specified communication resource (port) is already in use by another application.
In the statusbar: Launching TaskHost.exe failed.
In the output window:
1>------ Build started: Project: X.Y.WP8, Configuration: Debug Any CPU ------
1> X.Y.WP8 -> D:\Programs\DotNET\Visual Studio 2015 Projects\Y\X.Y.WP8\Bin\Debug\X.Y.WP8.dll
1> Begin application manifest generation
1> No changes detected. Application manifest file is up to date
1> Begin Xap packaging
1> Creating file X.Y.WP8_Debug_AnyCPU.xap
1> Adding .... (lots of files)
1> Xap packaging completed successfully
2>------ Deploy started: Project: X.Y.WP8, Configuration: Debug Any CPU ------
2>Deploying D:\Programs\DotNET\Visual Studio 2015 Projects\Y\X.Y.WP8\Bin\Debug\X.Y.WP8_Debug_AnyCPU.xap...
2>Connecting to Emulator WVGA 512MB...
2>The application is already installed on the device. Checking if an incremental deployment is possible...
2>Doing full deployment as project was cleaned and rebuilt...
2>Uninstalling the application...
2>Installing the application...
2>Updating information related to installed files...
2>Deployment of D:\Programs\DotNET\Visual Studio 2015 Projects\Y\X.Y.WP8\Bin\Debug\X.Y.WP8_Debug_AnyCPU.xap succeeded.
========== Build: 1 succeeded, 0 failed, 3 up-to-date, 0 skipped ==========
========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========
When I try to start debugging only one instance of VS2015 is running and nothing else.
I read lots of answers regarding same or similar issues but none of them worked.
Fortunately I don't have any non-Latin char in my user name.
Tried deleting the contents of ...\AppData\Local\Microsoft\Phone Tools\CoreCon\ folder.
Restarted VS2015.
etc.
What does VS2013 know what VS2015 does not?
As a workaround, for the WP8 project:
I can use VS2013 to use the WP8 emulator.
I can use the WP8.1 emulator in VS2015.
But the goal is to be able to use WP8 emulator in VS2015.
use the WP8.1 emulator in VS2015.

TeamCity - Missing 'Microsoft.Web.Infrastructure'

I've been browsing around StackOverflow exploring possible solutions to my issue. For some reason TeamCity is unable to find 'Microsoft.Web.Infrastructure' but I have installed all the required .Net packages. However, I've ran all the tests locally and building the project within Visual Studio returns a successful build.
This is the error which I am experiencing:
App_Start\NinjectWebCommon.cs(9, 40): error CS0234: The type or namespace name 'DynamicModuleHelper' does not exist in the namespace 'Microsoft.Web.Infrastructure' (are you missing an assembly reference?)
Solutions I have tried
Within Visual Studio I was instructed by one StackOverflow thread to set the reference 'Microsoft.Web.Infrastructure' option 'Copy Local' to true. This returned the same result of the error above.
I've deleted all references of 'Microsoft.Web.Infrastructure' and performed a fresh install of this package, I'd had also reinstalled Ninject as well. I didn't specify a particular version. Again, building locally was successful remotely not so much - same error occurred.
Has anyone encountered such issue before? I had also done a fresh clone of the GIT Repository, restored all the NuGet Packages (Which TeamCity does as well) and it built completely fine.
After asking this question I'd continued my investigation. While my continuous integration server is running multiple windows virtual machines, and since TeamCity load balances the builds across these virtual machines some of their configurations were out of sync with the rest. Some of the team code purely in C++, so the version of Microsoft Visual Studio which was installed (Visual Studio Professional 2013) was the incorrect version for my C# project. After attempting to open the project with Visual Studio on one of the selected VM's, I found that Visual Studio didn't understand the csproj file extension.
I installed Visual Studio 2013 Ultimate - this is version I use on my workstation - and thankfully it complied. sometimes within my project, when I request a build it would use older files as TeamCity would cache the files locally. I found setting the to 'clean and re-download' within the VCS options also remedied this issue.

Unfriendly build message

I can build my application in VS 2012 on my local machine and run it OK.
But I get this message;
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly.
It does not tell me which assemply is the problem, and I cannot build to the build server using TFS 2010.
How should I fix this?
You should set "detailed" for build output. In Visual Studio menu:
Tools -> Options -> Projects and Solutions -> Build and Run -> MSBuild project build output verbosity -> Detailed
If you wan to get the same in log file, then do the same things in combo below.

Visual studio 2010 IDE build fails mysteriously with no errors or warnings

If I try to build my .sln file in visual studio (using release configuration, but actually none of my configurations build), the build fails with zero errors in the output window and none the error list. In fact, in the build output window, I have 7 projects listed. And under normal verbosity, I have 7 "Build succeeded." lines after each project. Yet at the bottom:
========== Build: 6 succeeded or up-to-date, 1 failed, 0 skipped ==========
By building the projects one by one, I have found the 'failing' project and I tried to build it all by itself. It depends on one other project and that builds just fine all by itself. I try building the 'failing' project by itself and I get zero errors and no warnings and a build failed. However in the 'bin' folder for that project, (if I delete the old bin file) I am getting a built dll. Doesn't do me much good though, since the build is 'failing', visual studio makes no effort to launch my project in debug mode.
Here's something puzzling: In the command line, I have navigated to the directory with my .sln file in it, and I then run this command:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe /ToolsVersion:4.0 /p:Configuration=Release
Then, in bin/Release, voila, I have my built project. The build passes in the command line but not the IDE.
Does anyone have any suggestions? This problem has happened to me twice: Once on windows server 2008 and once on windows xp sp3.
Visual Studio 2010 says Build failed with no errors after I change a source file
One answer there suggested that I change the place from where I'm building. Here's the path of the debug directory:
C:\Users\Isaac\Documents\Visual Studio 2010\Projects\checkout\Library Projects\BaseSystemCore\BaseSystemCore\bin\Debug
Just moving the checkout directory to c:\ did the trick. Something to do with the build path being too long.
I had the same error, it would not build but no errors. Restarting visual studio worked for me, this was in visual studio 2012.
Close Visual Studio. Run cmd, and type: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
/ToolsVersion:4.0 /p:Configuration=Release yoursolution.sln
Then, enter again on VS and run your project. Worked for me!
if your solution contains too many projects ,
build projects individually,
Check which project is failing
for that project check the references of that project , if on any reference if their is yellow color mark, then delete that reference , and add that again , then build and check,
this will work
or
check in output window , each line , in some line it may be showing , dependency is their, but file didnt exist
that is the problem causing
this may be due to file corruption

Categories

Resources