StAsIk2008 0 / 0 / 0 Регистрация: 20.02.2020 Сообщений: 1 |
||||
1 |
||||
20.02.2020, 13:09. Показов 12911. Ответов 3 Метки нет (Все метки)
вот скрипт
__________________
0 |
управление сложностью 1687 / 1300 / 259 Регистрация: 22.03.2015 Сообщений: 7,545 Записей в блоге: 5 |
|
20.02.2020, 13:38 |
2 |
Пропущена закрывающая скобка, либо лишняя открывающая
0 |
11 / 9 / 8 Регистрация: 08.05.2013 Сообщений: 139 |
|
20.02.2020, 14:55 |
3 |
На какую строку ругается?
0 |
0 / 0 / 0 Регистрация: 17.02.2020 Сообщений: 87 |
|
24.02.2020, 11:53 |
4 |
В конец поставь знак }
0 |
I am getting an error at run time when viewing my ASP.NET page in the browser. I am not getting any build errors however I am getting the following compiler error at runtime:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1513: } expected
Source Error:
Line 329: #line hidden
Line 330: __output.Write("rnttt</div>rntt");
Line 331: }
Line 332:
Line 333: private System.Web.UI.Control __BuildControl__control7() {
Source File: c:WindowsMicrosoft.NETFrameworkv1.1.4322
Temporary ASP.NET Filesxxxxxxxx450ffa78d46d847d
k1gsz9dj.0.cs Line: 331
I cannot locate any missing } in my source code and this error is occurring in the generated code files that exist in the Temporary ASP.NET Files directory. How can I trace this to the line of code that is actually malformed in my page or user controls on my page?
Chris Marisic
32.2k24 gold badges164 silver badges257 bronze badges
asked Feb 23, 2012 at 3:52
8
If the error code related as following:
A variable name same as reserved word then you can rename variable.
A code segment such as:
@model MyModel
{
var appname = @Model.Apps.FirstOrDefault(x => x.ID == Model.SelectedApp);
}
Remove ‘@’ coming before Model.Apps.FirstOrDefault(x => x.ID == Model.SelectedApp)
A code segment or section usage such as:
@section{
<!-- hiiii it's not about an error -->
}
Remove the apostrophe from comment in section.
If it is none of these specific cases you can attempt to locate where the error is generated by applying a source reduction. Delete/cut/comment out pieces of code until you can reliably turn the error off and on. The code that turns the error on is likely the culprit if it is not one of the above situations.
Chris Marisic
32.2k24 gold badges164 silver badges257 bronze badges
answered Nov 13, 2013 at 9:05
1
Look in the markup (aspx or ascx) for blocks like:
<% ... some C# code.... { %>
markup(controls, html etc)
<% } %>
Any opened bracket {
needs to be closed with another bracket }
.
These pages or controls are compiled once by ASP .Net when they are first requested.
Visual Studio doesn’t compile aspx or ascx
files.
If the project is «Web Site» type, Visual Studio compiles the aspx/ascx
files, but if the project is «Web Application» type Visual Studio doesn’t «compile» the markup (it does not generate the corresponding classes to the aspx/ascx
markup)
answered Feb 23, 2012 at 5:42
Adrian IftodeAdrian Iftode
15.4k3 gold badges47 silver badges72 bronze badges
1
On my site, the problem was caused by a block of code that looked like this:
@{
var currentNode = @linkedList.Find(@CurrentPage);
if (@currentNode.Next != null)
{
var next = @currentNode.Next;
<li>
@next.Name
</li>
}
if (@currentNode.Previous != null)
{
var prev = @currentNode.Previous;
<li>
@prev.Name
</li>
}
}
I’m not sure why the problem was caused by the nesting. This may be a bug in the compiler.
answered Aug 29, 2014 at 8:03
devinbostdevinbost
4,5302 gold badges42 silver badges50 bronze badges
1
I got a similar problem and oculd find it only after a log of trial and error.
The error I made was to add a ‘@’ to variables inside a foreach loop which started with:
@foreach
answered Oct 25, 2016 at 14:48
Well as the error suggests, you are missing a closing curly brace ‘}’
Have a look at the msdn compiler errors documentation:
- http://msdn.microsoft.com/en-us/library/83ht1k63(v=vs.80).aspx
As in the example on MSDN:
// the below will cause CS1513 since namespace is missing '}'
namespace y
{
class x
{
public static void Main()
{
}
}
answered Feb 23, 2012 at 4:39
skubskub
2,25623 silver badges33 bronze badges
1
try to compile it in visual studio. i think it will also show where the exact line of the code that has incomplete curly braces.
compilation error cs1513
answered Feb 23, 2012 at 5:10
NET ExpertsNET Experts
1,49517 silver badges35 bronze badges
0
C++ Error 1513-1514
Всем привет, я новичок как в Unity так и в C++.
Прошу вашей помощи, импортировал ассет на что Unity пожаловался на скрипт, многие ошибки устранил но вот две ошибки не получается, вот эти «error CS1514: { expected и error CS1513: } expected»
Вот сам скрипт:
Используется csharp
using UnityEngine;
using CharacterMotor;
public class CharacterMotor;
public class StepsHandlerExample : MonoBehaviour
{
private CharacterMotor charMot;
private Vector3 displacement;
private float iniBackSpeed;
private float iniForSpeed;
private float iniSideSpeed;
private Vector3 lastPos;
private float slowBackSpeed;
private float slowForSpeed;
private float slowSideSpeed;
public float slowWalkVolume = 0.1f;
private bool onetime;
public float normalWalkRate = 0.7f;
public float slowWalkRate = 1.5f;
private void Start()
{
lastPos = transform.position;
charMot = GetComponent<CharacterMotor>();
iniForSpeed = charMot.movement.maxForwardSpeed;
iniBackSpeed = charMot.movement.maxBackwardsSpeed;
iniSideSpeed = charMot.movement.maxSidewaysSpeed;
slowBackSpeed = charMot.movement.maxBackwardsSpeed — 6.0f;
slowForSpeed = charMot.movement.maxForwardSpeed — 7.0f;
slowSideSpeed = charMot.movement.maxSidewaysSpeed — 5.0f;
}
private void Update()
{
if (Input.GetKey(KeyCode.LeftShift))
{
GetComponent<AudioSource>().volume = slowWalkVolume;
charMot.movement.maxForwardSpeed = slowForSpeed;
charMot.movement.maxBackwardsSpeed = slowBackSpeed;
charMot.movement.maxSidewaysSpeed = slowSideSpeed;
if (onetime)
{
onetime = false;
CancelInvoke(«NormalWalk»);
InvokeRepeating(«NormalWalk», 0f, slowWalkRate);
}
}
else
{
GetComponent<AudioSource>().volume = 1f;
charMot.movement.maxForwardSpeed = iniForSpeed;
charMot.movement.maxBackwardsSpeed = iniBackSpeed;
charMot.movement.maxSidewaysSpeed = iniSideSpeed;
if (!onetime)
{
onetime = true;
CancelInvoke(«NormalWalk»);
InvokeRepeating(«NormalWalk», 0f, normalWalkRate);
}
}
}
private void NormalWalk()
{
displacement = transform.position — lastPos;
lastPos = transform.position;
if (!charMot.IsJumping())
{
if (displacement.magnitude > 0.01)
{
if (!GetComponent<AudioSource>().isPlaying)
{
GetComponent<AudioSource>().Play();
}
}
}
}
private void OnGUI()
{
GUI.Box(new Rect(Screen.width/12, Screen.height — (Screen.height/4), Screen.width/1.1f, Screen.height/5),
«Hold Left Shift to walk slowly without noise! see the difference if you run behind the enemy!»);
}
}
Заранее всем спасибо большое.
- Shram
- UNец
- Сообщения: 5
- Зарегистрирован: 04 мар 2019, 14:02
Re: C++ Error 1513-1514
1max1 04 мар 2019, 15:16
Как насчет сходить уроки по с# почитать, глядишь сможешь отличать его от c++. К тому же, если ты и дальше планируешь развиваться, то код писать нужно в нормальной среде типа Visual Studio, которая будет подчеркивать строки с ошибками.
Что по твоему должна делать эта строка в твоем коде?
Используется csharp
public class CharacterMotor;
Конечно же ты не знаешь, потому что код-то не твой, ты его от куда-то взял в надежде на чудо, а разбираться не захотел
-
1max1 - Адепт
- Сообщения: 5285
- Зарегистрирован: 28 июн 2017, 10:51
Re: C++ Error 1513-1514
Friend123 04 мар 2019, 17:09
1max1, улыбнул )))))
-
Friend123 - Старожил
- Сообщения: 701
- Зарегистрирован: 26 фев 2012, 22:12
- Откуда: Тверь
-
- ICQ
Re: C++ Error 1513-1514
Shram 04 мар 2019, 18:32
1max1 писал(а):Как насчет сходить уроки по с# почитать, глядишь сможешь отличать его от c++. К тому же, если ты и дальше планируешь развиваться, то код писать нужно в нормальной среде типа Visual Studio, которая будет подчеркивать строки с ошибками.
Что по твоему должна делать эта строка в твоем коде?Используется csharp
public class CharacterMotor;
Конечно же ты не знаешь, потому что код-то не твой, ты его от куда-то взял в надежде на чудо, а разбираться не захотел
Конечно не мой умник, читай внимательно ! Написано же что был импортирован ассет и было около 6-и ошибок, они ссылались на «CharacterMotor»
а когда я кидаю другой скрипт «CharacterMotor» тогда появдяется другая ошибка, «The type or namespace name ‘ParticleAnimator’ could not be found (are you missing a using directive or an assembly reference?»
Затем пришел к этим единственным ошибкам.
Но я вижу здесь все злые.
- Shram
- UNец
- Сообщения: 5
- Зарегистрирован: 04 мар 2019, 14:02
Re: C++ Error 1513-1514
Friend123 04 мар 2019, 18:37
Shram писал(а):Но я вижу здесь все злые.
Это не мы злые, это вы, простите, задаете вопросы уровня 1 курса универа по программированию
Вот, если выдает ошибку, то в самой ошибке всегда сказано что не так, они все типовые. Простое гугление даст ответ в 10 раз быстрее, чем писать на форуме.
P.S. Как-то я думал всегда, что форумы для обсуждения сложных проблем. Ошибался видать.
-
Friend123 - Старожил
- Сообщения: 701
- Зарегистрирован: 26 фев 2012, 22:12
- Откуда: Тверь
-
- ICQ
Re: C++ Error 1513-1514
Shram 04 мар 2019, 18:47
Friend123 писал(а):
Shram писал(а):Но я вижу здесь все злые.
Это не мы злые, это вы, простите, задаете вопросы уровня 1 курса универа по программированию
Вот, если выдает ошибку, то в самой ошибке всегда сказано что не так, они все типовые. Простое гугление даст ответ в 10 раз быстрее, чем писать на форуме.
P.S. Как-то я думал всегда, что форумы для обсуждения сложных проблем. Ошибался видать.
P.S. а я думал почемучка для этого и была создана.
Ну хорошо, смотрите я создал новый проект импортировал ассет, на что он мне ответил ошибкой вот такую
«StepsHandlerExample.cs(5,13): error CS0246: The type or namespace name ‘CharacterMotor’ could not be found (are you missing a using directive or an assembly reference?»
И поверьте я пользовался «Google» проверил имя скрипта «CharacterMotor» совпадает, Google не чего не нашел.
- Shram
- UNец
- Сообщения: 5
- Зарегистрирован: 04 мар 2019, 14:02
Re: C++ Error 1513-1514
1max1 04 мар 2019, 19:40
Похоже автор твоего ассета забыл добавить скрипт CharacterMotor))
И поверьте я пользовался «Google» проверил имя скрипта «CharacterMotor» совпадает, Google не чего не нашел.
Что-то я тебе не верю)))
http://wiki.unity3d.com/index.php/CharacterMotor
-
1max1 - Адепт
- Сообщения: 5285
- Зарегистрирован: 28 июн 2017, 10:51
Re: C++ Error 1513-1514
Shram 04 мар 2019, 19:57
1max1 писал(а):Похоже автор твоего ассета забыл добавить скрипт CharacterMotor))
И поверьте я пользовался «Google» проверил имя скрипта «CharacterMotor» совпадает, Google не чего не нашел.
Что-то я тебе не верю)))
http://wiki.unity3d.com/index.php/CharacterMotor
Этот скрипт я находил и добавлял, но все же спасибо, но теперь вылезли еще ошибки, суть их схожая
«The type or namespace name ‘ParticleAnimator’ could not be found (are you missing a using directive or an assembly reference?»
Теперь я понял что значит Не удалось найти ссылка на сборку, нет тупа скрипта, я ведь правельно все понял ? Значит уже два скрипта он забыл положить ?
- Shram
- UNец
- Сообщения: 5
- Зарегистрирован: 04 мар 2019, 14:02
Re: C++ Error 1513-1514
Shram 04 мар 2019, 20:36
Ну да точно, ассет требует версию 4.6 теперь все понял.
Спасибо большое, вот теперь есть не большой как в скриптах так и в юнити.
- Shram
- UNец
- Сообщения: 5
- Зарегистрирован: 04 мар 2019, 14:02
Вернуться в Почемучка
Кто сейчас на конференции
Сейчас этот форум просматривают: Google [Bot] и гости: 31
Содержание
- Error cs1513 expected что это
- Answered by:
- Question
- Answers
- Error cs1513 expected что это
- Answered by:
- Question
- Answers
- All replies
- Error cs1513 expected что это
- Answered by:
- Question
- Answers
- All replies
- Error cs1513 expected что это
- Answered by:
- Question
- Answers
Error cs1513 expected что это
Answered by:
Question
This is the last two statements of my coding:>// closing a class statement>//closing a void statement.
No other errors. Message CS1513 three times repeated from csc compiler on the same line coding.
Answers
Error CS1513 shows that t he compiler expected a closing curly brace (>) that was not found.
The following sample generates CS1513:
namespace y // CS1513, no close curly brace
public static void Main()
If you still have any further concern , please post your code, we will try our best to help you to solve this issue.
Lucy Liu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Источник
Error cs1513 expected что это
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Answered by:
Question
I am just starting university and have begun programming in C#, I have just run into an issue that I am unsure how to fix where compiling states that a > is expected on line 37, but when I fix this, a multitude of errors occur stating that:
A local or parameter named ‘Percentage’ cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter
Cannot convert lambda expression to type ‘bool’ because it is not a delegate type
Below is the area of code that is being changed
Any help regarding this error would be greatly appreciated
Answers
Try casting the values as floats:
The proper format of if with else if is in the link.
Here is the proper syntax:
You will have to rename the parameter «Percentage» to something like «percentage». The error tells you it is already used.
Let me know if that helps!
You hit an else before you hit a closing bracket here:
Control structures either govern the next block defined by brackets or only the code until the next Semikolon (wich means one line).
Your code put’s the else inside the if block. It is actually a peer of the if.
I guess you are missing closing bracket for if condition and else if condition. And else if end with else condition. Please try below code.
Hope this helps you.
I have tried your suggestions and I am now getting the error that occurred before when I tested it, with the command prompt outputting:
error CS0136: A local or parameter named ‘percentage’ cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter
error CS1660: Cannot convert lambda expression to type ‘bool’ because it is not a delegate type
Throughout the document, adding the curly bracket seems to break the program even worse.
Is this an easier fix or does this make the problem worse?
How can that be without an «else if»?
You can do the else.
I have tried your suggestions and I am now getting the error that occurred before when I tested it, with the command prompt outputting:
error CS0136: A local or parameter named ‘percentage’ cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter
error CS1660: Cannot convert lambda expression to type ‘bool’ because it is not a delegate type
Throughout the document, adding the curly bracket seems to break the program even worse.
Is this an easier fix or does this make the problem worse?
To fix the lambda problem, you must swat the «=>» to «>=» like in my code sample above.
Try renaming the Percentage variable just in the sample code you provided, or change » float Percentage = ( NumberofMarksInt / 70 ) * 100 ; » to » Percentage = ( NumberofMarksInt / 70 ) * 100 ; «. Drop the float in front of it. It was already defined.
That should fix it for you.
A control sturcture — be it an if, else, try, catch, switch, case, for or while — needs a clear definition for wich part of the code it applies. Indenting has no effect. Whitespaces have no effect.
You either define the area with curly brackets or it just takes everything until the next semikolon.
Without the proper braketing (the code you wrote in your OP) the syntax was so broken, the compiler could not even get to the real errors when looking at the code.
It was too broken to even properly find the real errors.
After you fixed the faulty brakets, you can now go deal with the real issues. Namely:
error CS0136: A local or parameter named ‘percentage’ cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter
error CS1660: Cannot convert lambda expression to type ‘bool’ because it is not a delegate type
CS0136 implies you already had a variable of that name defined. Show us the rest of your code, we might be able to spot it.
CS1660 complains about this combination «=>» That is the character combination that starts a lambda expression, not the «>=» (more or equal) sign. And lambdas really don’t belong into a if.
Источник
Error cs1513 expected что это
Answered by:
Question
Not sure why I am getting this error
This code has been in use for over a year, recently changed host and now getting compile error — error CS1513: > expected
Here is the code, which looks balanced for curly braces to me.
It is asking for another closing curly brace at the end.
Is this an issue of Webmatrix1 vs Webmatrix2 ?
Any help please — much appreciated.
Answers
My only thought is that something within the Layout page is causing this to occur.
I tried moving around some of the braces in the Layout page to see if that made any difference at all :
It’s possible that the semicolon issue is coming down from the Layout and the error is only been seen on the child-page level.
Do you have any other code that might be interferring with this? (The @ symbol can often throw off the curly braces and cause them to «miss» one another)
I tried the following code that you had below and it appeared to work just fine :
Thaks Rion
Yes it goes into another block as follows
The logic is if user is logged in then show their GiftAid status (which can be yes or no) else show the
Do you only need to display the actual
area or all of the code behind it?
Example with just Gift Aid
Example with entire section
(I removed the trailing ‘;’ after your RenderPage call, although I’m not around an environment to test it.)
removed the trailing ; but webmatrix still not happy and want another > at the end of first block of code — it gives line number and column number.
As I mentioned this code has been working for more than a year and now that I changed host this thing has cropped up, probably they have different compiler — Razor 2 ?
Ah you may want to ensure that you have the newest version of WebMatrix 2. (WebMatrix 3 was just released recently, although 2 should be sufficient)
Have you tried removing the Razor code blocks within your if-else blocks to see if that makes any difference at all? (Sometimes they can throw things off a bit) :
I did that and found out that it is the top code between @ < >that is the problem. The error goes away if I remove the top block but stays if I remove the @if block.
I noticed that before as well by the colour that it is not extending to the 2nd > where it should .
Regarding Webmatrix 2, yes I do have that uptodate which I regret because after the update the Webdeploy stopped working and hasn’t worked since despite pestering the hosts many times, and they say it is fine on their end. Therefore I changed the host and landed into more troubles, and webdeploy still dont work.
wasted a lot of time after the update without getting any real advantage.
Источник
Error cs1513 expected что это
Answered by:
Question
This is the last two statements of my coding:>// closing a class statement>//closing a void statement.
No other errors. Message CS1513 three times repeated from csc compiler on the same line coding.
Answers
Error CS1513 shows that t he compiler expected a closing curly brace (>) that was not found.
The following sample generates CS1513:
namespace y // CS1513, no close curly brace
public static void Main()
If you still have any further concern , please post your code, we will try our best to help you to solve this issue.
Lucy Liu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Источник
- Remove From My Forums
-
Question
-
This is the last two statements of my coding:}// closing a class statement}//closing a void statement.
No other errors. Message CS1513 three times repeated from csc compiler on the same line coding.
Answers
-
Hi Sandro,
Error CS1513 shows that the compiler expected
a closing curly brace (}) that was not found.The following sample generates CS1513:
// CS1513
namespace y
// CS1513, no close curly brace{
class x
{
public static void Main()
{
}
}More information:
http://msdn.microsoft.com/en-us/library/83ht1k63(VS.80).aspx
If you still have any further concern , please post your code, we will try our best to help you to solve this issue.
Best regards,
Lucy
Lucy Liu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.-
Marked as answer by
Thursday, June 2, 2011 8:35 AM
-
Marked as answer by