Is there a way to get VS 2022's interface for NET6 for a NET4.8 project? - visual-studio

I recently had to move a tiny NET6 project manually to 4.8 and never realized that in that proces, I seem to have kept some features VS only offers to 6.0 projects. Such as PUBLISHing straight executables to a directory and an overall nicer interface.
Just created a 4.8 project from scratch and all of that is gone.
Here's what my projectfile for my hybridized project looks like:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net48</TargetFramework>
<LangVersion>10.0</LangVersion>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<BaseOutputPath>F:\Druckhistorie\Printy</BaseOutputPath>
<ApplicationIcon>historyred.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<None Remove="historyred2.ico" />
<None Remove="Resources\Icon1.ico" />
</ItemGroup>
<ItemGroup>
<Content Include="historyred.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FastReport.Compat" Version="2023.1.0" />
<PackageReference Include="FastReport.Net.Pro" Version="2023.1.9" />
<PackageReference Include="MySql.Data" Version="8.0.32" />
</ItemGroup>
<ItemGroup>
<Reference Include="FastReport">
<HintPath>..\..\libs\FastReport.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Using Include="System.Windows.Forms" />
</ItemGroup>
</Project>
There's at least one issue with it, as soon as I set an Icon to the form, I cannot compile anymore, but that aside, everything else works fine.
For future 4.8 projects I would love to have the 6.0 interface and features, is there a setting and small manual adjustment I can do to get there?
I had a look at the default 4.8 projectfile and it's just a mess.😮
Thanks!

Related

Issues creating a nuget package referening Xamarin Forms

I'm creating a nuget package that is refercing a number of different packages for the platforms.
I don't sem to be able to reference Xam.Forms.Platform. from the various ItemGroups as well as packages I've added via nuget for specific platforms.
I'm using this as a reference : https://learn.microsoft.com/en-us/nuget/guides/create-packages-for-xamarin and my csproj is this
<Project Sdk="MSBuild.Sdk.Extras/2.0.54">
<PropertyGroup>
<!--Work around so the conditions work below-->
<TargetFrameworks></TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' ==
'Windows_NT'">netstandard2.0;Xamarin.iOS10;MonoAndroid90;uap10.0.16299</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' !=
'Windows_NT'">netstandard2.0;Xamarin.iOS10;MonoAndroid90</TargetFrameworks>
<AssemblyName>Plugin.Mobile.Xamarin</AssemblyName>
<RootNamespace>Plugin.Mobile.Xamarin</RootNamespace>
<PackageId>Plugin.Mobile.Xamarin</PackageId>
<Product>Plugin.Mobile.Xamarin</Product>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<AssemblyFileVersion>1.0.0.0</AssemblyFileVersion>
<Version>1.0.0.0</Version>
<PackageVersion>1.0.0.0</PackageVersion>
<PackOnBuild>true</PackOnBuild>
<NeutralLanguage>en</NeutralLanguage>
<LangVersion>default</LangVersion>
<DefineConstants>$(DefineConstants);</DefineConstants>
<UseFullSemVerForNuGet>false</UseFullSemVerForNuGet>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<LangVersion>latest</LangVersion>
<DebugType>portable</DebugType>
<PropertyGroup Condition=" '$(Configuration)'=='Debug' ">
<DebugSymbols>true</DebugSymbols>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)'=='Release' ">
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
<Compile Include="**\*.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.10" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1179" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.7.0.1179" />
<PackageReference Include="SkiaSharp.Views.Forms" Version="2.80.1" />
</ItemGroup>
<ItemGroup>
<None Update="Langs.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Langs.resx</DependentUpon>
</None>
</ItemGroup>
<ItemGroup>
<None Update="shared\Langs.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Langs.resx</DependentUpon>
</None>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="SkiaSharp.Views.Forms">
<Version>2.80.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'uap10.0.16299'">
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.9" />
<Reference Include="Microsoft.CSharp" />
<PackageReference Include="SkiaSharp.Views.Forms">
<Version>2.80.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1179" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.7.0.1179" />
<SDKReference Include="WindowsMobile, Version=10.0.16299.0">
<Name>Windows Mobile Extensions for the UWP</Name>
</SDKReference>
<Compile Include="**\UWP*.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'Xamarin.iOS10'">
<Reference Include="Xamarin.iOS">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\Xamarin.iOS\v1.0\Xamarin.iOS.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<PackageReference Include="EasyTipView">
<Version>1.0.1</Version>
</PackageReference>
<PackageReference Include="SkiaSharp.Views.Forms">
<Version>2.80.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1179" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.7.0.1179" />
<Compile Include="**\iOS*.cs" />
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('MonoAndroid')) ">
<Reference Include="Mono.Android">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v9.0\Mono.Android.dll</HintPath>
</Reference>
<PackageReference Include="SkiaSharp.Views.Forms">
<Version>2.80.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Tooltips">
<Version>1.0.7</Version>
</PackageReference>
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<Reference Include="System.Numerics" />
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1179" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.7.0.1179" />
<Compile Include="**\Droid*.cs" />
</ItemGroup>
</Project>
Any ideas on why I can't include or reference these packages?
The errors I'm seeing are the likes of
Any ideas on why I can't include or reference these packages?
The issue is caused by the project template Cross-Platform .NET Standard Library Plugin.
To be precise, this is due to the design of this special project template.
As the document said, you should use the corresponding platform namespace in xxx.<PLATFORM>.cs file of each platform project.
Suggestion
From your description, the namespaces you are using are all related to Android, so you should add these in the file <project_name>.andoroid.cswhich targets to MonoAndroid90.
And if you input them in the file called apple.cs,uwp.cs or others, the template is unable to identify them.
And you can see <project_name>.andoroid.cs file is connected with MonoAndroid90, so it can identify android namespaces and the same is true for other platform files.
In addition, if you still want your requirements, you should connect with the extension's author to reflect the issue.
try to change your TargetFrameworks become like this
<TargetFrameworks>netstandard2.0;Xamarin.iOS10;MonoAndroid90</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">uap10.0.16299;$(TargetFrameworks)</TargetFrameworks>

How to Add Reference to a netstandard 2.0 Nuget from VS2013 .Net Framework 4.8 Project

I have a vs 2013 project which targets .net framework 4.8. I need to add a reference to Microsoft.Extensions.Hosting nuget package but when I do I get the following error on package manager console.
Error message:
PM> Install-Package Microsoft.Extensions.Hosting -Version 2.2.0
Installing 'Microsoft.Extensions.Hosting 2.2.0'.
You are downloading Microsoft.Extensions.Hosting from Microsoft, the license agreement to which is available at https://raw.githubusercontent.com/aspnet/AspNetCore/2.0.0/LICENSE.txt. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Microsoft.Extensions.Hosting 2.2.0'.
Adding 'Microsoft.Extensions.Hosting 2.2.0' to QuartzExample.
Uninstalling 'Microsoft.Extensions.Hosting 2.2.0'.
Successfully uninstalled 'Microsoft.Extensions.Hosting 2.2.0'.
Install failed. Rolling back...
Install-Package : Could not install package 'Microsoft.Extensions.Hosting 2.2.0'. You are trying to install this package into
a project that targets '.NETFramework,Version=v4.8', but the package does not contain any assembly references or content
files that are compatible with that framework. For more information, contact the package author.
At line:1 char:1
+ Install-Package Microsoft.Extensions.Hosting -Version 2.2.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
My Project File looks like this
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{07E02FE5-9E9B-434D-B6A2-D037DE7CE6CA}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>QuartzExample</RootNamespace>
<AssemblyName>QuartzExample</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Quartz, Version=3.0.7.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
<HintPath>..\packages\Quartz.3.0.7\lib\net452\Quartz.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Quartz.Jobs, Version=3.0.7.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
<HintPath>..\packages\Quartz.Jobs.3.0.7\lib\net452\Quartz.Jobs.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Quartz.Plugins, Version=3.0.7.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
<HintPath>..\packages\Quartz.Plugins.3.0.7\lib\net452\Quartz.Plugins.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Remoting" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MyJob.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="quartz_jobs.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
My App.Config is as follows
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="quartz" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<quartz>
<add key="quartz.plugin.xml.type" value="Quartz.Plugin.Xml.XMLSchedulingDataProcessorPlugin, Quartz.Plugins" />
<add key="quartz.plugin.xml.fileNames" value="~/quartz_jobs.xml" />
</quartz>
</configuration>
Without updating Visual Studio 2013, can I add references to a .netstandard2 nuget such as Microsoft.Extensions.Hosting?
You can't. VS2013 has an ancient version of NuGet which doesn't know anything about .NET Standard and therefore can't know that .NET Standard 2.0 is compatible with the .NET Framework 4.8.
If you really can't upgrade to a newer Visual Studio, maybe you can look into .NET Core. Visual Studio Code is a tiny installation and provides good .NET development experience, otherwise any text editor will do, you just lose intellisense if you can't use something that supports Omnisharp.

MSB4067: The element <#text> beneath element <Target> is unrecognized

From the visual studio, I am able to compile code successfully but when I am trying to compile code using MSBuild, it throws me error like below
MSB4067: The element <#text> beneath element Target is unrecognized.
Please note: I am building code using MSBuild in release mode, the code which I have added for AfterTarget is only for Debug mode.
If I remove code i.e. than it is working fine.
Here is my csproj file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B9B35177-B239-41A9-946F-3BB1CC14BD3B}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ABC.MyProject.Engine</RootNamespace>
<AssemblyName>ABC.MyProject.Engine</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="ABCDataAccess, Version=2017.2.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\internal\ABCDataAccess.dll</HintPath>
</Reference>
<Reference Include="ABCNotifier, Version=2016.2.2.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\internal\ABCNotifier.dll</HintPath>
</Reference>
<Reference Include="ABCScheduler, Version=2016.2.2.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\internal\ABCScheduler.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>..\lib\thirdparty\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="core.cs" />
<Compile Include="Model\FileInstance.cs" />
<Compile Include="Model\FileLifeCycle.cs" />
<Compile Include="Model\StateExecutor.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="Enterprise\Implementation\FileKarmaHandler.cs" />
<Compile Include="Enterprise\Implementation\FileKarma.cs" />
<Compile Include="Enterprise\Implementation\FileLifeCycleData.cs" />
<Compile Include="Enterprise\Interface\IFileLifeCycleData.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Core\ABC.MyProject.Core.csproj">
<Project>{E1B4DF28-23C5-4865-B7B7-51707D2116E3}</Project>
<Name>ABCCore</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Config\Archiver.xml" />
<Content Include="Config\ABClog.xml" />
<Content Include="Config\DataAccess.xml" />
<Content Include="Config\Notifier.xml" />
<Content Include="Config\Security.xml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
rmdir config
mkdir config
rmdir sqls
mkdir sqls
rmdir templates
mkdir templates
exit 0
</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>
copy $(ProjectDir)Config\*.xml config\
copy $(ProjectDir)..\lib\thirdparty\*.* $(ProjectDir)\bin\$(Configuration)\
copy $(ProjectDir)..\Core\Config\*.xml config\
copy $(ProjectDir)..\Core\sqls\*.* sqls\
</PostBuildEvent>
</PropertyGroup>
<UsingTask TaskName="XmlPreprocess" AssemblyFile="..\lib\msbuild\lib\XmlPreprocess.MSBuildTasks.dll" />
<Target Name="AfterBuild" Condition="'$(Configuration)' == 'Debug' ">
 
<PropertyGroup>
<ConfigValuesSpreadsheetFileLocation>
..\lib\msbuild\config\Settings.xls
</ConfigValuesSpreadsheetFileLocation>
</PropertyGroup>
<XmlPreprocess
ToolPath="..\lib\msbuild\lib\"
InputFiles="..\Core\Config\AlertParams.xml"
OutputFiles="bin\Debug\config\AlertParams.xml"
SpreadsheetFiles="$(ConfigValuesSpreadsheetFileLocation)"
Environment="$(Configuration)"
Clean="true"
Validate="true" />
 
<XmlPreprocess
ToolPath="..\lib\msbuild\lib\"
InputFiles="..\Core\Config\CoreParams.xml"
OutputFiles="bin\Debug\config\CoreParams.xml"
SpreadsheetFiles="$(ConfigValuesSpreadsheetFileLocation)"
Environment="$(Configuration)"
Clean="true"
Validate="true" />
 
<XmlPreprocess
ToolPath="..\lib\msbuild\lib\"
InputFiles="..\Core\Config\StateParams.xml"
OutputFiles="bin\Debug\config\StateParams.xml"
SpreadsheetFiles="$(ConfigValuesSpreadsheetFileLocation)"
Environment="$(Configuration)"
Clean="true"
Validate="true" />
 
<XmlPreprocess
ToolPath="..\lib\msbuild\lib\"
InputFiles="Config\Archiver.xml"
OutputFiles="bin\Debug\config\Archiver.xml"
SpreadsheetFiles="$(ConfigValuesSpreadsheetFileLocation)"
Environment="$(Configuration)"
Clean="true"
Validate="true" />
 
<XmlPreprocess
ToolPath="..\lib\msbuild\lib\"
InputFiles="Config\DataAccess.xml"
OutputFiles="bin\Debug\config\DataAccess.xml"
SpreadsheetFiles="$(ConfigValuesSpreadsheetFileLocation)"
Environment="$(Configuration)"
Clean="true"
Validate="true" />
 
<XmlPreprocess
ToolPath="..\lib\msbuild\lib\"
InputFiles="app.config"
OutputFiles="bin\Debug\app.config"
SpreadsheetFiles="$(ConfigValuesSpreadsheetFileLocation)"
Environment="$(Configuration)"
Clean="true"
Validate="true" />
</Target>
</Project>
I've seen this error happen when the XML is somehow malformed, such as having a duplicated > character.
To troubleshoot it you can remove XML nodes from your csproj until the error goes away (it should be right at the build start) and repeat until you narrow down to the specific line with the XML issue.
Look out for merge/conflict markers from your source control. I just ran into a GIT marker that was causing this error.
MSB4067: The element <#text> beneath element is unrecognized
First, you should use the MSBuild from the Visual Studio not from the .Net Framework.
That because starting with Visual Studio 2013, the 2013 version of MSBuild will ship as a part of Visual Studio instead of the .NET Framework. Check this blog for details. So you should use the MSBuild from:
C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe
Second, you should provide configuration parameter /P:configuration=Release when you build the project via MSBuild in release mode, the command looks like:
msbuild "YourProjectPath.csproj" /P:configuration=Release
Hope this helps.

Cannot run .net ef even though tooling installed

I am trying to get ef core working within xamrian and I am having a few issues with the dotnet command not running. I have added the tools as per another so but that did not work.
This is my first migration and my conneciton stirng is set in the application.json of
"ConnectionStrings": {
"DefaultConnection": "Data Source=DEVELOPER\SAGESQL2014;Initial
Catalog=CallManagment;Integrated
Security=True;MultipleActiveResultSets=True" } }
This is the error I am getting thanks for the help.
dotnet ef migrations add InitialMigration dotnet : No executable found
matching command "dotnet-ef" At line:1 char:1
+ dotnet ef migrations add InitialMigration
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (No executable f...and "dotnet-ef":String) [], RemoteExcept ion
+ FullyQualifiedErrorId : NativeCommandErro
This is my project file at present
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<None Remove="appsettings.json" />
</ItemGroup>
<ItemGroup>
<Content Include="appsettings.json">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.2" />
</ItemGroup>
<ItemGroup>
<Reference Include="System">
<HintPath>System</HintPath>
</Reference>
</ItemGroup>
</Project>
EDIT 2 TO show assembles added.
Edit 3
To Show changes made from below suggestion still not working.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<None Remove="appsettings.json" />
</ItemGroup>
<ItemGroup>
<Content Include="appsettings.json">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.2" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.2" />
</ItemGroup>
<ItemGroup>
<Reference Include="System">
<HintPath>System</HintPath>
</Reference>
</ItemGroup>
</Project>
Are you trying to run inside Package Manager Console? If so you'll need to cd to the project directory. Also, if you're inside PMC, why aren't you using the EF Core PMC tools?

Adding Folders inside android Assets in a Xamarin Android Project throws Build Error

Unable to add directories and subdirectories inside Assets in a Xamarin Android Project.
IDE: Visual Studio Community For Mac Version:7.3.2 (build 12)
OS: MacOS High Sierra version: 10.13.2
Error:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2,2): Error MSB3025: The source file "Assets/Dir/" is actually a directory. The "Copy" task does not support copying directories. (MSB3025) (assetsCheck)
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2,2): Error MSB3025: The source file "Assets/Dir/SubDir/" is actually a directory. The "Copy" task does not support copying directories. (MSB3025) (assetsCheck)
Note Was able to build successfully using Visual Studio Community in a Windows 10 system.
.csproj file
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Xamarin.Build.Download.0.4.3\build\Xamarin.Build.Download.props" Condition="Exists('..\packages\Xamarin.Build.Download.0.4.3\build\Xamarin.Build.Download.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A6BF443D-8B89-4044-B951-E346FA8E68D3}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>ScormReader.Droid</RootNamespace>
<AssemblyName>ScormReader.Droid</AssemblyName>
<TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
<AndroidApplication>True</AndroidApplication>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
<AndroidSupportedAbis>arm64-v8a;armeabi;armeabi-v7a;x86</AndroidSupportedAbis>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidManagedSymbols>true</AndroidManagedSymbols>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Mono.Android" />
<Reference Include="Xamarin.Android.Support.Annotations">
<HintPath>..\packages\Xamarin.Android.Support.Annotations.25.3.1\lib\MonoAndroid70\Xamarin.Android.Support.Annotations.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.Compat">
<HintPath>..\packages\Xamarin.Android.Support.Compat.25.3.1\lib\MonoAndroid70\Xamarin.Android.Support.Compat.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.Core.UI">
<HintPath>..\packages\Xamarin.Android.Support.Core.UI.25.3.1\lib\MonoAndroid70\Xamarin.Android.Support.Core.UI.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.Core.Utils">
<HintPath>..\packages\Xamarin.Android.Support.Core.Utils.25.3.1\lib\MonoAndroid70\Xamarin.Android.Support.Core.Utils.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.Media.Compat">
<HintPath>..\packages\Xamarin.Android.Support.Media.Compat.25.3.1\lib\MonoAndroid70\Xamarin.Android.Support.Media.Compat.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.Fragment">
<HintPath>..\packages\Xamarin.Android.Support.Fragment.25.3.1\lib\MonoAndroid70\Xamarin.Android.Support.Fragment.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.Vector.Drawable">
<HintPath>..\packages\Xamarin.Android.Support.Vector.Drawable.25.3.1\lib\MonoAndroid70\Xamarin.Android.Support.Vector.Drawable.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.Animated.Vector.Drawable">
<HintPath>..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.25.3.1\lib\MonoAndroid70\Xamarin.Android.Support.Animated.Vector.Drawable.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.v7.AppCompat">
<HintPath>..\packages\Xamarin.Android.Support.v7.AppCompat.25.3.1\lib\MonoAndroid70\Xamarin.Android.Support.v7.AppCompat.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
<Compile Include="Resources\Resource.designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\AboutResources.txt" />
<None Include="Properties\AndroidManifest.xml" />
<None Include="Assets\AboutAssets.txt" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\layout\Main.axml" />
<AndroidResource Include="Resources\values\Strings.xml" />
<AndroidResource Include="Resources\mipmap-hdpi\Icon.png" />
<AndroidResource Include="Resources\mipmap-mdpi\Icon.png" />
<AndroidResource Include="Resources\mipmap-xhdpi\Icon.png" />
<AndroidResource Include="Resources\mipmap-xxhdpi\Icon.png" />
<AndroidResource Include="Resources\mipmap-xxxhdpi\Icon.png" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\drawable\" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<AndroidAsset Include="Assets\Parent\" />
<AndroidAsset Include="Assets\Parent\Child\" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<Import Project="..\packages\Xamarin.Build.Download.0.4.3\build\Xamarin.Build.Download.targets" Condition="Exists('..\packages\Xamarin.Build.Download.0.4.3\build\Xamarin.Build.Download.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Annotations.25.3.1\build\MonoAndroid70\Xamarin.Android.Support.Annotations.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Annotations.25.3.1\build\MonoAndroid70\Xamarin.Android.Support.Annotations.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Compat.25.3.1\build\MonoAndroid70\Xamarin.Android.Support.Compat.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Compat.25.3.1\build\MonoAndroid70\Xamarin.Android.Support.Compat.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Core.UI.25.3.1\build\MonoAndroid70\Xamarin.Android.Support.Core.UI.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Core.UI.25.3.1\build\MonoAndroid70\Xamarin.Android.Support.Core.UI.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Core.Utils.25.3.1\build\MonoAndroid70\Xamarin.Android.Support.Core.Utils.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Core.Utils.25.3.1\build\MonoAndroid70\Xamarin.Android.Support.Core.Utils.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Media.Compat.25.3.1\build\MonoAndroid70\Xamarin.Android.Support.Media.Compat.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Media.Compat.25.3.1\build\MonoAndroid70\Xamarin.Android.Support.Media.Compat.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Fragment.25.3.1\build\MonoAndroid70\Xamarin.Android.Support.Fragment.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Fragment.25.3.1\build\MonoAndroid70\Xamarin.Android.Support.Fragment.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Vector.Drawable.25.3.1\build\MonoAndroid70\Xamarin.Android.Support.Vector.Drawable.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Vector.Drawable.25.3.1\build\MonoAndroid70\Xamarin.Android.Support.Vector.Drawable.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.25.3.1\build\MonoAndroid70\Xamarin.Android.Support.Animated.Vector.Drawable.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.25.3.1\build\MonoAndroid70\Xamarin.Android.Support.Animated.Vector.Drawable.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.v7.AppCompat.25.3.1\build\MonoAndroid70\Xamarin.Android.Support.v7.AppCompat.targets" Condition="Exists('..\packages\Xamarin.Android.Support.v7.AppCompat.25.3.1\build\MonoAndroid70\Xamarin.Android.Support.v7.AppCompat.targets')" />
</Project>
The "Copy" task does not support copying directories.
I reproduced your problem on my MacOS, and found the fix.
When you added the sub-directory, the csproj file had an item added that causes this error. Edit the csproj file and remove the line that references the sub-directory will solve this probelm.
Solution :
My .csproj file :
<ItemGroup>
<AndroidAsset Include="Assets\New Folder\hi.txt">
<Generator>RazorTemplatePreprocessor</Generator>
<LastGenOutput>hi.cs</LastGenOutput>
</AndroidAsset>
<AndroidAsset Include="Assets\New Folder1\" />
</ItemGroup>
Remove the first AndroidAsset that refers to the sub-directory :

Resources