.NET Framework Bookmark and Share   
 index > MSBuild > Unable to build solution file using MSBuild command
 

Unable to build solution file using MSBuild command

Hello,

I have written one batch script to build my solution using below command:

call %MSBUILD% ResearchProjects.sln /p:OutDir=%BUILDTARGETROOT%\%BuildType%\%BuildTarget%\ /p:Configuration=%BUILDTYPE%

I am facing following issues while building RIC solution file using MSBuild command.

1. Error while building AssemblyInfo.cs file. error CS0579: Properties\AssemblyInfo.cs(11,12): attribute Duplicate 'AssemblyCompany'

"E:\Depot\ScholarlyPub\RIC\product\main\ResearchInformationCenter.ApplicationDataBlock\ResearchInformationCenter.ApplicationDataBlock.csproj" (default target)

2. FATAL Error during build of Workflows Project:

"E:\Depot\ScholarlyPub\RIC\product\main\ResearchInformationCenter.Workflows\ResearchInformationCenter.Workflows.csproj" (default target) (4) ->

(WorkflowCompilation target) -> C:\Program Files\MSBuild\Microsoft\Windows Workflow Foundation\v3.5\Workflow.

Targets (127,5): error : #error: 'FATAL: Incorrect build environment.'

Issue one is related to duplicate values for the Assembly attributes, I even tried giving different values for attributes but still it didn’t work.

I have Visual Studio 2005 as well as 2008 on my dev(Build) machine.

Issue 1 arises, only after updating VS 2008 SP1, earlier this issue was not there.



Is this error related to .targets file like below?
C:\Program Files\MSBuild\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets

It would be great If someone help me out to resolve this issue.

Thanks and Regards


Nasir Khan
Nasir Khan - Persistent

Hi Nasir,

1.The error CS0579showsDuplicate 'attribute' attribute, have you checked you havespecifiedthe same attribute more than once in a project?

2. Thisissue is more related to Windows Workflow Foundation, so I highly suggest you post in our Windows Workflow Foundation Forum with following link:

http://social.msdn.microsoft.com/Forums/en-US/windowsworkflowfoundation/threads

If you post your question in appropriate forum, you will get quicker and better answer.

Best Regards,
Nancy


Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Nancy Shao

Hi Nasir,

1.The error CS0579showsDuplicate 'attribute' attribute, have you checked you havespecifiedthe same attribute more than once in a project?

2. Thisissue is more related to Windows Workflow Foundation, so I highly suggest you post in our Windows Workflow Foundation Forum with following link:

http://social.msdn.microsoft.com/Forums/en-US/windowsworkflowfoundation/threads

If you post your question in appropriate forum, you will get quicker and better answer.

Best Regards,
Nancy


Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Nancy Shao

Thanks Nancy for your quick response.
For the first issue Yes I have checked attributesI haven't added it more then once.

Once more thing which I tried is setting one Project Properties Build>>Generate serialization Assembly to 'off'.
After these settings I tried MSBuild MYProj.proj, now it is working. Not sure whether this is proper solution?

Second issue I will post to the WWF forum.


Thanks and Regards,


Nasir Khan
Nasir Khan - Persistent
Hi Nasir,

You'd better post the error log in this thread, or we are hard to explain the cause, the first thing we need toconfirm which task or target the error occurs in.


Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Nancy Shao

You can use google to search for other answers

Custom Search

More Threads

• Sample of "Copying Files/Directories" Task through MSBuild
• How to install & use MsBuild in VS 2005
• default build command-line
• Invalid arguments, path broken, ["NCover.Console.exe" exited with code 1
• How to include additional folders/files as part of VS Project/MsBuild build process
• MSBuild Doesn't Compile WDPROJ Files (Error: CS0246)
• restrictions on apps built with trial version
• AssemblyInfo task bug with multiple-instance assembly attributes
• Post event for the entire build process.
• How to find the dependent projects to deploy the dlls