A bit lost with ILMerge - c#

Thanks for taking some time to help me out.
Using: Microsoft Visual C# 2010 Express
I have two files: RJFCModPackInstaller.exe and Ionic.Zip.dll That i'd like to merge in to one: RJFCModpackInstaller.exe
I've tried to do post-build and havetried multiple GUIs, what can/should I do?
I tried using this:
"$(SolutionDir)ILMerge\ILMerge.exe" /out:"$(SolutionDir)\deploy\$(TargetFileName)" "$(TargetDir)$(TargetFileName)" "$(TargetDir)*.dll" /target:exe /targetplatform:'v4, C:\Windows\Microsoft.NET\Framework64\v4.0.30319' /wildcards
But came out with this error:
Error 2 The command ""C:\Users\FusionD\documents\visual studio 2010\Projects\RJFCModPackInstaller\ILMerge\ILMerge.exe" /out:"C:\Users\FusionD\documents\visual studio 2010\Projects\RJFCModPackInstaller\\deploy\RJFCModPackInstaller.exe" "C:\Users\FusionD\documents\visual studio 2010\Projects\RJFCModPackInstaller\RJFCModPackInstaller\bin\Release\RJFCModPackInstaller.exe" "C:\Users\FusionD\documents\visual studio 2010\Projects\RJFCModPackInstaller\RJFCModPackInstaller\bin\Release\*.dll" /target:exe /targetplatform:'v4, C:\Windows\Microsoft.NET\Framework64\v4.0.30319' /wildcards" exited with code 3. RJFCModPackInstaller
EDIT:
If I change the code to:
C:\Program Files (x86)\Microsoft\ILMerge\ILMerge.exe /out:"$(SolutionDir)deploy\$(TargetFileName)" "$(TargetDir)$(TargetFileName)" "$(TargetDir)*.dll" /target:exe /targetplatform:'v4, C:\Windows\Microsoft.NET\Framework64\v4.0.30319' /wildcards
I get error 9009:
Error 1 The command "C:\Program Files (x86)\Microsoft\ILMerge\ILMerge.exe /out:"C:\Users\FusionD\documents\visual studio 2010\Projects\RJFCModPackInstaller\deploy\RJFCModPackInstaller.exe" "C:\Users\FusionD\documents\visual studio 2010\Projects\RJFCModPackInstaller\RJFCModPackInstaller\bin\Debug\RJFCModPackInstaller.exe" "C:\Users\FusionD\documents\visual studio 2010\Projects\RJFCModPackInstaller\RJFCModPackInstaller\bin\Debug\*.dll" /target:exe /targetplatform:'v4, C:\Windows\Microsoft.NET\Framework64\v4.0.30319' /wildcards" exited with code 9009. RJFCModPackInstaller

There's an extra \ here:
/out:"C:\Users\FusionD\documents\visual studio 2010\Projects\RJFCModPackInstaller\\deploy
^
|
So I'd suggest changing
$(SolutionDir)\deploy
to
$(SolutionDir)deploy
The 9009 error is because you've removed the quotes from around the command now (so it's trying to execute C:\Program). Put those quotes back (or revert to your original command, just without the extra \).

Related

How to build Visual studio Setup project using command-line?

I have a sample WPF project and I created a Setup project to it. Now I want to build the project and Setup project through the command line.
I tried with this
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe
C:\Users\nandh\source\repos\CommendApp\CommendApp\CommendApp.csproj
command for build the project file it is successfully worked.
Then use with
devenv /build Debug
"C:\Users\nandh\source\repos\CommendApp\CommendApp.sln" /project
"C:\Users\nandh\source\repos\CommendApp\App\App.vdproj" /projectconfig
Debug
for build the setup project it shows error.
------ Starting pre-build validation for project 'App' ------
ERROR: An error occurred while validating. HRESULT = '8000000A'
------ Pre-build validation for project 'App' completed ------
Regards.
Have reproduced same issue in my machine. And resolve it by workaround from it3xl.
Create a Text Document file in desktop and copy the content from this xx.bat file into it. (for professional editon)
Save and rename the text document from xx.txt to Test.bat
Double click the Test.bat file, then this issue goes away when i rebuild them by devenv command.
Hope it helps.
Here is my build.bat script using Visual Studio Installer Projects Extension in Visual Studio 2022. Hope it helps someone.
#echo off
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set "{{=setlocal enableDelayedExpansion&for %%a in (" & set "}}="::end::" ) do if "%%~a" neq "::end::" (set command=!command! %%a) else (call !command! & endlocal)"
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
del build.log
%{{%
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.exe"
XXXX.sln
/out build.log
/build Release
/project XXX.Setup\XXX.Setup.vdproj
/projectconfig Release
%}}%

visual studio build xcopy command exited with code 2

I try to run a c# project. However, in builds. It said
Severity Code Description Project File Line Suppression State
Error The command "xcopy C:\Project\BusinessObject\bin\Debug\*.* "C:\Program Files (x86)\Telerik\Reporting Q3 2014\Report Designer\FM_DLLs" /r /y" exited with code 2.
I am using Windows 7 32 bit. And I found the "Program files (x86)" does not exist, is this the problem? How should I solve it?
Thanks

SonarQube analysis could not be completed because the analysis configuration file could not be found

SonarQube is giving me below error when i integrate the xamarin app with jenkins on windows sever
SonarQube Scanner for MSBuild 3.0
Default properties file was found at C:\SonarQube\bin\SonarQube.Analysis.xml
Loading analysis properties from C:\SonarQube\bin\SonarQube.Analysis.xml
Post-processing started.
13:49:43.952 SonarQube analysis could not be completed because the analysis configuration file could not be found: C:\Users\Administrator\.jenkins\workspace\Xamarin-ProjectTemplate\.sonarqube\conf\SonarQubeAnalysisConfig.xml.
13:49:43.952 Post-processing failed. Exit code: 1
I have followed the below guide https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild
SonarQube.Scanner.MSBuild.exe begin /k:"org.sonarqube:sonarqube-scanner-msbuild" /n:"Project Name" /v:"1.0"
MSBuild.exe /t:Rebuild
SonarQube.Scanner.MSBuild.exe end
Please help me to resolve this issue
The errors reported at the end of a SonarQube report are sometimes less helpful than the errors when you begin.
Eg when I got this error, scrolling to the top of the log showed that I wasn't correctly setting the sonar.projectKey value, but this message the OP shared is still what showed up at the end.
I had the same problem. You need find correct MSBuild.exe.
I have several in c:\Windows\Microsoft.NET\Framework64\... and also in c:\Program Files (x86)
For my project in Visual Studio 2017 with .NETFramework,Version=v4.6.1 the correct MSBuild.exe is:
"c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\amd64\MSBuild.exe" /t:Rebuild
For the Enterpsie version is should be:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild" /t:Rebuild
I got the same error and was able to fix it by excluding "/t:Rebuild" from second step. Also used the VS2017 MSBuild.exe
These are the 3 commands I ran in Windows Command Prompt (CMD):
1>> SonarScanner.MSBuild.exe begin /k:"MyProjectName"
2>> "C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/MSBuild/15.0/Bin/MSBuild.exe" "MySolution.sln"
3>> SonarScanner.MSBuild.exe end
Update I confront this error also , my solution was easy I just build the project in the visual studio then its succeeded.
I had this problem because I used a bad project key (it had a }) inside. I removed the }and the problem was gone.

Building selenium from source in Visual Studio 2010 (errors)

I am trying to build the source of Selenium using Visual Studio 2010.
Here are the steps that I did:
1 download the entire source from http://selenium.googlecode.com/svn/trunk/
2 Executed go bat file (waited about 3-4 minutes to complete, no errors)
3 Opened WebDriver.sln
When I try to compile the solution I get this error:
"Error 1 error C3861: '__stosb' identifier not found C:\Program Files
(x86)\Microsoft
SDKs\Windows\v7.0A\include\winnt.h 13074 1 webdriver-firefox-latest"
Tons of other identical errors (at various lines).
What is the problem?
Thanks in advance,
Vlad

Command Line Compiling a Win Forms C# Application

I'm trying to create a script to compile an Windows Forms C# 2.0 project from the command line (I know, I know.. I'm reinventing the wheel.. again.. but if somebody knows the answer, I'd appreciate it).
The project is a standard Windows Forms project that has some resources and references a couple external assemblies. Here is a list of the files:
Program.cs // no need to expand on this on :)
frmMain.cs // this is a typical C# windows forms file
frmMain.designer.cs // .. and the designer code
frmMain.resx // .. and the resource file
MyClasses.cs // this contains a couple classes
Properties\AssemblyInfo.cs // the Properties folder -- again pretty standard
Properties\Resources.Designer.cs
Properties\Resources.resz
Properties\Settings.Designer.cs
Properties\Settings.settings
References\AnAssembly.dll // an assmebly that I reference from this application
So far I've identified the following programs/tools that I would need:
csc.exe // the C# compiler
al.exe // the assembly linker
resgen.exe // the resource compiler
And this is my script so far:
#echo off
set OUT=Out
set AL=C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\al.exe
set RESGEN="C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\resgen.exe"
set COMPILER=C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe
echo.
echo Compiler: %COMPILER%
echo.
if "%1"=="/help" goto help
:start
echo Starting...
set REFERENCES=.\References\AReferencedll
set SRCFILES=Program.cs frmMain.cs frmMain.designer.cs MyClasses.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs
del /Q %OUT%\*
%RESGEN% /compile frmMain.resx,%OUT%\frmMain.resources
cd Properties
%RESGEN% /compile Resources.resx,..\%OUT%\Resources.resources
cd ..
%COMPILER% /target:module /out:%OUT%\app.module %SRCFILES% /reference:%REFERENCES%
%AL% %OUT%\app.module /embed:%OUT%\frmMain.resources /target:winexe /out:%OUT%\app.exe /main:App.Program.Main
goto done
:error
echo Ooooops!
:done
echo Done!!
In the end, no matter how I spin it I get different errors from the linker, or the final executable will just not run - it crashes.
Please help (MSDN didn't help too much..)!
I like to cheat for these kinds of things. Take a working project and run the following command on it
msbuild Project.csproj /t:rebuild /clp:ShowCommandLine
The output of that will show you the command msbuild uses to compile the project, which you can then take and modify as you like.
Is there a reason why you are not using msbuild? It can compile any visual studio project/solution in one command...
msbuild.exe <solution filename>
Just use MSBuild passing in the solution or project file.
The best way to use MSBuild is via the Visual Studio Command Prompt; it sets all the required environment variables for you. This command setup is also available in the SDK.

Categories