How to use Microsoft.Build.BuildEngine to create a Silverlight project?

I use Microsoft.Build.BuildEngine to create a series of projects. Projects that do not use Silverlight build correctly, and projects that use Silverlight do not build. All of these projects (Silverlight and non-Silverlight) are perfectly built in Visual Studio 2008. I get an error message:

error CS0234: The type or namespace name "SilverlightControls" does not exist in the namespace 'System.Web.UI' (do you miss the assembly reference?)

I added System.Web.Silverlight to a project that builds using Microsoft.Build.BuildEngine. I can also see that the namespace in the project also does the assembly (so it seems that the project doing the assembly has access to System.Web.UI).

Any ideas on how I can avoid this error?


Added verbosity to the assembly through VS2008 and compared to a magazine created using Microsoft.Build.BuildEngine. It looks like Microsoft.Build.BuildEngine creates strings like:

It is considered "c: \ Program Files \ Reference Assemblies \ Microsoft \ Framework \ v3.5 \ System.Web.Silverlight.dll", but it was not.

He does not exist in this place, right? In fact, there are many places where he searches for this DLL and does not find it. I added the link, right-clicking, add the link, .Net, add. System.Web.Silverlight.dll does not appear on my machine (which is odd because the project is compiling using VS2008).

Comparison of possible sections of two logs: Microsoft.Build.BuildEngine

SearchPath "{GAC}". "System.Web.Silverlight, Version = 2.0.5.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35, processorArchitecture = MSIL", .

Visual Studio 2008

System.Web.Silverlight, Version = 2.0.5.0, Culture = , PublicKeyToken = 31bf3856ad364e35, processorArchitecture = MSIL


System.Web.Silverlight , Microsoft.Build.BuildEngine( VS2008). , Silverlight :

C:\Program Files\MSBuild\Microsoft\Silverlight \ v2.0\Microsoft.Silverlight.Common.targets(95,9): : Silverlight 2 SDK .

?

+3
2

, Microsoft.Build.BuildEngine, x86. , .

+3

, API- MSBuild?

ILogger (, ) engine.Loggers VS ( , , "tools\options\project and solutions\build and run\msbuild output verbosity 'to verbose)... , - -?

+1

Source: https://habr.com/ru/post/1714465/


All Articles