Unity Linq to Sql DataClasses - sql

I'm trying to add Linq-to-SQL data classes to Unity project but I get an error:
Assets\Scripts\DataClasses1.designer.cs(46,65): error CS0234: The type or namespace name 'Linq' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
I need to use Linq-to-SQL in my Unity project.
When I add System.Data.Linq.dll and System.Data.dll to my Plugins folder, I get these errors:
Loading assembly failed: "Assets/Plugins/System.Data.dll"
Loading assembly failed: "Assets/Plugins/System.Data.Linq.dll"
Does anybody know how I can use Linq-to-SQL in my Unity project?
I already set Unity-> Player->Api Compatibility Level->.net 4.x but it does not solve the problem.

Related

The type or namespace name 'WebApi' does not exist in the namespace 'Microsoft.AspNet' (are you missing an assembly reference?)

I've got MVC.Net application in my TFS2015. My Applications builds & runs fine in Local. I'm configuring CI/Cd pipeline for this application. Please find the error specified below
Error CS0234: The type or namespace name 'WebApi' does not exist in the namespace 'Microsoft.AspNet' (are you missing an assembly reference?)
Error CS0234: The type or namespace name 'Extensions' does not exist in the namespace 'System.Net.Http' (are you missing an assembly reference?)
I've tried both MSBUILD & Visual Studio Build tasks in my pipeline, still same error occurs
The type or namespace name 'WebApi' does not exist in the namespace 'Microsoft.AspNet' (are you missing an assembly reference?)
According to the error message, it seems you are missing the references when you build with Azure DevOps. You should add nuget installer tasks to restore the package:
NuGet Tool Installer task
When we build the project/solution on local machine, the packages is downloaded stored in the \packages folder, this folder is ignored by the source control (This is recommended.) when we submit our source code, so when we build the project/solution on the Azure DevOps, we need add nuget restore task to restore nuget package before we build it.
If you have already use nuget restore in your pipeline and still get that error, please share the warning info in your build log.
Hope this helps.
I've copied the missing dll's from
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.2\Facades
To
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.2
Thanks #Leo Liu -MSFT for suggesting this article. It worked for me

Generate a class from xsd file in net core

I need to generate a class from an xsd in net core.
In dotnet standard I used commandline xsd filename.xsd /c.
But how to I create this class in net core.
Anyone knows how to do this?
When I add a class generated with xsd.exe I get several errors.
Example
Error CS0234 The type or namespace name 'SerializableAttributeAttribute' does not exist in the namespace 'System' (are you missing an assembly reference?)
Error CS0234 The type or namespace name 'DesignerCategoryAttribute' does not exist in the namespace 'System.ComponentModel' (are you missing an assembly reference?)
Error CS0234 The type or namespace name 'XmlTypeAttributeAttribute' does not exist in the namespace 'System.Xml.Serialization' (are you missing an assembly reference?)
Error CS0246 The type or namespace name 'AnonymousType' could not be found (are you missing a using directive or an assembly reference?)
Attributes from a class in autogen file
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
I have now solved this issue with adding nugets to my project.
System.Xml.XmlSerializer
Solution: Removes the serializations attribute issues except the DesignerCategoryAttribute
Newtonsoft.json
Solution: Removes the DesignerCategoryAttribute
Now it is possible to compile the xsd.exe generated class and use it in net core
netstandard2.0 can compile xsd.exe generated files with no problems
There is no way actualy but if you see this it's a part of the future .net core release (.Net Core 1.2 release on Q2 2017).
If you want more Info, see this discuss and specially this point.

Xamarin Fails to Resolve Path to Dependent Project Correctly

When trying to build a solution developed in VS2010, I get the following error in one of the subprojects that depends on a DLL built by another project in the solution, though it seems to have all the project references correctly interpreted by Xamarin Studio (v5.7.0).
/path/to/failing/project/myproject.csproj (Build) ->
/Library/Frameworks/Mono.framework/Versions/3.12.0/lib/mono/4.5/Microsoft.Common.targets (ResolveAssemblyReferences target) ->
/Library/Frameworks/Mono.framework/Versions/3.12.0/lib/mono/4.5/Microsoft.Common.targets: warning : Reference '/path/to/successful/parent/project/library/bin/ReleaseMac//mylibrary.dll' not resolved
After this error, there are subsequent compilation errors like:
The type or namespace name 'MyLibrary' could not be found. Are you missing an assembly reference?
These are presumably related to the fact that the DLL that did not resolve correctly contains that namespace.
Might this also be related to Xamarin not resolving references correctly?

System.Web.Http.Description is missing from Add Reference List

I am getting an error:
Error 1 The type or namespace name 'Description' does not exist in the namespace 'System.Web.Http' (are you missing an assembly reference?) c:\users\klippiat\documents\visual studio 2010\Projects\TfsPortal\TfsPortal\Models\ApiModel.cs 5 23 TfsPortal
I would normally Add Reference and select the missing reference. But System.Web.Http.Description is missing from the list. I have sorted the list by name to make sure that I should be able to see it. I can see System.Web.Http.Data and .Common etc. but not the .Description one.
What am I doing wrong?
Visual Studio 2012 SPA Template /Help/index.cshtml file was throwing your error.
#using System.Web.Http
#using System.Web.Http.Description <=== CS0234: The type or namespace name 'Description' does not exist in the namespace 'System.Web.Http' (are you missing an assembly reference?)
Solution: Set "Copy Local : True" in properties for References\System.Web.Http
You aren't doing anything wrong. There is just some configuration problem that prevents Visual Studio from adding the reference to the list of assemblies for the compiler to check.
Types in the System.Web.Http.Description are found in the System.Web.Http.dll assembly, which is found in a Nuget package folder.
You can type Uninstall-Package Microsoft.AspNet.WebApi in the NuGet Package Console and then type Install-Package Microsoft.AspNet.WebApi to re-install it at which point, the reference will be fixed.
I un-installed MVC4 and reinstalled from a fresh download. I had to create a NEW project again and the Description namespace appeared.
The strange thing is if I open the old project the Description namespace is still missing when I try to add a using...
I was also facing the same issue when while creating a SPA solution by using MVC-4 framework.
I resolved this by setting the Copy Local : True in properties for the reference System.Web.Http.
I had the same problem. I was opening the project as a website instead of project/solution. So, after opening the solution it solved my problem.

MonoDevelop error

I developed one Mono project which runs perfectly on MonoDevelop in Windows, but it throws a compiler error like System.Services DLL error. The exact error message is
Compiler Error Message: CS0234: The type or namespace name 'ServiceModel' does not exist in the namespace 'System' (are you missing an assembly reference?)
What could be the problem?
System.ServiceModel is provided by the System.ServiceModel.dll assembly. You should be able to choose this by right clicking on the "Refrences" folder in the solution tree and choosing "Edit".
You should also take note that WCF on mono is not 100% complete. It may however do what you need.
Yοu can add the missing assemblies by using below command in linux:
gacutil -i System.Data.dll
and adding during compile time is:
gmcs filename -r:System.Data.dll