I thought VS 2013 is supposed to have support for angularjs attribute intellisense? For some reason it's not working for me on the latest version of Microsoft Visual Studio Ultimate 2013 version 12.0.21005.1
Getting the following validation warning:
Attribute 'ng-app' is not a valid attribute of element 'html'.
Attribute 'ng-view' is not a valid attribute of element 'div'.
Am i missing an xsd reference somewhere?
I had the same problem and I did the following and it helped.
If you are using ReSharper, you can add an extension that will give you Intellisense, and won't raise a warning.
Top Menu in VS>Resharper>Extension Manager>Search AngularJS
This will add angular js intellisense.
-------EDIT-------
Using Resharper 8.2.1
I know this is old, but it was still happening for me. To fix it for VS 2013, follow these instructions:
1) Open the file C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Packages\schemas\html\commonHTML5Types.xsd
2) Find the area in the file that starts with this line:
<xsd:attribute name="translate">. Scroll down about 7 lines to find the corresponding closing tag: </xsd:attribute>
3) Just above the </xsd:attributeGroup> closing tag, paste the following lines of code:
<xsd:attribute name="ng-app" vs:category="Angular" />
<xsd:attribute name="ng-bind-html" vs:category="Angular" />
<xsd:attribute name="ng-bind-html-unsafe" vs:category="Angular" />
<xsd:attribute name="ng-bind-template" vs:category="Angular" />
<xsd:attribute name="ng-checked" vs:category="Angular" />
<xsd:attribute name="ng-class" vs:category="Angular" />
<xsd:attribute name="ng-class-even" vs:category="Angular" />
<xsd:attribute name="ng-class-odd" vs:category="Angular" />
<xsd:attribute name="ng-click" vs:category="Angular" />
<xsd:attribute name="ng-cloak" vs:category="Angular" />
<xsd:attribute name="ng-controller" vs:category="Angular" />
<xsd:attribute name="ng-csp" vs:category="Angular" />
<xsd:attribute name="ng-dblclick" vs:category="Angular" />
<xsd:attribute name="ng-disabled" vs:category="Angular" />
<xsd:attribute name="ng-form" vs:category="Angular" />
<xsd:attribute name="ng-hide" vs:category="Angular" />
<xsd:attribute name="ng-href" vs:category="Angular" />
<xsd:attribute name="ng-include" vs:category="Angular" />
<xsd:attribute name="ng-init" vs:category="Angular" />
<xsd:attribute name="ng-list" vs:category="Angular" />
<xsd:attribute name="ng-model" vs:category="Angular" />
<xsd:attribute name="ng-mousedown" vs:category="Angular" />
<xsd:attribute name="ng-mouseenter" vs:category="Angular" />
<xsd:attribute name="ng-mouseleave" vs:category="Angular" />
<xsd:attribute name="ng-mousemove" vs:category="Angular" />
<xsd:attribute name="ng-mouseover" vs:category="Angular" />
<xsd:attribute name="ng-mouseup" vs:category="Angular" />
<xsd:attribute name="ng-multiple" vs:category="Angular" />
<xsd:attribute name="ng-non-bindable" vs:category="Angular" />
<xsd:attribute name="ng-readonly" vs:category="Angular" />
<xsd:attribute name="ng-repeat" vs:category="Angular" />
<xsd:attribute name="ng-selected" vs:category="Angular" />
<xsd:attribute name="ng-show" vs:category="Angular" />
<xsd:attribute name="ng-src" vs:category="Angular" />
<xsd:attribute name="ng-style" vs:category="Angular" />
<xsd:attribute name="ng-switch" vs:category="Angular" />
<xsd:attribute name="ng-transclude" vs:category="Angular" />
<xsd:attribute name="ng-view" vs:category="Angular" />
Save the file and reopen VS2013. This should fix the issue.
I installed http://vswebessentials.com/
created a file called
_reference.js
with content
/// <autosync enabled="true" />
/// <reference path="angular.js" />
/// <reference path="underscore.js" />
I learned about it from The Story Behind _references.js
If you are using ReSharper, try turning off ReSharper IntelliSense for HTML.
ReSharper > Options > IntelliSense > General > Limited ReSharper IntelliSense
Notes:
This does not provide AngularJS intellisense in ASP.NET files
You need to reopen HTML files in VS after the settings have been changed
Current version of ReSharper is 8.2
You could also just run this from the package manager console in VS 2013: Install-Package AngularJS.Intellisense.
Try to tick Text Editor\HTML\General\Auto list members in options.
I know this post is old and the question specifically refers to VS 2013, however if you're still running VS 2010 and want to apply puargs solution you can find the file at C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Packages\schemas\html\html_5.xsd.
You'll want to add puargs' code within the <xsd:attributeGroup name="commonHTML5coreAttributeGroup"> section.
Mads Kristensen also discusses [applying this solution to VS 2012]1 and provides a link to an updated version of 2012's commonHTML5Types.xsd in Step 2.
Also note that both puargs and Mads listings are missing an attribute on ng-view that causes an "attribute name must be followed by an equal (=) sign" warning. The complete element is: <xsd:attribute name="ng-view" vs:category="Angular" vs:standalone="true"/>.
Visual Studio 2013 Update 4 removes the validation, however it does not include IntelliSense for AngularJS.
Support for custom elements, polymer-elements and attributes
We no longer validate unknown attributers for custom elements as there
will be many custom made tags in different frameworks. So there will
no longer be squiggles under the unknown elements.
— Announcing new Web Features in Visual Studio 2013 Update 4 RC
Download Visual Studio 2013 Update 4.
Validation is only removed in the HTML editor, not the HTML (Web Forms) editor. This means that, by default, .html files will not have custom element validation, but .aspx pages will. If, like me, you don't think this makes sense, show your support by voting for custom elements in .aspx files.
Running into the same problem. If you have ReSharper installed on VS 2013 like me, you can get the instellisense by installing the AngularJS plugin (provided by JetBrains).
Here's how to do it:
VS2013 > ReSharper > Manage Extension.
Search "AngularJS" using Nuget online, then click "Install".
The above should get you what you needed. In case you need image guide, here's the link - http://jeeshenlee.com/2014/07/12/how-to-get-angularjs-intellisense-support-on-resharper/
I have not tried with vs2013, but could work. Working with vs2012.
http://madskristensen.net/post/angularjs-intellisense-in-visual-studio-2012
I just disabled resharper intellisense for HTML pages and got angular intellisense back on VS2013
You can also get rid of warnings:
http://madskristensen.net/post/angularjs-intellisense-in-visual-studio-2012
Related
this is the error i am facing while adding the project reference to the .csproj file
, I am developing CRUD using ASP.net core + react js by taking help of microsoft learn here is the link:https://learn.microsoft.com/en-us/visualstudio/javascript/tutorial-asp-net-core-with-react?view=vs-2022
project reference
error i am getting
i am facing this issue can anyone help?
enter image description here
Change your .csproj file like below, the issue could be fixed.
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FootBallManagement_reactjs\FootBallManagement_reactjs.esproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
</Project>
I have set Icon= "icon.ico" in MainWindow.xaml but it does not find it. I got the icon in the final build directory and in project directory. Absolut path works.
My question is: where does the Icon= "icon.ico points to from my xaml file and how to properly reference relative path?
Solved it by adding
<ItemGroup>
<None Remove="icon.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="icon.ico" />
</ItemGroup>
to my .csproj.
We're trying to get set up with Web API 2.2 and OData v4 for ASP.NET + Silverlight 5.
Initiall POC had a Unit Test project connecting using Simple.OData. This worked great. But we've been unable to set up an OData Client on Silverlight 5.
Using Client Code Generator v4 and keep getting error
The type or namespace name 'Client' does not exist in the namespace
'Microsoft.OData' (are you missing an assembly
reference?) C:\Workspaces\GKS\Main\Source\Simutek.Gks\Source\Simutek.Gks.UI.SL.Common\GksODataClient.cs Simutek.Gks.UI.SL.Common
Packages:
<package id="Microsoft.OData.Client" version="6.12.0" targetFramework="sl50" />
<package id="Microsoft.OData.Core" version="6.12.0" targetFramework="sl50" />
<package id="Microsoft.OData.Edm" version="6.12.0" targetFramework="sl50" />
<package id="Microsoft.Spatial" version="6.12.0" targetFramework="sl50" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="sl50" />
References look good and we've also tried AssemblyBinding in app.config:
<dependentAssembly>
<assemblyIdentity name="Microsoft.OData.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.12.0.0" newVersion="6.12.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.OData.Core" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.12.0.0" newVersion="6.12.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Spatial" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.12.0.0" newVersion="6.12.0.0" />
</dependentAssembly>
Update: Indeed, while the Microsoft.OData.Client NuGet package installs on Silverlight it does in fact not specify SL5 in its targets.
I now see that the package only targets
portable-net45+wp8+win8+wpa
So while I can get things going in a PCL project, I can't do so in one targeting Silverlight 5.
Is there a work around, anyone who have achieved this?
You should use one of the PCLs that support Silverlight, two candidates are ODataLib (Microsoft.OData.Core) and Simple.OData.Client, the latter is built on the top of ODataLib. None of them supports class generation but it shouldn't be a big deal to roll your own.
Silverlight does not support the code generated by Microsoft's OData v4 Client Code Generator visx (OData Client T4), but no one's forcing you to use generated code.
Simply use the lib of your choice to create a connection to the OData service and reuse your own types (business objects).
This is really weird. In Blend 4, the custom font works when I see the application in the designer, but when I run it, the font is gone and it goes back to arial or something. This is my XAML:
<TextBlock Text="Text G" FontFamily="/ProjectName;component/Fonts/#Futura Lt BT" FontSize="48" Background="#FFC44747" />
The font is in a folder called "Fonts" and the control in which I'm trying the font is in a folder called "Controls". I know it must be a problem with the relative position of the "Fonts" folder to the "Controls" folder, but I've already tried a lot of stuff and it doesn't work.
Also, the XAML markup I put up there is what Blend creates when I select the custom font. The font is copied as a resource all right (I already check the csprof file and it's there).
Any ideas? This has been kicking my butt for a couple hours now.
Thanks.
While I understand that this is far too late to help the question author, I am leaving this to help future viewers of this question.
The information in this answer comes from the Packaging Fonts with Applications page on MSDN:
Adding Fonts as Content Items
You can add fonts to your application as project content items that are separate from the application's assembly files. This means that content items are not embedded as resources within an assembly. The following project file example shows how to define content items.
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Other project build settings ... -->
<ItemGroup>
<Content Include="Peric.ttf" />
<Content Include="Pericl.ttf" />
</ItemGroup>
</Project>
In order to ensure that the application can use the fonts at run time, the fonts must be accessible in the application's deployment directory. The element in the application's project file allows you to automatically copy the fonts to the application deployment directory during the build process. The following project file example shows how to copy fonts to the deployment directory.
<ItemGroup>
<Content Include="Peric.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Pericl.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
Adding Fonts as Resource Items
You can add fonts to your application as project resource items that are embedded within the application's assembly files. Using a separate subdirectory for resources helps to organize the application's project files. The following project file example shows how to define fonts as resource items in a separate subdirectory.
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Other project build settings ... -->
<ItemGroup>
<Resource Include="resources\Peric.ttf" />
<Resource Include="resources\Pericl.ttf" />
</ItemGroup>
</Project>
When you add fonts as resources to your application, make sure you are setting the element, and not the element in your application's project file. The element for the build action is not supported.
The following markup example shows how to reference the application's font resources.
<TextBlock FontFamily="./resources/#Pericles Light">
Aegean Sea
</TextBlock>
Please follow the above link for details on referencing Font resources from code and other useful information.
Everywhere over the internet and in books it says that when you add a font you should set the Build Action to "Resource" (example here). And it 'worked for a while. Anyway, to fix my problem, I had to change it from "Resource" to "Content".
I am using: Silverlight Version 4.0, 100% F# solution. I am having an issue when switching the Target Configuration from debug to release. Everything compiles fine in debug mode, then in release I get the following:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9):
warning MSB3245: Could not resolve
this reference. Could not locate the
assembly
"System.ComponentModel.DataAnnotations".
Check to make sure the assembly exists
on disk. If this reference is required
by your code, you may get compilation
errors.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9):
warning MSB3245: Could not resolve
this reference. Could not locate the
assembly
"System.Windows.Controls.Data.Input".
Check to make sure the assembly exists
on disk. If this reference is required
by your code, you may get compilation
errors.
The Item group in the project file lokos like:
<ItemGroup>
<Reference Include="FSharp.PowerPack">
<HintPath>C:\Program Files\FSharpPowerPack-2.0.0.0\Silverlight\v3.0\FSharp.PowerPack.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="FSharp.Core">
<HintPath>$(ProgramFiles)\Microsoft F#\Silverlight\Libraries\Client\$(SilverlightVersion)\FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Net" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Windows" />
<Reference Include="System.Windows.Browser" />
<Reference Include="System.Windows.Controls">
<HintPath>bin\Debug\System.Windows.Controls.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Controls.Data">
<HintPath>bin\Debug\System.Windows.Controls.Data.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Controls.Data.Input" />
<Reference Include="System.Windows.Controls.DataVisualization.Toolkit">
<HintPath>bin\Debug\System.Windows.Controls.DataVisualization.Toolkit.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Controls.Input">
<HintPath>c:\Program Files\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\System.Windows.Controls.Input.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Controls.Layout.Toolkit">
<HintPath>bin\Debug\System.Windows.Controls.Layout.Toolkit.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Controls.Navigation">
<HintPath>bin\Debug\System.Windows.Controls.Navigation.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Controls.Toolkit">
<HintPath>bin\Debug\System.Windows.Controls.Toolkit.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Data">
<HintPath>bin\Debug\System.Windows.Data.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
</ItemGroup>
Obviuosly some Elements have HintPaths while others do not, and while some have hintpaths there appear to be absolute and relative paths...
Can anybody help me out? Thanks in advance.
OK so I removed the references and then readded them and they came into the project file in the format of:
c:\Program Files\Microsoft
SDKs\Silverlight\v4.0\Libraries\Client\System.ComponentModel.DataAnnotations.dll
for both of the references. It all compiles - in both versions. Any hint on th HintPaths? How they are used and how and when they are generated? And why when I tried to modify the proj file by hand it didn't seem to matter (still didn't compile even though VS told me it reloaded)?
Thx
Sounds like you moved the project from another machine and you don't have the Silverlight Toolkit and the WCF RIA Services installed on your machine.
Clean your solution, close your Visual Studio and install what's missing.
FYI, there is a bug in the shipped Microsoft.FSharp.targets that may interact with this. You can add this line
<FrameworkRegistryBase Condition="'$(TargetFrameworkIdentifier)'=='Silverlight'">Software\Microsoft\Microsoft SDKs\$(TargetFrameworkIdentifier)</FrameworkRegistryBase>
inside a <PropertyGroup> (just below the <Tailcalls> element is a good spot) inside Microsoft.FSharp.targets to fix it. I don't know if this relates to your problem (it sounds like it may not), but just a heads-up in case.
(The fact that you get a HintPath (even if you do things right) may also be the result of a bug in the F# project system.)
One possible strategy if you need a workaround is to check in a copy of DLLs you need to reference in a fixed spot (relative to your projects) under source control, and then reference those DLLs via the 'fixed' relative paths.