โŒ

Normal view

There are new articles available, click to refresh the page.
Before yesterdayMain stream

Microsft Visual Studio window doesn't show up

Image link

So I've just installed Microsoft Visual Studio to my new computer, now that I've opened it for the first time I can't see the main window where you're supposed to write code in!

I've opened multiple type of projects and the thing doesn't work either, I'll leave an image over this. After the installer finished installing, it gave an error -2146233033, as the package installer data was corrupted it said, but after going to the installer again to reinstall what I needed, the notice disappeared, thought I don't know how much influenced and if that's why the main code window doesn't appear.

Type or Namespace or end-of-file excpected

followed the tutorial to make a Sway And head Bobbing weapon I have followed it correctly but I get an error: Type or Namespace or end-of-file excpected

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class WeaponSwayBob : MonoBehaviour
{
    [Header("Sway")]
    public float SwayIntensityX;
    public float SwayIntensityY;
    public float MaxSway;
    public float MinSway;

    [Header("Transform")]
    public Transform Gun;

  public BobOverride[] BobOverrides;
  
  
  public float currentSpeed;
  private float TimeX;
  private float TimeY;

  private float XPos;
  private float YPos;

  private Vector3 SmoothV;

  private void Update()
  {
    foreach(BobOverride Bob in BobOverrides)
    {
      if(currentSpeed >= Bob.minSpeed && currently <= Bob.maxSpeed)
      {
        float bobMultiplier = (currentSpeed == 0) ? 1 : currentSpeed;

        TimeX += Bob.SpeedX / 10 * Time.deltaTime * bobMultiplier;
        TimeY += Bob.SpeedY / 10 * Time.deltaTime * bobMultiplier;

        XPos = Bob.BobX.Evaluate(TimeX) * Bob.IntensityX;
        YPos = Bob.BobY.Evaluate(TimeY) * Bob.IntensityY;
      }
    }

    float XSway = -Input.GetAxis("Mouse X") * SwayIntensityX;
    float YSway = -Input.GetAxis("Mouse Y") * SwayIntensityY;

    XSway = Mathf.Clamp(XSway, MinSway, MaxSway);
    YSway = Mathf.Clamp(YSway, MinSway, MaxSway);

    XPos += XSway;
    YPos += YSway;

  }

  private void FixedUpdate
  {
    Vector3 target = new Vector3(XPos, YPos, 0);
    Vector3 desiredPos = Vector3.SmoothDamp(Gun.localPosition, target, ref SmoothV, 0.1f);
    Gun.localPosition = desiredPos;
  }

  [System.Serializeable] 

  public struct BobOverride
    {
    public float minSpeed;
    public float maxSpeed;

    [Header("X")]
    public float SpeedX;
    public float IntensityX;
    public AnimationCurve BobX;


    [Header("Y")]
    public float SpeedY;
    public float IntensityY;
    public AnimationCurve BobY;
    }
}

and this is my player movement code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour
{
  public float moveSpeed;


  public float groundDrag;


  public float playerHeight;
  public LayerMask whatIsGround;
  bool grounded;


  [Header("Script")]
  public WeaponSwayBob SwayBobScript;
  

  [Header("Orientation")]
  public Transform orientation;

  float horizontalInput;
  float verticalInput;


  Vector3 moveDirection;

  Rigidbody rb;

  
  private void Start()
  {
    rb = GetComponent<Rigidbody>();
    rb.freezeRotation = true;

  }

   
   private void Update()
   {
     grounded = Physics.Raycast(transform.position, Vector3.down, playerHeight * 0.5f + 0.2f, whatIsGround);


     MyInput();

    

    if (grounded)
    {
       rb.drag = groundDrag;
    
    else
         rb.drag = 4;
    
    }
     
     SwayBobScript.currentSpeed = WeaponSway() ? currentSpeed : 0;

   }




   private void FixedUpdate()
   {
     MovePlayer();
     




   }




   private bool WeaponSway()
   {
     if(Input.GetAxisRaw("Horizontal") ! = 0 || Input.GetAxisRaw("Vertical") ! = 0)
     {
       if(grounded)
       {
         return true;
       }

      return false;

     }
   }



   

  private void MyInput()
  {
    horizontalInput = Input.GetAxisRaw("Horizontal");
    verticalInput = Input.GetAxisRaw("Vertical");  



  }





  private void MovePlayer()
  {
    moveDirection = orientation.forward * verticalInput + orientation.right * horizontalInput;

    
    rb.AddForce(moveDirection.normalized * moveSpeed * 10f, ForceMode.Force);


    



  }

  


  

}

i expected that the code that the code is running normal but when i save the code, the code showing errors

fxhgjhvkhbm jgtufciyfuylgijkbj bhvfxtdyitfkjglub ghgftdidfuygljb bhvggcdciyktvjlbj bvgfxrcytihkvhg ftdcmxrynsc bzsdxfcgvhbjhgvf ddgdgxfc gvhb vc c jbsjdjkladhnsjjfjiaolkoBIFIK,SS IADN IWEEFIIJ;ICX

Cannot read properties of undefined (reading 'FILE_LENGHT_ERROR_MESSAGE')

I'm having a problem and no idea why the code is not working and returning a mock error.

H:\Thiago\programaรงรฃo estudo\modulo01\aula01-mocks\index.test.js:11 const expected = new Error(error.FILE_LENGHT_ERROR_MESSAGE) ^

TypeError: Cannot read properties of undefined (reading 'FILE_LENGHT_ERROR_MESSAGE') at H:\Thiago\programaรงรฃo estudo\modulo01\aula01-mocks\index.test.js:11:40 at Object. (H:\Thiago\programaรงรฃo estudo\modulo01\aula01-mocks\index.test.js:18:4)
at Module._compile (node:internal/modules/cjs/loader:1356:14) at Module._extensions..js (node:internal/modules/cjs/loader:1414:10) at Module.load (node:internal/modules/cjs/loader:1197:32) at Module._load (node:internal/modules/cjs/loader:1013:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12) at node:internal/main/run_main_module:28:49

Node.js v18.19.1

that's the error log and here my code:

`const { error } = require("./src/constants")
const File = require("./src/file"); 

const assert = require('assert')

// IFEE
;(async() => {
    // variรกveis criadas nesse bloco, sรณ serรฃo validadas durante sua execuรงรฃo
    {
      const filePath = './mocks/emptyFile-invalid.csv'
      const expected = new Error(error.FILE_LENGHT_ERROR_MESSAGE)
      const result = File.csvToJSON(filePath)
      await assert.rejects(result, expected)

    }


}) ()`

a little help maybe.

I tried to read the error and realize that's a import problem but i can't find how to do the import right or what to change on code.

ILMerge error: "try to set ILMergeDebugInfo to false"

I'm using Winforms to make an exe that can open a web page. The following are the dependencies I use:

enter image description here

Then I introduced ILMerge and MSBuild.ILMerge.Task, and then regenerated the project in order to merge these dependencies into the exe, but the following error occurred

Possible reason: some of the merge assemblies have portable PDBs. Try to set lLMergeDebuginfo to false.

ILMerge.Merge: There were errors reported in CefSharp.Core.Runtime's metadata. Unsupported PDB deleted bitset is not empty.

enter image description here

What's happening and how to fix this issue? Or is there any other more reliable way to merge dll into exe?

Visual Studio is not re-generating Resources class anymore

I have a C# WindowsForms application on .net 8. All was fine, but the Resources class is not re-generated anymore when I add, edit or delete strings or images using the designer. I am not aware when exactly this stopped working. There is no appropriate error output or so, when VS should re-generate the class. I already tried to clean and re-build the solution/project, but it has no effect.

Is there a setting or a log to check/change, or is it possible to manually trigger re-generating the Resources class?

Currently running VS 2022 verions 17.9.2

When Intellisense breaks down, how to "reset" it?

I have faced an issue with Intellisense (see below) and my question is, when something similar happens in the future, what is the correct way to "reset" intellisense? To force it forget what it did and redo everything?

I've tried rebuilding the project and restarting Visual Studio, but that didn't helped. And after opening and editing some files of the project the issue suddenly dissappears.

Does intellisense stores some files I can delete after closing VS (I guess deleting .vs folder may do)? Is there a certain operation (e.g. a menu command or performing certain step with project, ide, etc.) which forces intellisense to restart?


Full story.

I've wrote an extension method which overloads extension method from the library. That went well at first, but suddenly in at least one place I noticed, that intellisense behaves, like there were no extension method.

Correct overload:


working


Incorrect overload

not working


I made last screenshot by removing extension method, instead of overload with Func<T, Task> Intellisense shows one with Action<T>. But it is more or less same tooltip Intellisense showed me yesterday with extension method present and working in other places!

It was very confusing and cost me some time. I've copied working code from other place to see what will happens, it worked and then the issue simply disappears.

I don't know what causes the issue nor I was able to reproduce it. It looks to me like some "stale state" of Intellisense, therefore my question.

How to fix build error in Visual Studio: '"LC.exe" exited with code -1'

I get the following error when building my Windows Forms solution:

"LC.exe" exited with code -1

I use two commercial Windows Forms Libraries: Infragistics and the Gantt-Control from plexityhide.com, that's why I have licenses.licx files in my WinForms Projects. We also use Visual Sourcesafe as our Source Control.

When the licenses.licx files are in the Projects I cannot build without the above error. However, when I exclude them from my projects the build works fine. But I need the licenses.licx files when I want to work with the commercial controls in the designer.

This is a brand new developer machine with Windows XP SP3 (German) and Visual Studio 2005 Team Edition for Software Developers (German) with SP1.

It's Windows XP 32-Bit by the way.

Any suggestions?

Cannot run Maui project .net6 in Visual studio 2022 version 17.8.1

I updated visual studio from 17.4 to 17.8.1 When i run my Maui project (using .NET6) It had an error:

C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.509\targets\Microsoft.Android.Sdk.RuntimeConfig.targets(38,5): error MSB4036: The "RuntimeConfigParserTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with in the project file, or in the *.tasks files located in the "C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64" directory.

I reinstalled maui workload and added a global.json

{ "sdk": { "version": "6.0.416", "rollForward": "latestMinor" }

but this error was still occurred.

Note that: i change TargetFrameworks from net6 to net8 in csproj file, it works.

Can anyone help me?

โŒ
โŒ