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

How to specify libraries to link in a .targets file? VS19

$
0
0

Howdy! I have a .targets file that works for including header files. It doesn't work for getting static or dynamic libraries to link.
Could you show me what's wrong here?

<Project>

<PropertyGroup Label="Globals">
        <IncludePath>C:\Dir1\;$(IncludePath)</IncludePath>
        <IncludePath>C:\Dir2\;$(IncludePath)</IncludePath>
    </PropertyGroup>
    <ItemDefinitionGroup>
        <Lib>
            <AdditionalLibraryDirectories>C:\Dir1\lib\;$(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
            <AdditionalLibraryDirectories>C:\Dir2\lib;$(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
        </Lib>
    </ItemDefinitionGroup>
</Project>

Web Deploy publish/package validating error: Missing or Invalid property value for $(MsDeployServiceUrl)

$
0
0

Hi,

I am trying to do FS publishing for my .CSPROJ project and issue the following command:

call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe"  DemoWeb.csproj /m /v:m /t:Clean,Build,Publish /T:"DemoWeb:Rebuild"  /p:WebPublishMethod=FileSystem /p:DeployTarget=MsDeployPublish  /p:Configuration=Debug /p:DeployOnBuild=true /p:PublishProfile='FolderProfile1'

but instead of a working web app I get the following errors:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\Web\Microsoft.Web.Publishing.targets(4070,5): error : Web Deploy publish/package validating error: Missing or Invalid property value for $(MsDeployServiceUrl) [C:\prj\DemoWeb.csproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\Web\Microsoft.Web.Publishing.targets(4077,5): error : Target GenerateGlobalPublishSetting Failed [C:\prj\DemoWeb.csproj]

The folder prj contains DemoWeb\Properties\PublishProfiles\FolderProfile1.pubxml

 with the following content:

<?xml version="1.0" encoding="utf-8"?><!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121. 
--><Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"><PropertyGroup><WebPublishMethod>FileSystem</WebPublishMethod><PublishProvider>FileSystem</PublishProvider><LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration><LastUsedPlatform>Any CPU</LastUsedPlatform><SiteUrlToLaunchAfterPublish /><LaunchSiteAfterPublish>True</LaunchSiteAfterPublish><ExcludeApp_Data>False</ExcludeApp_Data><publishUrl>C:\build</publishUrl><DeleteExistingFiles>True</DeleteExistingFiles><PrecompileBeforePublish>True</PrecompileBeforePublish><EnableUpdateable>True</EnableUpdateable><DebugSymbols>False</DebugSymbols><WDPMergeOption>DonotMerge</WDPMergeOption></PropertyGroup></Project>

At the same time  in VS2019 Community publishing for the same profile runs with flying colors. What should I do to publish my project from cmd line?

Need to call a different post build event for build, rebuild & clean in VS17

$
0
0

Howdy! I need to call a different command for build, rebuild & clean in a VS 2017 project.

I was dreaming up something like this code, but I can't find any environment variables that correspond with rebuilding, cleaning & building.

<ItemDefinitionGroup><PostBuildEvent> <!-- want this to be called on build -->  <Command>CALL .\export.bat BUILD $(SOME_ENV_VAR)</Command></PostBuildEvent><PostBuildEvent> <!-- want this to be called on rebuild -->   <Command>CALL .\export.bat REBUILD $(SOME_ENV_VAR)</Command></PostBuildEvent><PostBuildEvent> <!-- want this to be called on clean -->  <Command>CALL .\export.bat CLEAN $(SOME_ENV_VAR)</Command></PostBuildEvent></ItemDefinitionGroup>
I'd be happy with a solution that does the same thing.

Cannot run a CUDA project getting this error any suggestions ?

$
0
0

Error MSB4019 The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 9.0.props" was not found. Confirm that the expression in the Import declaration "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\\BuildCustomizations\CUDA 9.0.props" is correct, and that the file exists on disk. vectorAdd C:\Users\Ivan\Documents\Visual Studio 2019\Templates\ProjectTemplates\Visual C++ Project\original\vectorAdd\vectorAdd_vs2012.vcxproj 44 

Error msb4019 the imported project , visual studio 2019

$
0
0

I use visual studio 2019 to open my example code, build the sample code failed, the below is message:

What happened? 


ErrorMSB4019The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\xxx" was not found.

Confirm that the expression in the Import declaration "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\\Microsoft.Cpp.Default.props" is correct, and that the file exists on disk.

I really appreciate if someone could advise me on this issue.


Object reference not set to an instance of an object.

$
0
0

I install visual studio2019 , vs_community__1392326258.1570290310.exe

I cannot create a new project. the message show "Object reference not set to an instance of an object".

Have anyone help the issue?

Write message to status bar or to a new status bar

$
0
0

How to write message to status bar or to a new status bar in Visual Studio 2019  (MFC) Multi-document?

Could you provide sample code?

I really appreciate if someone could advise me on this issue.

Issues with `msdeploy` (An error occurred when the request was processed on the remote computer.)

$
0
0

Hi,

I have tried the following to deploy a .NET Framework 4.5 application to a remote windows server using Jenkins and msdeploy:

def deployDev(folder, virtualDirectory)
{
bat "\"C:\\Program Files\\IIS\\Microsoft Web Deploy V3\\msdeploy.exe\" -verb:sync -allowUntrusted -source:package=\"${WORKSPACE}\\DIST\\Package\\${virtualDirectory}.zip\" -dest:auto=\"Default%%20Web%%20Site/${virtualDirectory}\",computerName=\"https://XX-XXX-XX:8172/msdeploy.axd?site=Default%%20Web%%20Site\" -enablerule:AppOffline -setParam:name=\"IIS Web Application Name\",value=\"Default Web Site\\${virtualDirectory}\" -verbose -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension"
}

While deploying I'm getting the following error:

14:29:53  Verbose: Source createApp (E:\Jenkins\slaves\AsoModernisation\workspace\ASO2_master\Aso2\obj\Debug\Package\PackageTmp) does not match destination (Default Web Site\Aso2) differing in attributes (isDest['False','True']). Update pending.
14:29:53  Verbose: Update operation on **createApp** (E:\Jenkins\slaves\AsoModernisation\workspace\ASO2_master\Aso2\obj\Debug\Package\PackageTmp) skipped because of rule ApplicationExistsRule.
14:29:53  Verbose: Delete operation on filePath (Default Web Site\Aso2\App_Offline.htm) skipped because of rule AppOffline.
14:29:53  Verbose: Source **setAcl** (E:\Jenkins\slaves\AsoModernisation\workspace\ASO2_master\Aso2\obj\Debug\Package\PackageTmp) does not match destination (Default Web Site\Aso2) differing in attributes (isDest['False','True'],setAclUser,setAclAccess). Update pending.
14:29:53  Info: Adding ACLs for path (Default Web Site\Aso2)
14:29:53  Verbose: Parameter entry 'IIS Web Application Name/1' is applicable to 'iisApp/E:\Jenkins\slaves\AsoModernisation\workspace\ASO2_master\Aso2\obj\Debug\Package\PackageTmp' because of its scope.
14:29:53  Verbose: Parameter entry 'IIS Web Application Name/2' is applicable to 'setAcl/E:\Jenkins\slaves\AsoModernisation\workspace\ASO2_master\Aso2\obj\Debug\Package\PackageTmp' because of its scope.
14:29:53  Verbose: Parameter entry 'IIS Web Application Name/2' is applicable to 'setAcl/E:\Jenkins\slaves\AsoModernisation\workspace\ASO2_master\Aso2\obj\Debug\Package\PackageTmp' because of its scope.
14:29:53  Verbose: Parameter entry 'Add write permission to App_Data Folder/1' is applicable to 'setAcl/E:\Jenkins\slaves\AsoModernisation\workspace\ASO2_master\Aso2\obj\Debug\Package\PackageTmp\App_Data' because of its scope.
14:29:53  Error: (21/02/2020 14:29:53) An error occurred when the request was processed on the remote computer.
14:29:53  Error: The server experienced an issue processing the request. Contact the server administrator for more information.
14:29:53  Error count: 1.

I've opened port 8172, checked user permissions, tried reinstalling msdeploy (v3.6), added IIS Manager permissions, created pools and virtual directories under the default website.

Would anybody have a suggestion on what's wrong with this? Anything with createApp or setAcl that would cause the issue?





Update message on status bar or on a new status bar for multi-documents with CEditView./CRichView

$
0
0

I create a Visual Studio (MFC) multi-documents with CEditView or CRichView.

Could you provide examples for write messages to status bar for multi-documents project?


Latest Build Tools 16.5 (vs2019) - Error Help

$
0
0

Hi,

I am trying to upgrade a build server to use the latest MSbuild and I am getting an error running MSbuild which I can't seem to work out.

The latest Visual Studio 2019, same MSBuild version locally builds the solution with no errors, but on the build server it gets an error on each project.

Therefore I think it is environmental setup on the build server, but I have repaired the build tools install and checked the framework sdks are installed and I am now a bit stuck.

Error:-

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1181,9): error MSB4064: The "TargetFrameworkFallbackSearchPaths" parameter is not supported by the "GetReferenceAssemblyPaths" task. Verify the parameter exists on the task, and it is a settable public instance property.

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1177,5): error MSB4063: The "GetReferenceAssemblyPaths" task could not be initialized with its input parameters.

If anyone could point me in the right direction, that would be a great help.

Thank you,

Phil

Solution in TFS Build pipeline getting failed

$
0
0

I have a solution with .net framework 4.6.1 and using visual studio 2019 i can successfully build the solution. When the solution is checked on to the TFS and using TFS Build pipeline to build project the build task is getting failed. (agent is configured in the same machine only where i have visual studio 2019)

One of Error displayed are as follows:

error CS1056 : Unexpected character '$'  actually the code at this line is like this

var value = $" value of {rootpath} ";

for other few line the unexpected characters are '{' , '=>' , '}'

Can anyone help me on this ?

SmartStore.NET Building Error in VS2019

$
0
0

Can you help me to fix the errors bellow? I downloaded SmartstoreNet and when I run ClickToBuild.cmd I get the errors bellow:

Build FAILED.

       "Z:\WorkspaceNew\Test Projects\SmartStoreNET-4.x\SmartStoreNET.proj" (Deploy target) (1) ->
       "Z:\WorkspaceNew\Test Projects\SmartStoreNET-4.x\src\SmartStoreNET.sln" (Build target) (2:2) ->
       "Z:\WorkspaceNew\Test Projects\SmartStoreNET-4.x\src\Libraries\SmartStore.Services\SmartStore.Services.csproj" (
       default target) (14:36) ->
       (CoreCompile target) ->
         Orders\IShoppingCartService.cs(293,39): error CS0106: The modifier 'public' is not valid for this item [Z:\Wor
       kspaceNew\Test Projects\SmartStoreNET-4.x\src\Libraries\SmartStore.Services\SmartStore.Services.csproj]
         Orders\IShoppingCartService.cs(299,39): error CS0106: The modifier 'public' is not valid for this item [Z:\Wor
       kspaceNew\Test Projects\SmartStoreNET-4.x\src\Libraries\SmartStore.Services\SmartStore.Services.csproj]

    0 Warning(s)
    2 Error(s)

Time Elapsed 00:00:04.92
Press any key to continue . . .




TFVC branch creation

$
0
0

I want to create a new branch in TFVC with powershell, can anyone please help with script?

I want to know commands used to synch two branches. (newly created with old one)

How to create smart tag for WPF custom control?

$
0
0

Hi Team,

I have a custom control. I need to smart tag for my custom control with my design. Please guide me how to proceed this.




R.Senthil

MIDL will not generate DLLDATA.C unless you have at least 1 interface in the main project.

$
0
0

Hello,

I am a beginner in ATL world and COM Servers and  I am trying to create a COM Server, type of server must be executable(.exe) to create a local out-of-process server using ATL Project Wizard. With that selected template, Visual Studio 2019 generates two resources: DuminicaCallbackServer and DuminicaCallbackServerPS. I created an ATL Object and an Interface and builded the project, but I dont find any .dll file for it. The error that I get when I build the DuminicaCallbackServerPS is "MIDL will not generate DLLDATA.C unless you have at least 1 interface in the main project.", because my interface is not defined there, but in DuminicaCallbackServer resource. What can I do to generate the .dll file? 



Run custom code when Nuget is installed using PackageReference

$
0
0

Hi,

I am working on a .NET library and web application project with c#.

We used to run custom code/actions using install.ps1, init.ps1 and uninstall.ps1 file while we used packages.config for Nuget. Now that we have PackageReference, I know only init.ps1 works.

Could anyone please help me how can I make it work for my custom code that I need to run when Nuget is installed with PackageReference? If not by using init.ps1, is there any other workaround to achieve the same?

NOTE; I am trying to perform actions like add Import Project statement (to include a .targets file existing in nuget) to csproj when Nuget is installed

Thanks in advance!

 

Visual Studio code MFC CEditView support utf format , utf-8 utf-16

$
0
0

I create a CEditView app, when i open a file only support utf-8 or utf-16 by VS configuration.

How to support both of utf-8 and utf-16 with CEditView app?

Could you please provide sample code in Visual Studio code MFC?

Do I need a license to run Visual Studio 2019 on our build server

$
0
0

We're about to purchase stand-alone professional licenses for my team and I'd like to know whether we need to buy another license for the build server (we're running it on a Win10 machine under a Jenkins CI server if that makes a difference).

Previous advice I've read has suggested as long as we have licenses for the developers using the build server, that we do not require an additional one but I cannot find any documented confirmation that that is the case for Visual studio 2019

my projects don't run

$
0
0

hi

why my project doesn't run?

I uninstalled my vs2012 and installed vs2019 but I still have this problem

even I open from main way that it saved, it doesn't work

the error is:

Severity Code Description Project File Line Suppression State
Error  Unable to create a manifest resource name for "..\..\..\..\..\Desktop\school\1 paygah dade\podman 3\form\calculator\calculator.resx". Could not find a part of the path 'C:\Users\Dell\Desktop\1 paygah dade\Desktop\school\1 paygah dade\podman 3\form\calculator\calculator.cs'. calculator   

Changing output directory

$
0
0
Is it possible to move the bin and obj directories for a csproj file?  This still seems to be impossible as of VS2008 beta2 (I haven't checked RTM yet).  There seems to be a lot of permutations of this question around the net, and they all resolve to roughly wanting something like the following.  Given a project located here:

\dev\src\projectA\projectA.csproj

...when you build, the build dirs are created here:

\dev\bin\projectA\*
\dev\obj\projectA\*

...so that \dev\src\* is kept clutter-free of temp and output directories.  I know this has been brought up for both the 2003 and 2005 betas, but it's never been addressed.  The common fix I see suggested is to modify either IntermediateOutputPath or BaseIntermediateOutputPath, but neither seems to solve all the issues.  A few of the caveats I've run into that come to mind:

-obj\debug\Refactor and obj\debug\TempPE are always created under the project file's directory.
-Setting BaseIntermediateOutputPath brings up an annoying security warning when you open the afflicted project.
-Directories don't seem to be created in the correct locations when referencing several projects with Base/IntermediateOutputPath customized independently.

This sort of thing is frustratingly trivial with C++ projects, and I have a hard time believing everyone is fine with these temp dirs spread throughout their C# codebase, so I'm wondering how other people have solved this?

John

Viewing all 2763 articles
Browse latest View live


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