Giter VIP home page Giter VIP logo

Comments (2)

icnocop avatar icnocop commented on June 11, 2024

I was able to resolve those compiler errors by doing the following

  1. Change <Project Sdk="MSBuild.Sdk.Extras/3.0.44"> to <Project Sdk="Microsoft.NET.Sdk">
  2. Add <OutputPath>bin</OutputPath> within <PropertyGroup></PropertyGroup>
  3. Add <Import Project="$(MSBuildProgramFiles32)\MSBuild\Microsoft\Silverlight\v5.0\Microsoft.Silverlight.CSharp.targets" />

However, I get the following warning message:

C:\Program Files\dotnet\sdk\7.0.401\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.targets(37,3): warning MSB4011: "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.CSharp.targets" cannot be imported again. It was already imported at "C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v5.0\Microsoft.Silverlight.CSharp.targets (20,5)". This is most likely a build authoring error. This subsequent import will be ignored. [E:\github\icnocop\MSBuildSdkExtras\Tests\SilverlightApplicationExtras\SilverlightApplicationExtras.csproj]

Is there a way to resolve the warning message?

Thank you.

from msbuildsdkextras.

icnocop avatar icnocop commented on June 11, 2024

I was able to resolve it using the following:

<Project Sdk="MSBuild.Sdk.Extras/3.0.44">
  <PropertyGroup>
    <TargetFrameworks>sl5</TargetFrameworks>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>SilverlightApplicationExtras</RootNamespace>
    <AssemblyName>SilverlightApplicationExtras</AssemblyName>
    <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
    <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
    <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
    <SilverlightApplication>true</SilverlightApplication>
    <SupportedCultures>
    </SupportedCultures>
    <XapOutputs>true</XapOutputs>
    <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
    <XapFilename>SilverlightApplicationExtras.xap</XapFilename>
    <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
    <SilverlightAppEntry>SilverlightApplicationExtras.App</SilverlightAppEntry>
    <TestPageFileName>SilverlightApplicationExtrasTestPage.html</TestPageFileName>
    <CreateTestPage>true</CreateTestPage>
    <ValidateXaml>true</ValidateXaml>
    <EnableOutOfBrowser>false</EnableOutOfBrowser>
    <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
    <UsePlatformExtensions>false</UsePlatformExtensions>
    <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
    <LinkedServerProject>
    </LinkedServerProject>
    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
    <UseWpf>true</UseWpf>
    <ImportFrameworkWinFXTargets>true</ImportFrameworkWinFXTargets>
    <OutputPath>bin</OutputPath>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="mscorlib" />
    <Reference Include="System.Runtime.Serialization" />
    <Reference Include="System.Windows" />
    <Reference Include="system" />
    <Reference Include="System.Core" />
    <Reference Include="System.Net" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Windows.Browser" />
    <Reference Include="System.Windows.Controls" />
    <Reference Include="System.Windows.Controls.Navigation" />
  </ItemGroup>
  <ItemGroup>
    <None Include="Properties\AppManifest.xml" />
  </ItemGroup>
  <ItemGroup>
    <Page Include="**\*.xaml" SubType="Designer" Generator="MSBuild:Compile" />
  </ItemGroup>
  <Target Name="BeforeMarkupCompilePass1" BeforeTargets="MarkupCompilePass1">
    <ItemGroup>
      <Page Include="**\*.xaml" Exclude="App.xaml;**\bin\**\*.xaml;**\obj\**\*.xaml" SubType="Designer" Generator="MSBuild:Compile" />
    </ItemGroup>
  </Target>
  <Target Name="BeforeMainResourcesGeneration" BeforeTargets="MainResourcesGeneration">
    <RemoveDuplicates Inputs="@(MainEmbeddedFiles)">
      <Output
          TaskParameter="Filtered"
          ItemName="UniqueMainEmbeddedFiles"/>
    </RemoveDuplicates>
    <ItemGroup>
      <MainEmbeddedFiles Remove="@(MainEmbeddedFiles)" />
      <MainEmbeddedFiles Include="@(UniqueMainEmbeddedFiles)" />
    </ItemGroup>
  </Target>
</Project>

from msbuildsdkextras.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.