I'm using VS2010 RC while targeting .NET 3.5. I can run code analysis via Visual Studio without a problem. However, when I try to run code analysis on our CI server it isn't getting executed. When I attempt to build using msbuild 4.0 I get the following exception:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\CodeAnalysis\Microsoft.CodeAnalysis.targets(129,9): error MSB4018: The "CodeAnalysis" task failed unexpectedly.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\CodeAnalysis\Microsoft.CodeAnalysis.targets(129,9): error MSB4018: System.TypeLoadException: Could not load type 'System.Runtime.Versioning.TargetFrameworkAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Like I said, it works fine when I run it through VS.
You will have tough times to set this up...
I would install VS2010 on the build server. Problem solved.
Note:
The Build server should be a replication of your developer environment (not production environment)
Related
Has anyone managed to build Xamarin Android apps with VS2017 MSBuild and Jenkins?
On our build machine we can build via the command prompt but when building via Jenkins we get this error.
C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2371,2):
error MSB4062: The "Xamarin.Android.Tasks.GetAndroidPackageName" task
could not be loaded from the assembly C:\Program Files (x86)\Microsoft
Visual
Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Build.Tasks.dll.
Method 'get_BuildEngine' in type 'Xamarin.Android.Tasks.AsyncTask'
from assembly 'Xamarin.Android.Build.Tasks, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null' does not have an implementation.
Confirm that the declaration is correct, that the assembly
and all its dependencies are available, and that the task contains a
public class that implements Microsoft.Build.Framework.ITask
We're using a Pipeline script with the following command. The same command works fine with VS2015 MSBuild and Jenkins.
bat "${msbuild15} /consoleloggerparameters:ErrorsOnly /v:quiet
/p:Configuration=ProductionRelease /p:Platform=\"Any CPU\" /t:Rebuild
Field\Product.Android.sln"
GetAndroidPackageName
This task will be failed majorly because your manifest file gets malframed, may be that manifest xml malframed, unncessary charecters might be present.
Remove them And your issue will be solved..
My web performance/load test has been working fine in VS2010 until yesterday when I installed VS2013. I didn't upgrade my project/solution file. I am still trying to run my tests within VS2010.
When I am trying to run webtest locally, I got the following error:
Request failed: Exception occurred: Object reference not set to an instance of an object.
at Microsoft.VisualStudio.TestTools.WebStress.WebTestCaseVariation.ProcessTransactionStarting(String transactionName, Boolean isForIncludedWebTest, Int32 declarativeWebTestItemId, Guid sourceWebTestId)
at Microsoft.VisualStudio.TestTools.WebTesting.WebTest.BeginTransaction(String transactionName, Boolean isForIncludedWebTest, Int32 declarativeWebTestItemId, Guid sourceWebTestId)
at Microsoft.VisualStudio.TestTools.WebTesting.WebTest.<GetEnumerator>d__0.MoveNext()
at Microsoft.VisualStudio.TestTools.WebTesting.DeclarativeWebTest.<EnumerateRequests>d__0.MoveNext()
at Microsoft.VisualStudio.TestTools.WebStress.WebTestCaseVariation.ExecuteNextTopLevelRequest()
I can run the test without an issue remotely though(my test controller is vs2010)
I can also run load test remotely, but got the following error thus not able to see the test results:
Exception LoadTestException 1 Results collection stopped due to the following error: Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.LoadTest, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
my projects are still referencing version 10.0.0.0 dlls,auto redirected by Visual Studio to the ones under vs2013 installation folder though, not sure why it's trying to load version 12.0.0.0
Much appreciate for any help.
I am trying to compile some C++/CLI using MSBuild. I am getting an error:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppClean.
targets(74,5): error MSB4062: The "CppClean" task could not be loaded from the assembly Microsoft.Build.CppTasks.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Could not load file or assembly 'Microsoft.Build.CppTasks.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
A colleague of mine has fixed this error by installing Visual Studio 2010 SP1 on his machine, but I already have that installed (as well as Visual Studio 2012 with Update 1) yet am getting this error. I have checked the path from the error message, and both the Microsoft.CppClean.targets and Microsoft.Build.CPPTasks.Common.dll files exist.
The CPPClean task appears to be part of the MSBuild tasks specific to Visual C++. Is there any way to get this as a separate installer so that I can repair it, or as part an installer for another set of tools? Failing that, is there another way of fixing this error?
Prompted by Lanorkin's comment, I checked the GAC and the Microsoft.Build.CppTasks.Common.dll assembly was not in there. I added it manually, and it now builds.
I have a clean, Windows 7 x64 box setup to build and run Windows Phone 7 projects. I installed Windows Phone Developer Tools 7.0, January 2011 Update and Windows Phone Developer Tools Fix as per the MSDN App Hub page. My WP7 applications build fine in VisualStudio, yet when I try to use MSBuild.exe, even on the simplest Visual Studio project
c:\Windows\Microsfot.NET\Framework64\v4.0.30319\MSBuild.exe .\SimpleWP7.sln
I get the following errors (with added space between lines for readability)
... verbose.output ...
C:\Program Files
(x86)\MSBuild\Microsoft\Silverlight
for
Phone\v4.0\Microsoft.Silverlight.Common.targets(185,9):
error MSB4018: The "CompileXaml" task
failed unexpectedly.\r
[C:\Users\alasdair.mccall\vs_workspace\SimpleWP7\SimpleWP7\SimpleWP7.csproj]
C:\Program Files
(x86)\MSBuild\Microsoft\Silverlight
for
Phone\v4.0\Microsoft.Silverlight.Common.targets(185,9):
error MSB4018:
System.IO.FileLoadException: Could not
load file or assembly
'PresentationCore, Version=3.0.0.0,
Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. The given
assembly name or codebase was invalid.
(Exception from HRESULT: 0x80131047)\r
[C:\Users\alasdair.mccall\vs_workspace\SimpleWP7\SimpleWP7\SimpleWP7.csproj]
C:\Program Files
(x86)\MSBuild\Microsoft\Silverlight
for
Phone\v4.0\Microsoft.Silverlight.Common.targets(185,9):
error MSB4018: File name:
'PresentationCore, Version=3.0.0.0,
Culture=neutral,
PublicKeyToken=31bf3856ad364e35'\r
[C:\Users\alasdair.mccall\vs_workspace\SimpleWP7\SimpleWP7\SimpleWP7.csproj]
...
What am I missing here? I have Silverlight 3 and 4 installed and I've installed everything as documented on the App Hub. Please let me know if there is any additional information required.
Cheers,
Alasdair.
I was using the wrong msbuild executable, I should have been using
c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
I'm unsure why, on Windows 7 64bit I should've been using what appears to be msbuild for 32bit applications. Thanks to #keyboardP for directing me to Visual Studio command prompt which helped diagnose this.
I almost have a NAnt script together that will build and deploy VS2010 database projects, but one error stands in my way:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.TSqlTasks.targets(56,5): error MSB4062: The "SqlBuildTask" task could not be loaded from the assembly Microsoft.Data.Schema.Tasks.Sql, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Could not load file or assembly 'Microsoft.Data.Schema.Tasks.Sql, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [xxx]
Failed to start MSBuild.
External Program Failed: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe (return code was 1)
I can see that the Microsoft.Data.Schema assemblies are not in the MSIL GAC on the build server - is there any clean way to do this without a full-freight installation of VS2010 on the build server?
For the curious, I asked Barclay Hill at Microsoft who answered this for me:
You can’t build database projects on
machines unless they have VS or TFS
2010 installed on them. It is not a
supported scenario. You can deploy
database project build outputs without
VS/TFS installed using vsdbcmd. The
only way to do this and be in line
with the licensing and support is to
install a local copy of VS Pro or
higher on your build box if not using
TFS.