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

How to specify the configuration and target .NET Framework version for the Microsoft Build Engine?

$
0
0

I am trying to do a Release build using the .NET Framework 3.5 and the Build Engine. The Build Engine is trying to use .NET Framework 2.0 even after specifying 3.5. How do I specify the configuration and the target framework?

public bool Compile(string solutionName)
{
    if (!File.Exists(solutionName))
        throw new FileNotFoundException("File not found: " + solutionName);

    Engine engine = new Engine();
    engine.BinPath = @"C:\Windows\Microsoft.NET\Framework64\v3.5\msbuild.exe";
    engine.DefaultToolsVersion = "3.5";

    ConsoleLogger logger = new ConsoleLogger();
    engine.RegisterLogger(logger);

    bool result = engine.BuildProjectFile(solutionName);
    engine.UnregisterAllLoggers();

    return result;
}


MSDeploy

$
0
0

Hi,

Can i get msdeploy command to deploy to Azure and i have the binaries packaged into zip folder

my website url on Azure : Tfswebapp-itt.azurewebsites.net

Thanks,

Error MSB4057

$
0
0

I have Visual Studio 2010 SP1.

I wrongly edit and save the file

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets

and now I can't compile anymore. The error I got is

1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(767,39): error MSB4057: The target "_Xsd" does not exist in the project.

I reinstalled Visual Studio 2010, I copied the file from another computer but nothing works and I still have the same error. What can I do?

Build process with MSBuild Target

$
0
0

Hi folks,

In package->xyz.MSBuild -> build ->xyz.MSBuild.Targets

<?xml version="1.0" encoding="utf-8"?><Project xmlns="....."><UsingTask AssemblyFile="........" TaskName="......." /><Target Name="Build"><Message Text="...."/><ItemGroup><JavaScriptFiles Include="..\..\..\app\**\*.js"/></ItemGroup><CompressorTask  ....... /></Target></Project>

I run MSbuild build/xyz.MSBuild.Targets in command prompt and it goes good. this is manually but i want to like to run automatically like Press F5 or Build Solution. can we build process with MSBuild targets ....if yes then how?

I am waiting for your response.
Thanks in advance!

How to compile .s (asm ) files in visual studio 2008 with Windows Embedded compact 7?

$
0
0

I need the steps and setting changes  in visual studio 2008 , so that .s files gets compiled.

Problem in CodeAnalysisLogFile

$
0
0

Hi, 

I am passing CodeAnalysisLogFile parameter from msbuild command line but the problem is it is not creating a single file

rather it is creating log files for each projects.

Is there a way we can create a single log file by modifying Build project file?

Thanks

Want to use Microsoft.web.service3 when adding a web service.

$
0
0
        Dim MyServ As New HSEmpService.EmpServiceService()
        Dim token As New UsernameToken(strUserName, strPassword, PasswordOption.SendPlainText)
        MyServ.RequestSoapContext.Security.Timestamp.TtlInSeconds = 86000
        MyServ.RequestSoapContext.Security.Tokens.Add(token)

        DispThis(MyServ.sayHello() & NewLine)

When I add a web service the Reference.vb is built with 

        Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
I have to change it to 

Inherits Microsoft.Web.Services3.WebServicesClientProtocol
to use the Service3. If I update the service I have to manually change them again. Is there a way for the add web reference to automatically use the Microsoft.web.service3?

Pre or Post build event command line in Project type of Web Site Visual Studio

$
0
0

Hi Folks,

I want to add 

"$(MSBuildBinPath)\msbuild.exe" "$(ProjectDir)MSBuild\TestMSBuild.Targets"

in Pre-build event command line.

But there is no Build events from properties in web Site project in visual studio.

Any Idea?

I am waiting for your response.
Thanks in Advance!



Visual Studio 2010 C# project - publish difficulties

$
0
0
I have a small program for opening CD drives.  After starting over enough times I got smart and made a backup.  I want to work out any bugs before trying to publish my large project.  When I publish the project and then try to install the program I get a pop up window telling me that it "Cannot download the application.  The application is missing required files.  Contact application vendor for assistance."  Well, that's me and I cannot figure out what is wrong.  Now, if I open my project backup and try to publish it again it throws this "Error 12 Unable to copy file "obj\x86\Debug\OpenCD.exe" to "..\OpenCD.exe". The process cannot access the file '..\OpenCD.exe' because it is being used by another process.    OpenCD".  The publish process stops at this point and will not continue.  I don't know what other process might be using it and I don't know how to determine what's using it.  I have a backup copy of my project that I place back into my working directory so that I don't have to redesign everything.  Regardless, I'm in a helpless loop that I can't fix.  Hopefully I'm in the right forum - I don't want to offend anyone.

How do I launch a simple Coded UI test at the end of the build (not XAML anymore)?

$
0
0

Hello,

I have a Coded UI test that runs against a desktop app we have developed.  It simply Launches the App, and Exits.  I can run it from the Command Prompt using C:\Program
Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"
MyRegression1.dll /Tests:CodedUITEstMethod1 /UseVsixExtensions:true
/logger:trx (where
MyRegression1.dll has the tests contained from my build)  it returns Success.  Here is my question:

We have a Build that builds the application that this .dll above has tests for.  At the end of the build, I want to run this test shown above.  I need to place a build step.  Should I use a Powershell script?  How?  Can you give an example?  Can I run my test on a remote machine against the app (without using PSEXEC, this divorces my build from the output of the test run).  Must I use Agents/Test Runners.  Is there something I can follow that works tutorial like or can someone please provide a simple example of the build step(s)?  Thanks,

Chris P.S. In the past we would probably have used a Test.proj file - but that is the old XAML way

How to build a project with all its dependencies in a solution?

$
0
0

   I have a solution with 3 main projects: universal app project, windows phone Silverlight 8.1 project, these two are the same functionality projects created for different platforms and sharing common files using a shared project plus there is a desktop project which is not related to the other two and intended to build and deploy the other two projects. Besides that there are 28 projects added to the solution. Some of those projects are used in the main two as referenced projects. Some of them are test projects. Those projects are again belong to 3 different platforms: universal app, windows phone Silverlight 8.1 and desktop.

   Now a couple of words regarding the projects configurations. Most of the projects have Debug, DebugPro, Production, ProductionPro, Release and ReleasePro configurations but not all of them. In the configuration manager I specified that for example for the DebugPro configuration of the solution I would like

Util.Universal to be build as Debug

Widnows.Universal to be build as DebugPro

Media.Universal to be build as Debug

FileDownloader.Universal to be build as DebugPro <- this is the main project for the universal app platform

   Now, I would like to automate building of the projects and I'm trying to find a correct command line for the msbuild. Initially I tried to build the target project directly like

msbuild FileDownloader.Universal.csproj /p:Configuration=DebugPro Platform=x86 /v:m /m

   That immediately failed trying to build dependent projects and I understand why. Because at least one of the dependent projects does not have DebugPro configuration. Then I thought maybe if I specify solution for the build the problem will be resolved. After all the solution knows which project configuration should be used for particular solution configuration. I tried different variations of the command line but it seems to me that this one should work

msbuild FileDownloader.sln /t:FileDownloader_Universal:Rebuild /p:Configuration=DebugPro /p:Platform=x86 /v:m /m

   With this command line the build starts as expected. It starts rebuilding dependent projects with the configuration specified for those projects in the solution file but the problem is that after it builds all the dependent projects and then the main projects it does not stop. It continues building other projects in the solution. I cannot understand how to fix it, how to make it stop right after the specified in the command line project is rebuilt?

   Maybe I'm missing something on the higher scale. In this case how to approach this problem?

Thank you


Alex

Help me resolve warning for a conflict with SqlServer.

$
0
0

There was a conflict between "Microsoft.SqlServer.SqlClrProvider, Version=13.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" and "Microsoft.SqlServer.SqlClrProvider, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91". 9> No way to resolve conflict between "Microsoft.SqlServer.SqlClrProvider, Version=13.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" and "Microsoft.SqlServer.SqlClrProvider, Version=13.0.0.0, Culture=neutral, Pu

I rebuilt a project using VS 2017 RC and I have never seen the above warning before.

I think I just found a way to get rid of my dependence on Smo, using SqlDataSourceEnumerator as part of System.Data.Sql as described here:

https://msdn.microsoft.com/en-us/library/system.data.sql.sqldatasourceenumerator.getdatasources(v=vs.110).aspx

But if someone can tell me a solution for the above remedy I would be curious the solution.

Thanks

Visual Studio 2015 Tools for Unity version 2.3.0.0

$
0
0

Hello,

I would like to update, but can not uninstall this version 2.3.0.0 because I am missing his vstu2015.msi .

Where can I find the download link?

thnks,

Jan

My question was not clear enough...

I am looking for vstu2015.msi version 2.3.0.0 in order to uninstall ....

or another method....

GenerateResource task appears to be calling 3.5 version of resgen.exe instead of 4.0?

$
0
0

We have a utility that scans a source tree and generates MSBuild project files to build localization satellite assemblies. These project files contain a simple list of the input RESX files, a list of referenced assemblies (for a few special resource types), and make use of the GenerateResource and AL tasks to do its magic. This worked great when everything was .NET 3.5/VS2008.

A number of VS2010 projects were recently added to the source tree, and they build to target 4.0. For a few projects, GenerateResource fails hard giving the error "ResGen : error RG0000: Could not load referenced assembly "myproject.dll".  Caught a BadImageFormatException saying "Could not load file or assembly 'myproject.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded." This happens even when the project file is built in a VS2010 command prompt, and even after modifying the generated project files to include ToolsVersion="4.0" and <TargetFrameworkVersion>v4.0</...>. Note that the referenced assembly "myproject.dll" is the main assembly for which the satellite was being built, and was indeed built to target 4.0.

We noticed something curious in the VS2010 projects that did build - they all logged the following:

      Project "T:\myproject.es.proj" (default targets):
      
      Target -GenerateResources:
          C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\ResGen.exe /r:T:\bin\myproject.dll /compile data.es.resources
      Target Build:
          Creating directory "bin\".
          C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\AL.exe /culture:es /out:bin\es\myproject.resources.dll /template:T:\bin\myproject.dll /embed:obj\data.es.resources
      
      Build succeeded.
          0 Warning(s)
          0 Error(s)

Note that the AL task executed from the NETFX 4.0 Tools subfolder, whereas ResGen came from its parent. Both AL and Resgen have counterparts in both folders, and the ones in C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin report (in the tool's banner) .NET 3.5 / VS 9.0 whereas the ones in C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\ report .NET 4.0 / VS 10.

Any thoughts? It seems odd that two tasks in the same project file would select tools from different versions of the framework, especially since .NET 4.0 assemblies can't be consumed by 3.5 tools. It appears we can workaround this issue by updating the utility to generate scripts to call the correct ResGen using <Exec ...>, but somehow that doesn't look nearly as clean as simply calling <GenerateResource ...>

Thanks,

-T

PS: For what it's worth, the machine is 32-bit XP SP3 with both VS 2008 and 2010 installed.


Creating Build and Release Definitions for Web Sites not Web Applications

$
0
0

Is this possible?

We currently have build definitions and release definitions setup and working for Web Applications.  However we have a lot of older web site type projects and will not work with the current build and release definitions that we already have setup.

Is there a way for us to get the web site projects to work with the build and release definitions in TFS?

Thanks


Changing IntermediateOutputPath breaks C# compilation (MSB3491)

$
0
0
I'm attempting to consolidate the intermediate outputs of building a Visual Studio 2015 solution to a single directory within my output directory. The solution contains a C# class library (among other projects).

In order to do this, the library project imports "common.proj", which defines the following:
<BaseIntermediateOutputPath>$(OutputPath)OBJ\</BaseIntermediateOutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(MSBuildProjectName)\</IntermediateOutputPath>

Prior to defining these values, the project compiled successfully. For the sake of clarity, $(OutputPath) is also defined in common.proj, and seems to be fine (i.e. when the build succeeds, it contains the expected outputs).

After defining the values, compilation fails with the message:
error MSB3491: 
Could not write lines to file "obj\x86\Release\\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B1_BC5D3.cs". 
Could not find part of the path 'C:\Data\Repositories\Code\[Subsystem]\[subgroup]\[projectname]\src\obj\x86\Release\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B1-BC5D3.cs'.

I understand why the build process can't write to the file - the obj directory no longer resides under the project's src directory, so that's fair enough. What I don't understand is why it's trying to write to the file in that location, given I have changed base and intermediate output file locations.

I've missed something, but my googling hasn't pulled up anything particularly useful - any suggestions would be good.



MSBuild Failure - What Permissions Are Needed To Build Workflow Projects? [CompileWorkflowTask]

$
0
0

I get the following error when running our MSBuild service (via CruiseControl.NET) as Local System.  However, it does not occur when running the service as me.  Please let me know if this is something that has been seen before and what resolution I might find.  Specifically, what permissions requirements are needed to compile Workflow projects using MSBuild?

 

C:\Program Files\MSBuild\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets (127,5):

                             errorMSB4018: The"CompileWorkflowTask" task failed unexpectedly.

System.IO.DirectoryNotFoundException:Could not find a part of the path 'C:\Windows\system32\config\systemprofile\AppData\Local\Temp\n8gmcgnr.tmp'.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)

   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)

   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)

   at System.CodeDom.Compiler.TempFileCollection.EnsureTempNameCreated()

   at System.CodeDom.Compiler.TempFileCollection.AddExtension(String fileExtension, Boolean keepFile)

   at System.Workflow.ComponentModel.Compiler.CompileWorkflowTask.Execute()

   at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean&amp; taskResult)

 

Environment: Windows Server 2008, 64-bit


Thanks,
Jonathan


MSB4018: The "CompileWorkflowTask" task failed unexpectedly.

$
0
0
Hi There,

 I'm trying to compile a Solution with a few projects in it via MSBuild on a windows 2008 machine (32bit). THis exact same process used to work on a 2003 enterprise machine without a hitch. On 2008 it fails on a couple of places. One of them is When it tries to compile a Sequential WOrkflow task from a project.

"T:\Adm\msbuild\AppSoftware.target" (AppSoftware_All target) (1) ->
"T:\AppSoftware\App.DotNet.BuildSolution\Developer.sln" (default target) (8) ->
"T:\AppSoftware\Server\Components\BatchServicesScheduler\App.Server.Components.csproj" (default target) (71) ->
(WorkflowCompilation target) ->
  C:\Program Files\MSBuild\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets(127,5): error MSB4018: The "CompileWorkflowTask" task failed unexpectedly.
C:\Program Files\MSBuild\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets(127,5): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object.
C:\Program Files\MSBuild\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets(127,5): error MSB4018:    at System.Environment.GetEnvironmentVariable(String variable, EnvironmentVariableTarget target)
C:\Program Files\MSBuild\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets(127,5): error MSB4018:    at System.Workflow.ComponentModel.Compiler.CompileWorkflowTask.Execute()
C:\Program Files\MSBuild\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets(127,5): error MSB4018:    at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)


This runs as a scheduled task that triggers a batch file that SUBSTitutes a folder to a drive (T:) and calls MSBUILD with a project (AppSoftware.target). This AppSoftware calls (among many other lines) the following: 

<

 

MSBuildProjects ="$(AppSoftwarePath)\App.DotNet.BuildSolution\Developer.sln"Properties ="Configuration=$(TRG)"StopOnFirstFailure ="true"ContinueOnError ="false"/>

 This Solution file has about 70 projects, all c# (WebProjects, Silverlight projects, etc).

 WHen this runs on its own (from the scheduled task), that error comes up, if I run this as a logged in user (command line OR IDE) the compilation goes through.
 I'm not sure what needs to be setup on the Scheduler for this not to happen. THis is how my Scheduler is setup (Which i think is right):

 Author: Administrator
 When RUnning task, use acct: Administrator
 Run whether is logged or not (Not store password is UNCHECKED)
 Run with Highest priviledges CHECKED
 HIdden UNCHECKED
 Configure for Windwos 2008
 Action->Start Program->batchfile.bat


Did anyone have such problem or knows how can I solve this one?
THanks,
Marcelo

timestamp in ms build log file

$
0
0
How to display timestamp in ms build log file like Jenkins time stamp  for every action

MSBuild building projects that are NOT in sln

$
0
0

I have identical setup.sln and an integration.sln. A developer added 3 csproj files to integration.sln and referenced them from contained cproj. Somehow

<MSBuild Projects="..\Setup.sln" Properties="Configuration=Release;Platform=Any CPU" StopOnFirstFailure="true" />

Picks up csproj that are not in the Setup.sln and builds them.

When I open Setup.sln from VS 2015 I get errors because of the missing projects.

How do I MSBuild to behave the same as VS IDE?




Viewing all 2763 articles
Browse latest View live


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