.NET Core Publish Compilation Errors - c#

I have a .NET Core 2.2 project that builds in both Debug and Release configuration just fine. However, the build fails when I try and publish the project.
Startup.cs(26,16): Error CS0246: The type or namespace name 'IConfiguration' could not be found (are you missing a using directive or an assembly reference?)
Startup.cs(35,39): Error CS0246: The type or namespace name 'IServiceCollection' could not be found (are you missing a using directive or an assembly reference?)
Startup.cs(29,24): Error CS0246: The type or namespace name 'IConfiguration' could not be found (are you missing a using directive or an assembly reference?)
Controllers\ConsentController.cs(37,13): Error CS0246: The type or namespace name 'ILogger<>' could not be found (are you missing a using directive or an assembly reference?)
Controllers\ConsentController.cs(30,26): Error CS0246: The type or namespace name 'ILogger<>' could not be found (are you missing a using directive or an assembly reference?)
I've tried cleaning the solution. Anyone else seen similar behaviour?

Try this from terminal:
dotnet publish

Related

Autocount project won't build

I'm working on an autocount project that should deploy in autocount 1.8 but when I try to build it I get the following errors:
The type or namespace name 'LicenseStatusArgs' could not be found (are you missing a using directive or an assembly reference?) in plugininit.cs
The type or namespace name 'AccountantColumnChangedEventArgs' does not exist in the namespace 'BCE.AutoCount.Option' (are you missing an assembly reference?) in options.cs
The type name 'FormShownEventArgs' does not exist in the type 'BCE.AutoCount.MainEntry.FormMain' in option.cs and mainformscript.cs
Is this because of a licensing issue? I apologize if this isn't the right place to put this kind of question.

Unity3D - error after migrate from Unity 2017.4.X to Unity 2019.2.2

I just migrate my old project from Unity 2017.4.30f to 2019.2.2
However, I got below errors :
Assets\Plugins\Easy Save 3\Scripts\Types\Unity Types\Component Types\ES3Type_EventSystem.cs(3,19): error CS0234: The type or namespace name 'EventSystems' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)
Assets\Plugins\UDP\UdpSupport\SampleScene\Scripts\GameManager.cs(2,19): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)
Assets\Plugins\UnityPurchasing\script\IAPButton.cs(9,30): error CS0246: The type or namespace name 'Button' could not be found (are you missing a using directive or an assembly reference?)
Assets\Plugins\UnityPurchasing\script\IAPButton.cs(46,16): error CS0246: The type or namespace name 'Text' could not be found (are you missing a using directive or an assembly reference?)
Assets\Plugins\UDP\UdpSupport\SampleScene\Scripts\GameManager.cs(15,13): error CS0246: The type or namespace name 'Dropdown' could not be found (are you missing a using directive or an assembly reference?)
I have tried to remove those component from package manager and reinstall it but still not solve the issue.
Any Idea ?
Thank You

Error CS0234 - Namespace 'Xna' does not exist in namespace 'Microsoft'

After encountering a few problems regarding the CS0234 error stated in the title, I looked up a solution, found here, and followed all of the steps to install the XNA Game Studio.
I got confirmation from the Developer command prompt that the requested files and libraries were added to the global cache, but I still got the following errors after compiling my program again:
GraphicsHandler.cs(11,17): error CS0234: The type or namespace name 'Xna' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
Camera.cs(6,17): error CS0234: The type or namespace name 'Xna' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
Application.cs(9,17): error CS0234: The type or namespace name 'Xna' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
GraphicsHandler.cs(14,33): error CS0246: The type or namespace name 'DrawableGameContent' could not be found (are you missing a using directive or an assembly reference?)
How do I fix these CS0234 errors?

Xamarin Live Player Errors

I have created the default Xamarin project, works fine connected to a Mac -> build -> view in simulator on Mac, but when I try and run the Live Payer from Visual Studio I get the following errors:
\Services\MockDataStore.cs(1,1): error: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)
\App.xaml.cs(1,1): error: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)
\Services\MockDataStore.cs(1,1): error: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)
\ViewModels\AboutViewModel.cs(1,1): error: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)
\ViewModels\BaseViewModel.cs(1,1): error: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)
\ViewModels\ItemsViewModel.cs(1,1): error: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)
\Views\MainPage.xaml.cs(1,1): error: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)
\Views\MainPage.xaml.cs(1,1): error: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)
\Views\AboutPage.xaml.cs(1,1): error: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)
\Views\AboutPage.xaml.cs(1,1): error: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)
\Views\ItemDetailPage.xaml.cs(1,1): error: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)
\Views\ItemDetailPage.xaml.cs(1,1): error: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)
\Views\ItemsPage.xaml.cs(1,1): error: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)
\Views\ItemsPage.xaml.cs(1,1): error: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)
\Views\NewItemPage.xaml.cs(1,1): error: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)
And on and on it goes, these files are all in the Shared project.
Anyone have issue similar?
Thanks
Matt
If it's any consolation, I have exactly the same problem. Here's what I've done to try and resolve the issue, currently with partial success:
Deinstall/reinstall Visual Studio 2017 Community Preview
Deinstall/install Visual Studio Community - the current release
Created a new Windows 10 VM and installed Visual Studio Community 2017 current release
Based on action point #3, I don't believe the cause if anything specific to my installation however I'm then surprised that the issue is not more widespread.
UPDATE (18th Dec): I downloaded an existing example project (https://developer.xamarin.com/samples/mobile/LivePlayer/LiveView/) and had some success. The app now runs on my phone via Live Player however I now get a MONO debugger error, which I'm currently investigating.
as of now :
Custom Renderers are not supported.
Effects are not supported.
Custom Controls with Custom Bindable Properties are not supported.
Embedded resources are not supported (ie. embedding images or other resources in a PCL).
Third party MVVM frameworks are not supported (ie. Prism, Mvvm Cross, Mvvm Light, etc.)
https://learn.microsoft.com/en-us/xamarin/tools/live-player/limitations

Code getting build locally but Getting build erroron TF in build definition

I wrote a project that uses entity framework and is working fine locally. But when i try to run an automated build using VSTS I get am error while running build definition. I know it is getting caused by Entity framework reference but I am not able to get the root cause. Here is the build error for reference.
2016-12-08T07:42:52.1197143Z ##[error]MyMovieDatabase\Movies.Repository\MovieContext.cs(4,19): Error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
2016-12-08T07:42:52.1197143Z MovieContext.cs(4,19): error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) [C:\a\1\s\MyMovieDatabase\Movies.Repository\Movies.Repository.csproj]
2016-12-08T07:42:52.1197143Z ##[error]MyMovieDatabase\Movies.Repository\MovieContext.cs(5,19): Error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
2016-12-08T07:42:52.1197143Z MovieContext.cs(5,19): error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) [C:\a\1\s\MyMovieDatabase\Movies.Repository\Movies.Repository.csproj]
2016-12-08T07:42:52.1197143Z ##[error]MyMovieDatabase\Movies.Repository\MovieContext.cs(7,29): Error CS0246: The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?)
2016-12-08T07:42:52.1197143Z MovieContext.cs(7,29): error CS0246: The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?) [C:\a\1\s\MyMovieDatabase\Movies.Repository\Movies.Repository.csproj]
2016-12-08T07:42:52.1197143Z ##[error]MyMovieDatabase\Movies.Repository\MovieContext.cs(17,33): Error CS0246: The type or namespace name 'CreateDatabaseIfNotExists' could not be found (are you missing a using directive or an assembly reference?)
2016-12-08T07:42:52.1197143Z MovieContext.cs(17,33): error CS0246: The type or namespace name 'CreateDatabaseIfNotExists' could not be found (are you missing a using directive or an assembly reference?) [C:\a\1\s\MyMovieDatabase\Movies.Repository\Movies.Repository.csproj]
2016-12-08T07:42:52.1197143Z ##[error]MyMovieDatabase\Movies.Repository\MovieContext.cs(40,35): Error CS0246: The type or namespace name 'DbConfiguration' could not be found (are you missing a using directive or an assembly reference?)
2016-12-08T07:42:52.1197143Z MovieContext.cs(40,35): error CS0246: The type or namespace name 'DbConfiguration' could not be found (are you missing a using directive or an assembly reference?) [C:\a\1\s\MyMovieDatabase\Movies.Repository\Movies.Repository.csproj]
2016-12-08T07:42:52.1197143Z ##[error]MyMovieDatabase\Movies.Repository\MovieRepository.cs(3,19): Error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
2016-12-08T07:42:52.1197143Z MovieRepository.cs(3,19): error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) [C:\a\1\s\MyMovieDatabase\Movies.Repository\Movies.Repository.csproj]
2016-12-08T07:42:52.1197143Z ##[error]MyMovieDatabase\Movies.Repository\MovieContext.cs(14,12): Error CS0246: The type or namespace name 'DbSet' could not be found (are you missing a using directive or an assembly reference?)
The problem is in your Reference in .csproject which uses local reference(it takes from packages folder in your hard disk). Obviously This won't work when deployed in the server. Change that to the nugetpackages path. Change the Hint Path for all the references in the format I have given below
$(NugetPackagesPath)\EntityFramework.6.1.1\lib\net45\Entity‌​Framework.dll
You can use the below piece of code which defines the NugetPackagesPath
<PropertyGroup>
<!-- EnlistmentRoot is the base directory where all of the module root directories reside. -->
<EnlistmentRoot>$(MSBuildThisFileDirectory)</EnlistmentRoot>
<EnlistmentRoot Condition="'$(EnlistmentRoot)' != ''">$([System.IO.Path]::GetFullPath('$(EnlistmentRoot)'))</EnlistmentRoot>
<EnlistmentRoot Condition="'$(EnlistmentRoot)' != '' and !HasTrailingSlash('$(EnlistmentRoot)')">$(EnlistmentRoot)\</EnlistmentRoot>
</PropertyGroup>
<PropertyGroup>
<!-- NuGetPackagesPath is the base directory for all nuget packages. -->
<NuGetPackagesPath>$(EnlistmentRoot)Ref\Packages</NuGetPackagesPath>
<NuGetPackagesPath Condition="'$(NuGetPackagesPath)' != ''">$([System.IO.Path]::GetFullPath('$(NuGetPackagesPath)'))</NuGetPackagesPath>
<NuGetPackagesPath Condition="'$(NuGetPackagesPath)' != '' and !HasTrailingSlash('$(NuGetPackagesPath)')">$(NuGetPackagesPath)\</NuGetPackagesPath>
</PropertyGroup>

Categories