Unity gives me these strange errors for some reason when i try to build my project. I do not know why it gives me these errors, when they should've been given earlier. I've tried restarting unity, deleting the "plugins" folder, deleting the .sln files and putting the build folder on a different folder. How can i fix these strange errors??
here's the code unity keeps giving me errors from, if that helps anything: https://paste.myst.rs/lwj5nsm1
And here's the errors unity gave me:
Assets\LevelGenerator\Scripts\Editor\LevelEditor.cs(9,30): error CS0115: 'GeneratorEditor.OnInspectorGUI()': no suitable method found to override
Assets\LevelGenerator\Scripts\Editor\LevelEditor.cs(7,48): error CS0234: The type or namespace name 'Editor' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
Assets\LevelGenerator\Scripts\Editor\LevelEditor.cs(6,6): error CS0246: The type or namespace name 'CustomEditorAttribute' could not be found (are you missing a using directive or an assembly reference?)
Assets\LevelGenerator\Scripts\Editor\LevelEditor.cs(6,6): error CS0246: The type or namespace name 'CustomEditor' could not be found (are you missing a using directive or an assembly reference?)
UnityEditor.BuildPlayerWindow+BuildMethodException: 5 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in :0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in :0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Your code is used for the editor, and therefore should not be included in the build result.What I do to solve this, I create a "DONOTCOMPILETHIS" build directive that I add to the player Settings.
PlayerSetting DLG
and finaly in your code add :
using UnityEngine;
#if !DONOTCOMPILETHIS
using UnityEditor;
using UnityEditor.IMGUI.Controls;
[CustomEditor(typeof(CGameTower)), CanEditMultipleObjects]
public class CBoundRectEditor : Editor
{
private BoxBoundsHandle m_BoundsHandle = new BoxBoundsHandle();
...
}
#endif
Related
using System;
using SplashKitSDK;
public class Program
{
public static void Main()
{
console.WriteLine("Hello World");
}
}
Some of the errors I am getting:
Unnecessary using directive. [Helloworld]csharp(CS8019)
The type or namespace name 'System' could not be found (are you missing a
using
directive or an assembly reference?) [Helloworld, Helloworld, Helloworld,
Helloworld]csharp(CS0246)
Predefined type 'System.Object' is not defined or imported
The name 'Console' does not exist in the current context
I've tried everything, and nothing seems to work. I also believe I installed the language tools and library correctly. If anyone knows how to fix this please let me know. Thanks!
I have a USQL Job which reads json from Azure Blob and after some data manipulation writes a single line JSON file to ADLS.
I have written a Custom Ouputter to write JSON File.
This is how my CustomOutputter files look like:
using Microsoft.Analytics.Interfaces;
using Microsoft.Analytics.Types.Sql;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Newtonsoft.Json;
namespace demo{
[SqlUserDefinedOutputter(AtomicFileProcessing = true)]
public class JSONOutputter : IOutputter
{
//Actual Code Here
public static class Factory
{
public static JSONOutputter JSONOutputter(bool isHeader = true, Encoding encoding = null)
{
return new JSONOutputter(isHeader, encoding);
}
}
}
I am using this Ouputter in my USQL Job like this:
OUTPUT #final_output
TO "/output/json/final.json"
USING demo.Factory.JSONOutputter(isHeader: true);
When I compile my USQL Script using
ADL: Compile Script
I get this error:
[Info] Start compiling code behind: /users/kumar.pratik/documents/usql/second.usql.cs ...
[Error] Command failed: mono /Users/kumar.pratik/.vscode/extensions/usqlextpublisher.usql-vscode-ext-0.2.11/compilehost/compilehost.exe /users/kumar.pratik/documents/usql/second.usql.cs /Users/kumar.pratik/Documents/usql/usqlCodeBehindReference /Users/kumar.pratik/Documents/usql/second.usql.dll __codeBehind__tRYGlFBeSWcl
[Error] Compile failed
error: "The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?)" at line: 8, column 6
error: "The type or namespace name 'JsonTextWriter' could not be found (are you missing a using directive or an assembly reference?)" at line: 17, column 12
error: "The type or namespace name 'JsonTextWriter' could not be found (are you missing a using directive or an assembly reference?)" at line: 44, column 34
Could someone please let me know how can I get this fixed?
I am working on Visual Studio Code on Mac OS
Thanks
Can you please share how your script looks like? In particular, are you
Using Visual Studio's code behind for your Outputter code?
If the answer to 1 is no: Did you register your Outputter and Newtonsoft lib in the U-SQL catalog with CREATE ASSEMBLY or via the Visual Studio Assembly registration feature? And did you reference the U-SQL assemblies (both your own code and Newtonsoft) in your script with REFERENCE ASSEMBLY?
More details: https://blogs.msdn.microsoft.com/azuredatalake/2016/08/26/how-to-register-u-sql-assemblies-in-your-u-sql-catalog/
I'm trying to run the Code Generation for my edmx, however every time I do this, I'm being faced with lots of errors.
This is the Context.cs file is generated:
//------------------------------------------------------------------------------
/ <auto-generated>
// This code was generated from a template.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace project.DAL
{
using System;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
public partial class NebulabEntities : DbContext
{
public NebulabEntities()
: base("name=NebulabEntities")
{
}
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
throw new UnintentionalCodeFirstException();
}
public virtual DbSet<Commodity> Commodities { get; set; }
public virtual DbSet<CommoditiesPrice> CommoditiesPrices { get; set; }
}
}
The Errors I'm getting:
Severity Code Description Project File Line
Error CS0426 The type name 'Data' does not exist in the type 'System' project.DAL C:\Test\project.DAL\RedSpiderDataModel.Context.cs 13
Error CS0426 The type name 'Data' does not exist in the type 'System' project.DAL C:\Test\project.DAL\RedSpiderDataModel.Context.cs 14
Error CS0246 The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?) project.DAL C:\Test\project.DAL\RedSpiderDataModel.Context.cs 16
Error CS0115 'NebulabEntities.OnModelCreating(DbModelBuilder)': no suitable method found to override project.DAL C:\Test\project.DAL\RedSpiderDataModel.Context.cs 23
Error CS0246 The type or namespace name 'DbModelBuilder' could not be found (are you missing a using directive or an assembly reference?) project.DAL C:\Test\project.DAL\RedSpiderDataModel.Context.cs 23
Error CS0246 The type or namespace name 'DbSet<Commodity>' could not be found (are you missing a using directive or an assembly reference?) project.DAL C:\Test\project.DAL\RedSpiderDataModel.Context.cs 28
Error CS0246 The type or namespace name 'DbSet<CommoditiesPrice>' could not be found (are you missing a using directive or an assembly reference?) project.DAL C:\Test\project.DAL\RedSpiderDataModel.Context.cs 29
I'm using Visual Studio 2015 for this, and I've added EF to my class library project.
Does anyone know why it's generating code with errors?
This is because you are referencing older entity framework dll in your project. The solution is -
1. First remove the reference of older EF dll from Reference Manager.
2. Then add the Newer EF dll by using the browser feature.
For EF 6.1.3 you will get the dll in the folder "EntityFramework.6.1.3\lib\net45"
I'm wading through compiling and install MonoDevelop on Ubuntu 13.10.
It's requiring so many manual compilation of other dependencies, which have found some information online to solve.
Unfortunately, I was not able to solve this one:
The type or namespace name `Dom' does not exist in the namespace `MonoDevelop.Projects'
./configure goes fine, but make gives me the above message, along with the following:
mkdir -p build/
make DEBUG_BeforeBuild
make[3]: Entering directory `/home/leon/dev/monodevelop/extras/JavaBinding'
make[3]: Leaving directory `/home/leon/dev/monodevelop/extras/JavaBinding'
PKG_CONFIG_PATH=../../local-config:$PKG_CONFIG_PATH dmcs -noconfig -codepage:utf8 -warn:4 -optimize- -debug -define:DEBUG -out:build/JavaBinding.dll -target:library './AssemblyInfo.cs' './gtk-gui/generated.cs' './gtk-gui/JavaBinding.CodeGenerationPanelWidget.cs' './gtk-gui/JavaBinding.GlobalOptionsPanelWidget.cs' './Gui/GlobalOptionsPanel.cs' './Gui/ProjectConfigurationPropertyPanel.cs' './IKVMCompilerManager.cs' './JavaCompiler.cs' './JavaLanguageBinding.cs' './Project/JavaCompilerParameters.cs' '-resource:./gtk-gui/gui.stetic' '-resource:./icons/Java.FileIcon' '-resource:./icons/java-16.png' '-resource:./icons/java-22.png' '-resource:./icons/java-icon-32.png' '-resource:./JavaBinding.addin.xml' '-resource:./md1format.xml' '-resource:./templates/EmptyJavaFile.xft.xml' '-resource:./templates/EmptyJavaProject.xpt.xml' '-resource:./templates/IkvmConsoleApplicationProject.xpt.xml' '-resource:./templates/IkvmGladeApplicationProject.xpt.xml' '-resource:./templates/IkvmGnomeApplicationProject.xpt.xml' '-resource:./templates/IkvmGtkApplicationProject.xpt.xml' '-resource:./templates/IkvmLibraryProject.xpt.xml' '-resource:./templates/JavaApplet.xft.xml' '-resource:./templates/JavaApplication.xft.xml' '-resource:./templates/JavaApplicationProject.xpt.xml' '-resource:./templates/JavaConsoleApplicationProject.xpt.xml' '-resource:./templates/JavaDialog.xft.xml' '-resource:./templates/JavaFrame.xft.xml' '-resource:./templates/JavaOKDialog.xft.xml' '-resource:./templates/JavaPanel.xft.xml' -r:Mono.Posix -pkg:glade-sharp-2.0 -pkg:gtk-sharp-2.0 -pkg:mono-addins -pkg:monodevelop -r:System -r:System.Drawing -r:System.Xml
./JavaLanguageBinding.cs(31,28): error CS0234: The type or namespace name `Dom' does not exist in the namespace `MonoDevelop.Projects'. Are you missing an assembly reference?
./JavaLanguageBinding.cs(32,28): error CS0234: The type or namespace name `Dom' does not exist in the namespace `MonoDevelop.Projects'. Are you missing an assembly reference?
./JavaLanguageBinding.cs(34,28): error CS0234: The type or namespace name `CodeGeneration' does not exist in the namespace `MonoDevelop.Projects'. Are you missing an assembly reference?
./JavaLanguageBinding.cs(109,10): error CS0246: The type or namespace name `IParser' could not be found. Are you missing an assembly reference?
./JavaLanguageBinding.cs(113,10): error CS0246: The type or namespace name `IRefactorer' could not be found. Are you missing an assembly reference?
Compilation failed: 5 error(s), 0 warnings
make[2]: *** [build/JavaBinding.dll] Error 1
How do I get these last blocking items installed in order to build successfully?
Disable the "extras/JavaBinding" and "extras/ValaBinding" via './configure --select'. They do not work.
I try to upload an image in my project which is in c#.and my code in the submit button is following
FileUpload1.SaveAs(
Server.MapPath("Photos\\" +
System.Core.WebSecurity.GetUserName(Request) + ".jpg"));
Response.Write(
"<html> <script> alert ( 'you have successfully uploaded' ); </script></html>");
Response.Redirect("studentcreated.aspx");
but on compiling it shows an error as
The type or namespace name 'Core' does not exist in the namespace
'System' (are you missing an assembly reference?)
.
Then i try to solve this by adding system.core to reference. But still it shows the same error. I am using vs2008 asp3.5.
Try this to get username: User.Identity.Name
EDIT:
Add this reference: using System.Web.Security;