Build fails in Release mode but works fine in Debug - Entity Framework 6.0 related issue - entity-framework

I build my application and run it in debug mode. Everything is ok. I can test the functionality and everything is working. Its a multi tier MVC application using Entity Framework 6.0.
Now, when I change the build from Debug to Release and build the projects. I get a few hundreds build errors. All the errors are in the Data Access layer where I use the Entity Framework 6.0. The errors are in the form of:
Error 388 The type or namespace name 'DbSet' could not be found (are you missing a using directive or an assembly reference?)
Or
Error 201 The type or namespace name 'Schema' does not exist in the namespace 'System.ComponentModel.DataAnnotations' (are you missing an assembly reference?)
I have tried cleaning the solution and rebuilding but always same. Not sure why this can happen? Any suggestion will be appreciated.
many thanks

Related

How to restore nuget packages for Autofixture.NSubstitute for .net6 projects type?

Not able to restore packages for AutoFixture.AutoNSubstitute in package. This was working fine earlier but now I am not able to build the solution. Projects are using .NET 6. Unit tests inside solution which are using this project are giving error like
Error CS0234
The type or namespace name 'AutoNSubstitute' does not exist in the namespace 'AutoFixture' (are you missing an assembly reference?)
C:\FILEMAN\test\AStorage.Core.Tests\AutoSubstituteDataAttribute.cs 8 Active
I am not able to add the nuget package when I tried adding the nuget package through the Manage Nuget packages .
Please let me know how I can fix this.

Azure Devops Services Pipeline build fails. Builds successfully through Visual Studio and the msbuild command prompt

I have solution with 2 projects both targeting .Net Framework 4. The solution builds successfully in Visual Studio 2015 and 2017 as well as the msbuild command line.
However, when it builds in Azure DevOps Pipeline with Agent Specification vs2015-win2012r2 the first project fails with the following errors. The NuGet restore step shows it successfully installed the NuGet EntityFramework 5.0 package.
The type or namespace name 'Infrastructure' does not exist in the namespace 'System.Data.Entity' (are you missing an assembly reference?)
The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'DbModelBuilder' could not be found (are you missing a using directive or an assembly reference?)
When I change the Agent Specification to vs2017-win2016 the first project builds without error but the second project fails with the following errors:
The type or namespace name 'Description' does not exist in the namespace 'System.Web.Http' (are you missing an assembly reference?)
The type or namespace name 'Http' does not exist in the namespace 'System.Net' (are you missing an assembly reference?)
Error CS0234: The type or namespace name 'Http' does not exist in the namespace 'System.Net' (are you missing an assembly reference?)
I do have the NuGet package Microsoft.Asp.Net.WebApi.Core.4.0.20710.0 referenced in the csproj file which contains the System.Web.Http.dll.
I have turned the debug option on. Here are links to the NuGet Restore Log https://drive.google.com/open?id=1lJWflXTjYTN_MQyLOnwMUr-8LKoR5JRo
and the Build Log
https://drive.google.com/open?id=1ypAVWxniDLfBOBHc4gODdAoQOCQnphYg
According to your log, there is a warning message.
warning MSB3267: The primary reference "System.Net.Http", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "System.Net.Http" or retarget your application to a framework version which contains "System.Net.Http".
Some differences are in effect when executing a command on a local machine and when a build or release is running on an agent. If the agent is configured to run as a service on Linux, macOS, or Windows, then it is not running within an interactive logged-on session. Without an interactive logged-on session, UI interaction and other limitations exist. And there are some troubleshooting steps which was provided by Microsoft.
There is a simple method that you can try to resolve the error. Delete the reference under the project's references, and then juse add it back in again.The reference was to a namespace in a local project to the solution. For some reason it was being found locally but not found when checked into and built on VSTS.

Unity3d Cloud builds failing with TextMesh errors

I recently setup cloud builds for a new project I created in Unity 2019.1.7. Both iOS and Android builds fail with the same exceptions.
error CS0246: The type or namespace name 'TMPro' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'TextMeshProUGUI' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'TextMeshPro' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'TextMeshProUGUI' could not be found (are you missing a using directive or an assembly reference?)
And more of the same.
I can build Android locally without any issues.
Every script that references TextMesh Pro has a similar issue.
The builds are taking like 12 minutes before they fail so trying different things takes a very long time.

How to add a 3rd Party dll Reference in visual studio code

I am using visual studio code on mac, i just trying a sample application where i am adding some dll to a new asp.net project using visual studio code, but i am getting this error
/projects/lalkitab.guide/Controllers/HomeController.cs(6,7): error CS0246: The type or namespace name 'dal' could not be found (are you missing a using directive or an assembly reference?)
where dal is the dll name
can somebody tell me how to resolve it

ServiceStack4+LLBLGen4.2: Templates will not compile 'ServiceHost' is undefined

We are a licensed user of ServiceStack and I am using the latest version. I've created an LLBLGen project and added the latest ServiceStack LLBLGen templates. I am able to generate the LLBLGen projects, but the XXXXProject.Services class library fails to compile:
Error 1 The type or namespace name 'ServiceHost' does not exist in the namespace 'ServiceStack' (are you missing an assembly reference?) C:\PROJECTS\ServiceStack\XXXXService\XXXXService.ServiceModel\DAL\ServiceGeneric\Validators\VendorValidator.cs
Are the templates compatible with ServiceStack v4? If not, do you know when they will be compatible or what I need to change to make them work with the latest version of ServiceStack?
Thanks,
Mike