Quantcast
Channel: MSBuild forum
Viewing all 2763 articles
Browse latest View live

Al.exe could not be found with resource projects

$
0
0

Hi All,

I have installed VS2017 RC only in my machine and all the projects with resources for localization fails to build and shows error of "Al.exe could not be found".

This issue didn't reproduced while executing the projects individually in Visual Studio and only reproduces when building projects with MSBuild in command prompt.

Please let me know the fix for this issue.

Regards,


Amal Raj U


error how do i fix msb4184

$
0
0

i keep getting an error on   <CheckUAPVersions TargetPlatformVersion="$(10.0.10069.0)" TargetPlatformMinVersion="$(10.0.10069.0)" SDKIdentifier="$(SDKIdentifier)" SDKVersion="$(SDKVersion)" />
  </Target>

the error is Severity Code Description Project File Line Suppression State
Error MSB4184 The expression "10.0.10069.0" cannot be evaluated.  Zomrun C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\JavaScript\Microsoft.VisualStudio.JavaScript.UAP.targets 82 
 

please tell me how to fix it

How to declare variable in solution file for use in project files.

$
0
0

Hi Folks,

Apologies if this is not the right place to ask, but I would like to declare a variable in my solution file that can used by all of the projects (prof files) in that solution.

More specifically in the project files, references are stored using relative paths which cause issues if they don't exist. I would like to replace the relative paths with a variable set in the solution file that can easily be changed when the solution is built in a different location.

So I would like to replace "../../../SomeProject"  with "$(SomeLocation)/SomeProject"  but set the $(SomeLocation) in the solution file.

Regards

Andy

How to get CustomToolNamespace in T4 compilation.

$
0
0

Hello Folks,

I think I get to the right place.

I have following definition in *.csproj:

<ItemGroup><Compile Include="LIBAR_FRAES_INFO\SQL\Delete_Row.cs"><Generator>TextTemplatingFilePreprocessor</Generator><CustomToolNamespace>LiProd.Sql.LIBAR_FRAES_INFO</CustomToolNamespace><DependentUpon>Delete_Row.tt</DependentUpon><AutoGen>True</AutoGen><DesignTime>True</DesignTime><LastGenOutput>Delete_Row.cs</LastGenOutput></Compile></ItemGroup>


There also are a duplication of some definition: 

<Content Include="LIBAR_FRAES_INFO\SQL\Delete_Row.tt"><Generator>TextTemplatingFilePreprocessor</Generator><CustomToolNamespace>LiProd.Sql.LIBAR_FRAES_INFO</CustomToolNamespace><LastGenOutput>Delete_Row.cs</LastGenOutput></Content>

I also can put any definition to any place in *.csproj or *.sln - files are generated.

I looking how to put a whot-is-defined in <CustomToolNamespace>LiProd.Sql.LIBAR_FRAES_INFO</CustomToolNamespace> for specific template as a namespace.

As far as I get - I do add an Import section to my *.csproj :

<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v14.0\TextTemplating\Microsoft.TextTemplating.targets" /><PropertyGroup><TransformOnBuild>true</TransformOnBuild><TransformOutOfDateOnly>false</TransformOutOfDateOnly></PropertyGroup>


This force to re-compile T4 on the build, but as a Namespace are used following: 

<PropertyGroup><!-- Unless another namespace has been specified, use the project namespace as the
      default namespace from pre-processed files. --><PreprocessTemplateDefaultNamespace Condition=" $(PreprocessTemplateDefaultNamespace)=='' ">$(RootNamespace)</PreprocessTemplateDefaultNamespace></PropertyGroup>

Instead of RootNamespace for a whole project I need to use CustomToolNamespace for specific template.

As far as I understand a technology I need to import additional rules to overwrite existing PreprocessTemplateDefaultNamespace. 

I do search for a *.targets which contain an example of using CustomToolNamespace, but didn't find any suitable.

Can somebody point me on documentation where are described process of creating *.targets?

or

Can somebody provide an example of *.targets which used CustomToolNamespace for a specific template?

Error when building SCOM 2012 management packs with MSBuild

$
0
0

I have a Visual Studio 2012 solution with multiple management packs in it. Everything works fine when I build it in Visual Studio. When I'm building it running msbuild in VS2012 Native Tools Command Prompt everything works fine too. The problem appears when I'm trying to build it using an msbuild from regular cmd.

So, at first, I was getting multiple errors (for every management pack in solution):

C:\Program Files (x86)\MSBuild\Microsoft\VSAC\Microsoft.SystemCenter.OperationsManager.targets(210,5): error MSB4018: The "VerifyManagementPackFragment" task failed unexpectedly.\r [D:\Desktop\scom_managementpacks\2012\Zabbix.Linux.Library\Zabbix.Linux.Library.mpproj]C:\Program Files (x86)\MSBuild\Microsoft\VSAC\Microsoft.SystemCenter.OperationsManager.targets(210,5): error MSB4018: System.IO.FileNotFoundException: Could not find file 'D:\Desktop\scom_managementpacks\2012\WK.Zabbix.Linux.Library\FragmentSchemaOM20.xsd'.\r [D:\Desktop\scom_managementpacks\2012\Zabbix.Linux.Library\Zabbix.Linux.Library.mpproj]C:\Program Files (x86)\MSBuild\Microsoft\VSAC\Microsoft.SystemCenter.OperationsManager.targets(210,5): error MSB4018: File name: 'D:\Desktop\scom_managementpacks\2012\Zabbix.Linux.Library\FragmentSchemaOM20.xsd'\r [D:\Desktop\scom_managementpacks\2012\Zabbix.Linux.Library\Zabbix.Linux.Library.mpproj]

After I put FragmentSchemaOM20.xsd (I took it from VSAE installation) to location I started getting the following error:

01.MPName.mpx(2729,20): error : Undefined complexType 'http://schemas.microsoft.com/maml/2004/10:sectionsType' is usedas a base for complex type restriction. [D:\Desktop\scom_managementpacks\2012\Zabbix.Linux.Library\Zabbix.Linux.Library.mpproj]

The thing is there's MPName.mpx file has only 11 lines. I did some investigation and found out that actually, this error is pointing to FragmentSchemaOM20.xsd that I put to the folder.

How can I fix this? What is the proper way to build management packs with msbuild?

I've tried to build the whole solution pointing to .sln file and a separate project, pointing to a single .mpproj file. Example command:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe /t:Build D:\Desktop\scom_managementpacks\2012\Apache.WebServer.Discovery.And.Monitoring\Apache.WebServer.Discovery.And.Monitoring.mpproj

MSB3191

$
0
0

Hi,

I develop DLL project in native C++ under VS2013 Professional, Win7 64b Enterprise.

The project has 4 configurations as one can see from the snippet below.

At some stage, I added to the project's properties the post-build step as follows:

copy "$(ProjectDir)$(TargetName).ini" "$(TargetDir)*.*"

The project was successfully built an the .ini file was copied as expected. But following error were submitted:

Error1 error MSB3191: Unable to create directory "D:\MES\MULTICHANNEL\MULTITHREAD\IOM\IOM.ini D:\MES\MULTICHANNEL\MULTITHREAD\x64\Release". The given path's format is not supported.C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets12285 IOM
Error2 error MSB3191: Unable to create directory "D:\MES\MULTICHANNEL\MULTITHREAD\IOM\IOM.ini D:\MES\MULTICHANNEL\MULTITHREAD\Release". The given path's format is not supported.C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets12285 IOM
Error3 error MSB3191: Unable to create directory "D:\MES\MULTICHANNEL\MULTITHREAD\IOM\IOM.ini D:\MES\MULTICHANNEL\MULTITHREAD\x64\Debug". The given path's format is not supported.C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets12285 IOM
Error4 error MSB3191: Unable to create directory "D:\MES\MULTICHANNEL\MULTITHREAD\IOM\IOM.ini D:\MES\MULTICHANNEL\MULTITHREAD\Debug". The given path's format is not supported.C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets12285 IOM

What's going here?

Thank you in advance,

ARKA1956.

How to convert a Visual Studio project to an msi

$
0
0

Hi all,

How to convert a Visual Studio project to an msi, which should include tasks to deploy the c# exe and all the dependencies including in GAC.

Any application or a visual studio plugin will help. Also please let me know if the references are installed in the correct paths including in GAC.

Automatically deploy web application on build

$
0
0

To optimize our build process I want to deploy automatically the web application when they are built. The deploy is "FileSystem", which means that the built web application has to be deployed in a different folder on the same machine. This should work in visual studio as well as on the build server. Visual studio has the "Publish" function, which deploy a web application, but our solution has many web applications and we want to deploy all of them on build and not one after the other by hand. Also the build server should deploy all the web applications automatically during the build process. I was trying to cheat the build process by injecting the "DeployOnBuild" and "PublishProfile" in the "BeforeBuild" target, but it doesn't work. Is there a way to deploy always a web application after building?

<Target Name="BeforeBuild"><PropertyGroup><DeployOnBuild>true</DeployOnBuild><PublishProfile>$(ConfigurationName)</PublishProfile></PropertyGroup></Target>


Unable to build azure projects due to missing Azure SDK at the build server

$
0
0

See the link
https://twitter.com/AzureSupport/status/827119971884900355

In short, I have a VS solution which fails to build .ccproj files with the following error message:

error : WAT080 : Failed to locate the Microsoft Azure SDK. Please make sure the Microsoft Azure SDK v2.9 is installed.

Building an application without VS installed

$
0
0

Which action sequence I should apply to build a solution using MSBuild without installing Visual Stutio?

I have a VS2010 C++ project (targeting .Net FW 4.0) and Windows SDK 7.1 (components chosen are VC++ compilers, headers & libraries, IntelliSense and Reference assemblies). When building withC:\Windows\Microsoft.NET\Framework\v4.0.30319/MSBuild [path to .sln] /p:Configuration=Release, it shows the following warnings and errors:

C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(297,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.  TargetFrameworkVersion or PlatformToolset may be set to an invalid version number.
[Path to .vcxproj]

C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(147,5): error : Required file "" is missing. [Path to .vcxproj]

What can be done to compile a solution?


If I fall I will arise on my way to paradise

Windows Store apps with increment build using MSBuild

$
0
0

Hello friends!

I want to create Windows Store apps builds with incremental version numbers. I am using the following command but unable to get the desired build.

MSBuild /t:Publish /p:Configuration=Release /p:AppxAutoIncrementPackageRevision=True

P.S. I have gone through all the relevant questions but couldn't find the correct answer.

Thanks

Arafat

MSBuild path location differences for VS2017

$
0
0

Hi All,

I have faced an issue "Task could not not found the "Al.exe" file" when executing the projects with resource files for localization through command line in msbuild. 

The issue exists in machine installed with VS2017 RC alone and the msbuild location path we have provided for command line is below,

ProcessStartInfo psi = new ProcessStartInfo();

psi.FileName = "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Msbuild.exe";

psi.Arguments = "D:\Samples\Localization\cs\LocalizationDemo_2010.csproj" /p:Configuration=Release /nologo /noconlog /fileLogger /fileloggerparameters:logfile="D:\Samples\Localization\cs\build.log";

Process p = Process.Start(psi);


But when i change the msbuild location to msbuild located under VS2017, it works fine.

ProcessStartInfo psi = new ProcessStartInfo();

psi.FileName = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe";

psi.Arguments = "D:\Samples\Localization\cs\LocalizationDemo_2010.csproj" /p:Configuration=Release /nologo /noconlog /fileLogger /fileloggerparameters:logfile="D:\Samples\Localization\cs\build.log";

Process p = Process.Start(psi);

May i know the difference of execution with running projects with resource files in msbuild,, since the difference in locations results in issue though VS2010, VS2012, VS2013, VS2015 executes with the first provided msbuild location under framework location.

Please confirm the difference in common and VS2017 msbuild locations.

Regards,


Amal Raj U

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Python Tools\Microsoft.PythonTools.Django.targets(64,5): Error MSB4018: The "RunPythonCommand" task failed unexpectedly.

$
0
0

Hi,

I am trying to create django web project using visual studio python tools. while compile the solution getting below exception. this impacts the deployment currently. is there any issues choosing django latest version 1.10.5 and python3.6.

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Python Tools\Microsoft.PythonTools.Django.targets(64,5): Error MSB4018: The "RunPythonCommand" task failed unexpectedly.
System.ComponentModel.Win32Exception (0x80004005): The parameter is incorrect
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Microsoft.PythonTools.BuildTasks.RunPythonCommand.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()


Vijay

Always rebuilding a file...

$
0
0

My goal is to always compile x.cpp whenever something requires building. I've tried to use the pre-build option to delete x.obj in the hope that VS would then rebuild the file.

While the step deletes x.obj fine, the build process doesn't compile x.cpp. I assume it has already worked out what needs to be built before invoking the pre-build tasks. Is there another trick to accomplish this?

Thanks for any help in advance!

Visual studio cordova build error msb3073

$
0
0

Am using visual studio 2015 and whenever am building my cordova app for windows platform i get this error:

Description
The command "node "c:\users\ephraim\documents\visual studio 2015\Projects\ionic2-ts-sidemenu2\ionic2-ts-sidemenu2\platforms\windows\\\cordova\\prebuild-phone-81.js"" exited with code 1. [c:\users\naME\documents\visual studio 2015\Projects\ionic2-ts-sidemenu2\ionic2-ts-sidemenu2\platforms\windows\CordovaApp.Phone.jsproj]

Then followed by

Description
Error: C:\Program Files\MSBuild\14.0\bin\msbuild.exe: Command failed with exit code 1

and then

Description
\Program Files\MSBuild\14.0\bin\msbuild.exe: Command failed with exit code 1

i HAVE INSTALLED cordova tools for visual studio and am using windows 10 and visual studio 2015


Why is *.designer.vb and *.resx not being added dependent when adding as link in VS2015

$
0
0


I asked this question here also http://stackoverflow.com/questions/41386761/why-is-designer-vb-and-resx-not-being-added-dependent-when-adding-as-link-in

This is in my project when I add as a link a form into VS2015.

<Compile Include="..\..\..\..\..\ProductionLibs\ProductionLibs\FYIReports\frmFYIReport.designer.vb"><Link>NewFolder1\frmFYIReport.designer.vb</Link>    </Compile><Compile Include="..\..\..\..\..\ProductionLibs\ProductionLibs\FYIReports\frmFYIReport.vb">      <Link>NewFolder1\frmFYIReport.vb</Link>      <SubType>Form</SubType></Compile>
Same formed that was linked in VS2010.
<Compile Include="..\..\..\..\ProductionLibs\ProductionLibs\FYIReports\frmFYIReport.designer.vb">      <Link>FYIReporting\frmFYIReport.designer.vb</Link>      <DependentUpon>frmFYIReport.vb</DependentUpon></Compile><Compile Include="..\..\..\..\ProductionLibs\ProductionLibs\FYIReports\frmFYIReport.vb">      <Link>FYIReporting\frmFYIReport.vb</Link>      <SubType>Form</SubType></Compile>


Notice the missing `<DependentUpon>`.  
This [post](http://stackoverflow.com/questions/35961449/designer-cs-not-showing-in-solution) got me in the right area, my question is why is 2015 not working? This is happening on every form. I am use VB not C#. Although I am missing the `<DependentUpon>` attribute, we are not getting there the same way. If I open the 2010 project in 2015, all is good. Then if I remove the link and re-add it, I am broke. Not sure if I made a mistake, but when I tried to hack the project file and add the `<DependentUpon>`, it still did not work. I can repeat this over and over. I am seeing the same issue with the *.resx file.

Where does Visual studio store it's data?

$
0
0

Due to GDPR we need to know where Visual studio store it's data.Whether it's in the EU or in other countries, if so, which countries?

I hope someone can help me, as I have not found any specifications on location of data storage in Microsoft's privacy policy. 


Windows Defender detecting Visual Studio .dll file as Trojan:Win32/Bluteal.B!rfn

$
0
0

Windows Defender has flagged a .dll file (which seems to be related to Visual Studio) as suspicious.

File Name : C:\Windows\assembly\NativeImages_v4.0.30319_32\Microsoft.Vde5ed89a#\457b4a4c20bed2246e03f1f9e5eaa1a5\Microsoft.VisualStudio.Utilities.Internal.ni.dll

Message: Trojan:Win32/Bluteal.B!rfn

Threat definition version      : 1.269.412.0
Signature Last Updated       : 31-05-2018 20:03:50

Can you please confirm if this is a false positive?

Excute a task once per solution.

$
0
0

If I have a solution with multiple projects in it, and I call (from the command line):

MSBuild xxx.sln

I know that it will start building each of projects in the solution.

My question is: is there a way to make a task run only once, say with the first project? keep in mind that I do not know which is the first one, meaning it has to dynamic.

How to find all files to copy to the target directory on per ProjectReference basic?

$
0
0

   I'm looking for a property or task or any method which would allow me to find the list of all files which needs to be copied to the target directory of the currently build project. This is for custom packaging. For example if there is a project A and it references a project B and C and project B references project D in its turn I would like to get a list of projects consisting of B and C where each item is a list of files which needs to be copied to the target directory of A. In this example item B would contain all DLLs, PDBs, CONFIGs and custom content copied to B project target directory including all projects which project B referencing as other projects or binaries, so in this case it would also contain all DLLs, PDBs, CONFIGs and custom content from project D. Item C would contain the results of the building of item C with all DLLs, PDBs, CONFIGs and custom content.

A - B - D

A - C

   In other words I need to be able to iterate over all referenced projects in the current project either as Reference or ProjectReference and then iterate over all files copied to the target directory of each corresponding ProjectReference items.

   The biggest challenge I have so far is to gather this information on per ProjectReference basic. I found a bunch of properties:

_ResolvedProjectReferencePaths - gives the list of DLLs generated in result of building ProjectReference but no custom content or pdb or config;

ReferencePath - gives the list of all DLLs needed for the current project but everything is in a single heap, no way to understand which was referenced by Reference and which was referenced by ProjectReference and again no custom content or pdb or config;

ReferenceCopyLocalPaths - gives everything in a single heap including PDBs, XMLs, not sure about CONFIGs but no custom content and no way to distinguish which belongs to which;

ReferenceDependencyPaths - only DLLs of the 2+ deep level, it does not include the DLLs of direct references;

_ReferenceRelatedPaths - gives all PDBs, XMLs but no DLLs;

_SourceItemsToCopyToOutputDirectory - the only one I found to give the list of custom content but no way to understand which referenced project it belongs, sort of, technically I can compare the beginnings of the paths with let's say _ResolvedProjectReferencePaths.

   Anyway, is there way to get what I need which is grouped as I need? It's strange that I cannot find it. It would be logical to build everything recursively on per reference basis and would expect it to exist somewhere in the MSBuild properties or MSBuild tasks.

Thank you


Alex


Viewing all 2763 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>