Unfriendly build message - c#

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.

Related

Creating MSIX using msbuild produces "doesn't have a target" error but works in Visual Studio

I have three WPF applications that I am including in a MSIX package. I have a solution that contains the three applications along with shared projects and a "Windows Application Packaging Project". I can build the MSIX by Choosing Publish -> Create App Packages on the Packaging project in Visual Studio. I am choosing Sideloading with a self-signed certificate and a Release (Any CPU) option.
This produces the MSIX output as expected.
I'm now trying to do the same thing through MSBuild so that I can integrate this into our automated build system. I'm using the command:
MSBuild.exe /restore /p:AppxBundle=Never /p:UapAppxPackageBuildMode=Sideloading /p:Configuration=Release;Platform="Any CPU" /p:AppxPackageDir=C:\temp\Output\ /p:AppxPackageSigningEnabled=false
This produces errors for the WPF applications as per below.
:\Repos\app\app.sln" (default target) (1:2) ->
"C:\Repos\app\appPackage\appPackage.wapproj" (default target) (19:6) ->
"C:\Repos\app\app\app.csproj" (publish target) (2:18) ->
C:\Program Files\dotnet\sdk\6.0.107\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(267,5): error NETSDK1047: Assets file 'C:\Repos\app\app\obj\project.assets.json' doesn't have a target for 'net6.0-windows10.0.19041/win-x86'. Ensure that restore has run and that you have included 'net6.0-windows10.0.19041' in the TargetFrameworks for your project. You may also need to include 'win-x86' in your project's RuntimeIdentifiers. [C:\Repos\app\app\app.csproj]
Why does this work in Visual Studio, but no in MSBuild? And how can I get this to work in MSBuild?

How to properly build MSI Setup Projects using Azure DevOps Pipelines?

I have been pulling my hair for the past couple days trying to figure out how set up a CI/CD process just to build a simple WPF solution and create the MSI setup file ("artifact") using Azure DevOps Pipelines. I have tried using Build VS Installer to accomplish this. My main problem is that I don't know exactly what am I doing wrong or what steps I am missing and I can't find clear instructions on this anywhere.
Here's what I've tried:
Using the Hosted 2017 agent pool and the basic .NET Desktop Template. Problems:
Create .msi file(s) from VS Installer project(s) as last task or before publishing artifact):
2018-11-28T22:57:56.3186071Z DEBUG: Aggregated: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.com
2018-11-28T22:57:56.3211382Z Now running (C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.com) with Arguments ("D:\a\1\s" /Build "release|any cpu" /Out "D:\a\1\b\BuildInstaller_Log_20181128225756.txt")
2018-11-28T22:58:54.0015320Z Done running DevEnv process. Success = True.
2018-11-28T22:58:54.1169279Z ##[warning]No .MSI files were found, please check your build-configuration. If this is expected, you might consider to use the default Visual Studio Build task instead of this custom Installer task.
2018-11-28T22:58:54.1434410Z ##[section]Finishing: Create .msi file(s) from VS Installer project(s).
Creating my own build agent as outlined in the documentation. I have Visual Studio Community 2017 with the VS Installer Projects extension installed on that server. I followed the steps from this related answer. Results:
2018-11-29T17:46:03.9813075Z DEBUG: Aggregated: System.Object[]\devenv.com
2018-11-29T17:46:04.4346060Z ##[error]Cannot retrieve the dynamic parameters for the cmdlet. The specified wildcard character pattern is not valid: System.Object[]
2018-11-29T17:46:04.4716416Z ##[section]Finishing: Create .msi file(s) from VS Installer project(s).
I also tried DevEnv Build from the market place instead of the DutchWorkz one and still couldn't get an .msi file. Can someone please show me some clear steps on how to achieve this simple goal?
I was able to figure out why I was getting the specific error message below and wanted to share in case it helps anyone out in the future.
DEBUG:
Aggregated: System.Object[]\devenv.com
[error]Cannot retrieve the dynamic parameters for the cmdlet. The specified wildcard character pattern is not valid: System.Object[]
The issue was that I had two versions (Professional and Enterprise) of Visual Studio 2017 installed on my private build server. Once I removed one of them, everything worked great. Not sure if there's a way to get it working with both installed, but I didn't need both.
Microsoft Visual Studio Installer Projects extension is present in windows-latest runner. Find more here
In short, use an agent with windows-latest vmimage and build via devenv.exe instead of MSBuild.

Display MSBuild warning in Visual Studio 2012

I work in a continuous integration environment.
Jenkins build my C# solution and display a lot of warning.
Here is an example of warning display :
In order to fix them, I want to get them in Visual Studio (and use vs' tools to debug them). Unfortunately, my warning list is empty :
How is it possible to configure VS 2012 in order to display MSBuild warning in Visual Studio ?
I already tried this link or this one, but doesn't work.
On the other side, when I browse the Code Analysis complete rules list, I cannot find the previous category :
Your CI Platform should be compiling in Release mode. Are you compiling in Release or in Debug within VS?
Code Analysis rule set are usually different between these two modes.

Build succeeded but publish failed in VS 2013 for WCF

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.

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