I am trying to publish or package our webrole into Azure, after migrating from SDK 2.5 to 2.7 (2.5 was working fine even though I am not sure if it is related).
This is the error I have from the Build in the Output window :
3>------ Build started: Project: MyProject.Azure, Configuration: Production Any CPU ------
4>------ Publish started: Project: MyProject.Azure, Configuration: Production Any CPU ------
4>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "msshrtmi, Version=2.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=AMD64", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.
4> Transformed Web.config using E:\Legacy\Main\Azure\MyProject.Front\Web.Production.config into obj\Production\TransformWebConfig\transformed\Web.config.
4>Done building project "MyProject.Azure.ccproj" -- FAILED.
4>
4>Build FAILED.
========== Build: 3 succeeded, 0 failed, 25 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
I have searched for an anwer and came up with this link http://blogs.msdn.com/b/narahari/archive/2012/03/30/windows-azure-package-creation-or-publish-fails-with-build-failed-message-in-visual-studio-output-window.aspx
where they state that it could be due to an OutOfMemoryException, and the fix is to build on a high end x64 system. I'm building on a core i7 16gig of ram really good computer so I don't think it comes from this. I also installed the windows 7 hotfix that fixes the emulator issue from largeaddressaware switch just in case but it did not help.
Thank you
Ok, I managed to solve the problem and here is how.
Actually, the issue is -even if totally not obvious- related to the diagnostics configuration.
What I did is increase verbosity for MSBuild output :
Tools > Options > Projects and Solutions > Build and Run > MSBuild project build output verbosity : Diagnostic
which uncovered this :
Failed to produce diagnostics extension's config for MyProject.Azure\diagnostics.wadcfgx.
Error : Value cannot be null. Parameter name: input
Then, the fix is to add :
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString"/>
in your ServiceDefinition.csdef and the correct implementations in your csfgs files.
After this, it all builds, packages and publishes.
Now, I am not sure if this question is a duplicate of Azure SDK v2.7 diagnostics issue is preventing publish/package because the title of the question in the link's post is already a step forward, and making the connection between this issue and the azure diagnostic configuration is really not that obvious, given visual studio's default minimal output.
Thanks everyone
Related
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.
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/
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.
I'm struggling with the following situation:
There is a bunch of projects (14 to be precise) in a VS2012 solution.
These projects are free from Code Analysis warnings and errors.
I would like to use the CodeAnalysisTreatWarningsAsErrors switch for our build server, so the build fails in case there are any CA issues. This is accomplished by setting the environment variable "CodeAnalysisTreatWarningsAsErrors" to "true". This flag is consumed by Code Analysis as parameter (see C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\CodeAnalysis\Microsoft.CodeAnalysis.Targets).
When building the solution from FinalBuilder (on the build server or on my machine) or from command line (through devenv.com), VS2012 output tells me that there are no Code Analysis warnings and no errors at all - but the build fails with no further reason.
I isolated the problem to the following pieces:
it is one single project that causes the fail. If i delete its binaries, the error can always be reproduced (this project uses the exact same .targets files and other environment stuff as the other projects)
if I set CodeAnalysisTreatWarningsAsErrors to false, the build succeeds (again, with 0 warnings and 0 errors).
The output from VS2012 is pretty poor and (according to my researches) there is no way to increase the verbosity level for devenv.com.
It looks like this:
1>------ Skipped Build: Project: xxxxxx_Test, Configuration: Debug x64 ------
1>Project not selected to build for this solution configuration
2>------ Build started: Project: xxxx.xxxx.Modules.Base, Configuration: Debug x64 ------
2> xxxx.xxxx.Modules.Base -> X:\xxx\x64\Debug\xxxx.xxxx.Modules.Base.dll
2> Running Code Analysis...
2> Code Analysis Complete -- 0 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 12 up-to-date, 1 skipped ==========
FinalBuilder adds the return value:
devenv.com returned Error code : 1
Does anybody have any ideas what could cause the build to fail only when setting CodeAnalysisTreatWarningsAsErrors to true although there are no warnings and errors at all?
Resolved the problem:
That line of MSBuild-output made me curious and finally led to the right place:
The indirectly-referenced assembly '...dll' could not be found. This assembly is not required for analysis, however, analysis results could be incomplete. This assembly was referenced by: ...dll
Indeed, there was an assembly of third-party software that did not match the referenced version.
Obviously, that did not produce any error or warning at all, but, when activating CodeAnalysisTreatWarningsAsErrors, Code Analysis thought it's better to return with an error.
So, the solution was to (temporarily) use MSBuild with different verbosity-levels ('diagnostic' was too much, 'detailed' gave me still about 29.800 lines for code analysis of that single assembly-project, including the missing assembly name), digging through that stuff and finding the needle in the haystack...
Thanks to dario_ramos for pointing me towards the right direction!
i am trying to make a setup of windows service.but when i was building the setup the output is like that..
------ Build started: Project: TwitterService, Configuration: Debug Any CPU ------
TwitterService -> C:\Users\Globus-n2\Desktop\LatestTweetMati\TwitterService\bin\Debug\TwitterService.exe
------ Starting pre-build validation for project 'Setup' ------
------ Pre-build validation for project 'Setup' completed ------
------ Build started: Project: Setup, Configuration: Debug ------
Building file 'C:\Users\Globus-n2\Desktop\LatestTweetMati\Setup\Debug\Setup.msi'...
Packaging file 'TwitterService.exe.config'...
Packaging file 'GlobusLib.dll'...
Packaging file 'TwitterService.exe'...
Packaging file 'GlobusTwitterLib.dll'...
========== Build: 1 succeeded or up-to-date, 1 failed, 0 skipped ==========
setup is failed i am not getting any error.i have tried to make a new copy but still problem remain.i have tried to add those dll again but problem is not solved.can any one please help me to solve this problem.il really very thankful if any one try to solve this problem.
(I'm assuming here that you are using Visual Studio to build this project)
Try altering the output verbosity for the compilation. In Visual Studio, go to Tools -> Options -> Projects and Solutions -> Build and Run and change the value of the combo box labelled "MSBuild project build output verbosity". Setting it to Detailed or Diagnostic should give you more info in the output window, which will hopefully shed more light on what the problem might be.