Giter Site home page Giter Site logo

Comments (26)

SailleshPawar avatar SailleshPawar commented on July 18, 2024

Any update on the issue?

from aspnet-helper.

schneiderpat avatar schneiderpat commented on July 18, 2024

The latest builds didn't produce any errors. I published version 0.6.2 a few minutes ago.
I hope I can get any feedback :)

from aspnet-helper.

SailleshPawar avatar SailleshPawar commented on July 18, 2024

Hi @schneiderpat
It works but I want to ask you do you have any dependency on _ViewImports.cshtml file.
If I am building a project from scratch and I am not using tag helpers do I need to create the _ViewImports cshtml in order to use Intellisense on the view because it doesn't works than i am trying to figure out why?

from aspnet-helper.

SailleshPawar avatar SailleshPawar commented on July 18, 2024

I figured out if don't put
@model ClasssName to the top line the IntelliSense won't work.
You can try the same.

Appreciate your hard work and will surely share and blog about it.

from aspnet-helper.

schneiderpat avatar schneiderpat commented on July 18, 2024

Hi @SailleshPawar
Let me know if you´re done with your blog! I would like to read it :D

from aspnet-helper.

karabaja4 avatar karabaja4 commented on July 18, 2024

I am still having issues :(

This is an example of one of my views. The property that the extension says it's missing does exist:
http://take.ms/QZXGg

Also intellisense for Model doesn't seem to work for me anymore:
http://take.ms/1mUl1

from aspnet-helper.

SailleshPawar avatar SailleshPawar commented on July 18, 2024

@karabaja4 Hi make sure you have updated to the latest update.

from aspnet-helper.

karabaja4 avatar karabaja4 commented on July 18, 2024

@SailleshPawar I am using latest - vscode 1.10.1 (released yesterday) and ASP.NET helper 0.6.2.

from aspnet-helper.

SailleshPawar avatar SailleshPawar commented on July 18, 2024

@karabaja4 Share the _ViewImports.cshtml code

from aspnet-helper.

SailleshPawar avatar SailleshPawar commented on July 18, 2024

@schneiderpat It's dependent on _ViewImports.cshtml. I am trying to play with it, it seem like this to me. Can you please elaborate on the same.

from aspnet-helper.

karabaja4 avatar karabaja4 commented on July 18, 2024
@using app.Portal.ViewModels.Admin
@using app.Portal.ViewModels.Controls
@using app.Portal.ViewModels.Databases
@using app.Portal.ViewModels.Home
@using app.Portal.ViewModels.Static
@using app.Portal.ViewModels.Controls.Utils
@using app.Base.Platform

@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers"

The model in my screenshots is in namespace "app.Portal.ViewModels.Controls".

from aspnet-helper.

SailleshPawar avatar SailleshPawar commented on July 18, 2024

@karabaja4 latest version seems to be 0.6.0

from aspnet-helper.

schneiderpat avatar schneiderpat commented on July 18, 2024

Are your models stored in a ViewModels or Models folder?

Latest version is 0.6.2

from aspnet-helper.

karabaja4 avatar karabaja4 commented on July 18, 2024

@schneiderpat Models are stored in ViewModels.

from aspnet-helper.

schneiderpat avatar schneiderpat commented on July 18, 2024

Can you post your model?

from aspnet-helper.

karabaja4 avatar karabaja4 commented on July 18, 2024

@schneiderpat

using Newtonsoft.Json;

namespace app.Portal.ViewModels.Controls
{
    public class IconAndLabelModel: IViewModel
    {
        [JsonIgnore]
        public string LeftIconClass { get; set; } = null;

        [JsonIgnore]
        public string Text { get; set; } = null;

        [JsonIgnore]
        public string RightIconClass { get; set; } = null;
    }
}

from aspnet-helper.

schneiderpat avatar schneiderpat commented on July 18, 2024

The problem might be your interface or your default values. At the moment just simple classes are supported to provide IntelliSense.

from aspnet-helper.

karabaja4 avatar karabaja4 commented on July 18, 2024

@schneiderpat I get the same result if I remove the interface and default values.

I will try to put together a sample project for you so you can try and reproduce it from there.

from aspnet-helper.

schneiderpat avatar schneiderpat commented on July 18, 2024

That would be the best! Thanks for your help at this issue! I´m sorry you´re facing it!

from aspnet-helper.

SailleshPawar avatar SailleshPawar commented on July 18, 2024

@karabaja4 That would be best.

from aspnet-helper.

SailleshPawar avatar SailleshPawar commented on July 18, 2024

Guyz are you using project.json or latest .csproj file?

from aspnet-helper.

schneiderpat avatar schneiderpat commented on July 18, 2024

I´m using .csproj but project.json should be supported too

from aspnet-helper.

SailleshPawar avatar SailleshPawar commented on July 18, 2024

I updated VS code just now seems like IntelliSense for project.json for dependencies is not coming. :(
extension is working fine no doubt with latest 0.6.2 (y)

from aspnet-helper.

schneiderpat avatar schneiderpat commented on July 18, 2024

project.json is marked as deprecated, maybe they removed IntelliSense from it

from aspnet-helper.

SailleshPawar avatar SailleshPawar commented on July 18, 2024

@schneiderpat Thanks for the update. Need to upgrade :D

from aspnet-helper.

karabaja4 avatar karabaja4 commented on July 18, 2024

I think I figured it out. This is the test project:

https://www.dropbox.com/s/myxn3l3cq3zsl09/app.zip?raw=1
(to start the project, run "dotnet restore" and "dotnet run" in app.portal folder)

You can see the problem in "MyView.cshtml" file.
In short, it seems that if the first entry in "_ViewImports.cshtml" is something that is not used in the view, the view displays an error.

Also please note that there seem to be two separate issues here: one is that the razor view linter complains about missing properties, and the other are errors when hovering over properties:

[Error - 21:20:38] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot read property 'type' of undefined
  Code: -32603 

from aspnet-helper.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.