I started using aurelia framework with Vs2015 and MVC.
Below is my implementation process
Created new project with MVC in VS 2015.
Copied all files except wwwroot inside skelton-es2016-asp.net5 from aurelia-skelton project from github.
Later added all bootstarp and jquery plugin inside script and added in bundleconfig.cs
Open command prompt from folder and jspm install,
Then jspm install aurelia-framework,
Then jspm install aurelia-bootstrapper
Finally attached to IIS and browse.
But I am getting 404 not found with core-js#1.2.6 js. Below is my screen.
Also below is my VS structure
Make sure you have installed core-js through JSPM. Add the dependency to your package.json.
package.json
"jspm": {
"dependencies": {
"core-js": "npm:core-js#1.2.6"
}
}
Then type jspm install in the command line.
Related
Certificate configured as per the guide-line. We are able to generate build without razor class library. When we try to generate build with razor class getting below error.
dotnet\sdk\6.0.400-preview.22301.10\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResoluti
on.targets(267,5): error NETSDK1005: Assets file '\Razo
rClassLibrary\obj\project.assets.json' doesn't have a target for 'net6.0-android'. Ensure that restore has run and that
you have included 'net6.0-android' in the TargetFrameworks for your project. [C:/RazorClassLibrary\RazorClassLibrary.csproj]
Tried with below options
Removed obj folder
Restore Nuget Package
Visual Studio update
MSBuild update
Added <RuntimeIdentifier>android-arm64</RuntimeIdentifier>
Spending more than two days, Really appreciate any guide to resolve this issue.
I suggest you try this
In Library project .csproj replace TargetFramework by plural -> <TargetFrameworks>net6.0;net6.0-android</TargetFrameworks>
In App project .csproj, I set android to API21, in my case with API31 didn't work.
In App project, right click, properties, Go to Android / Options / Package Sign, and complete complete info from keystore
I am starting a tutorial about C# and, unfortunely, my PC can't handle Visual Studio, so a friend of mine recommended me Visual Studio Code, because it's a lot more light. I installed it, I installed the .NET Core SDK and the C# extension powered by OmniSharp, and after that, I created a folder in my Desktop, then I created my "file.cs" in that folder (inside VS Code), and I had written a really simple "Hello World" program inside it. And when I tried to run it without debugging, it asked me to select an enviroment, and I selected ".NET Core". It created another folder inside my project folder called ".vscode" and inside that folder it created a file called "laucnh.json" that contains the following code:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": []
}
After that, an error message appears on the bottom right corner of the screen and says "Cannot create .NET debug configurations. The OmniSharp server is still initializing or has exited unexpectedly.", but I think that I installed everything correctly. Am I missing something?
You can not run a file in C#. Try create a new console application with
dotnet new console
A {projectName}.csproj and and Program.cs will appear. Put your code into the Main method of the Program class and it will probably work
https://learn.microsoft.com/en-us/dotnet/core/tutorials/cli-create-console-app
Use dotnet new console to create a new project in C#
This will create a .vscode folder in the directory
Create a tasks.json file
Create a Launch.json file and add configurations
I had a ASP.net 4.5 webAPI that worked well that was located in C:\users\me\source\MyProject .
I then needed to push this project to a new Git Repo in Visual studio online.
to push it there I did the following
git remote add origin https://my-cool-webAPI.visualstudio.com/DefaultCollection/_git/MYcoolProject
git push -u origin --all
Everything appeared to be fine.
So i then cloned this project from the Visual Studio Online TFS Git repo to a new source directory.
It was in C:/users/me/source/MyProject and I moved it to C:\Users\me\Desktop\Source\MyProject
Now I have 166 errors and 166 warnings complaining about assembly references.
Here is more detail on a specific error.
Any idea what I did wrong?
** it looks like my references are out of wack, Notice it doesnt know the path to find Entity-Framework.
Is this because I didnt check in the Packages folder or something else
How do I refresh them? and How does one ensure they make it to source control, ie are they managed by a certain file similar to say a Rails Gemfile?
Currently I am doing the following steps to try and run my WebAPI that had no errors before I moved it to this new repo.
Clean the solution (that succeeds)
Build the solution (166 errors and 166 warnings)
Bateloche was on the money with his comments
In order to fix this I had to do the following.
I had to delete my packages folder.
Make sure your packages folder wasnt checked in by default its in the gitignore file that visual studio by defuault generates so it shouldnt be check in.
in VS goto Tools -> NuGet Package Manager -> settings and enabable Nuget to download missing packages.
Make sure to open the package manager console and click accept to refresh the nuget packages. The gotcha was that you may have to restart visual studio for this to work
I have a Windows Azure project consisting of
ASP.NET project (using NancyFX) deployed as Azure Website
Business Logic class library
Unit test class library
2 Console apps
I want those 2 console app to be deployed as Azure WebJobs with the Azure Website. So I right clikec on the ASP.NET project and chose Add | Existing project as Azure WebJob and added both console apps with the right schedule.
Everything seems fine, the 2 console apps now contain a JSON with schedule and the ASP.NET project contains a JSON with WebJobs definition. All the project build just fine.
The problem is, when I try to deploy the ASP.NET project to Azure, I get
The target “ResolveWebJobFiles” does not exist in the project
I found this article when the author solved this problem by adding
<Import Project="..\packages\Microsoft.Web.WebJobs.Publish.1.0.2\tools\webjobs.targets" Condition="Exists('..\packages\Microsoft.Web.WebJobs.Publish.1.0.2\tools\webjobs.targets')" />
to his csproj file, but my csproj file for the ASP.NET project already contains this import.
Any ideas what the problem is?
even i faced this issue. I reinstalled the below package in my webjob to solve it
package id="Microsoft.Web.WebJobs.Publish" version="1.0.2"
Check to see if you have this file in your webjob project Properties folder:
webjob-publish-settings.json
If not, create it with this content, changing only the webJobName (for now)
{
"$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json",
"webJobName": "MyWebJobName",
"startTime": "2014-12-09T00:00:00-08:00",
"jobRecurrenceFrequency": "Hour",
"interval": 1,
"runMode": "Scheduled",
"stopping_wait_time": 3600
}
One primary reason could be missing "webjob-publish-settings.json" file in Properties.
Please double check this file exists and included in your project.
in my case it was this file, which had 1 invalid webjob associated with it, removed it and it started working
webjobs-list.json
I also ran into this. After updating all packages in my solution I started to get this. The <import /> was there but it was poiting to a different version. So check that too.
Also worth checking is the .net version of the WebJob project vs your Web app!
As stated in the documentation
A WebJobs-enabled project has the following items added to it:
- The Microsoft.Web.WebJobs.Publish NuGet package.
- A webjob-publish-settings.json file that contains deployment and scheduler settings.
it clearly says the project that needs to have a reference to Microsoft.Web.WebJobs.Publish Nuget package is the Webjob-enabled project application, not the web application. The web application only needs webjobs-list.json file.
The webjob console application also may have a webjob-publish-settings.json file
but only in case of non continuous jobs
I got this error recently and found the cause to be that [WebProject]/Properties/webjobs-list.json contained a reference to an old webjob that had been deleted from the solution. Deleting the reference from the json fixed the problem.
In Kudu (under "Advanced Tools" on your web app management page, under "Development Tools"), under "Debug console", select "Powershell", then navigate to the "site" folder, then the "repository" folder.
Enter the command "dotnet restore" at the command line, then redeploy.
Edit: Still works as of 26/01/2022.
I am trying to use SpecsFor MVC for automated acceptance testing and I have noticed that it is not building / publishing project correctly on Visual Studio 2012 and hence IIS Express is not running, ending in a 'Page cannot be displayed' message throughout the automated acceptance test.
To take you through all my tests to get this working, initially, when trying to run the automated tests, I was getting a 'Build Failed' message when running
_host = new SpecsForIntegrationHost(config);
_host.Start();
. After loading the SpecsFor MVC source code, I have noticed that the error was because the MSBuild.exe process was failing and the output message was being written to Console.Output. After checking the output, I have noticed that the error was that the Microsoft.WebApplication.targets was not found. After some research, I found the below:
External VS2013 build error "error MSB4019: The imported project <path> was not found"
The one with most votes spoke about removing the <PropertyGroup> node from the .csproj which after removing it, the MSBuild.exe was not exiting with an error code as it only had warnings which still resulted in the project not being built & published correctly. SpecsFor MVC in this case treated this scenario as successful and proceeded with launching IIS Express but since the project was not built successfully, the acceptance tests resulted in another Page Cannot Be Displayed message as IIS Express was not running correctly.
After some further research, I found v11.0\WebApplications\Microsoft.WebApplication.targets was not found when file actually references v10 which outlined that VS 2012 has a new different MSBuild.exe file located in C:\Program Files (x86)\MSBuild\12.0\Bin.
Now the issue is that within the SpecsFor MVC IISTestRunnerAction.PublishSite() method, the path of the MSBuild.exe is being loaded through
System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() which in my case is outputting C:\Windows\Microsoft.NET\Framework64\v4.0.30319\. Changing this manually to C:\Program Files (x86)\MSBuild\12.0\Bin solved the issue and project was built & published successfully.
My final question is: Is there a way where one can change the value of System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() so that I wouldn't need to update the source of the SpecsFor MVC project?
Thanks in advance for any help!
As of SpecsFor.Mvc 3.2.0-rc01 (still a preview release as of right now), you can configure the path to MSBuild like so:
var config = new SpecsForMvcConfig();
config.UseIISExpress()
.With(Project.Named("SpecsFor.Mvc.Demo"))
.CleanupPublishedFiles()
//Set the full path to MSBuild.exe here!
.UseMSBuildExecutableAt(#"C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild.exe")
.ApplyWebConfigTransformForConfig("Test");
To understand how these ".targets" files are organized in Visual Studio is a challenge. I don't know nothing about this SpecsFor MVC works, but if you put the right ".targets" file in it's path, it should work. By your question, I understand that SpecsFor invokes MSBuild internally.
It's a similar problem when you install a new build machine, and a lot of Visual Studio componentes are missing. Not all of them are deployed with the framework. Some comes with Visual Studio separated installers other with specific componentes.
I didn't find an specific installer that deploys this needed file. I just found the MSBuild 2012 installer (http://www.microsoft.com/en-us/download/details.aspx?id=40760), and I don't know if it deploys the previous version .targets.
And also you can try the ASP.NET MVC installer for your specific version.
Another approach is try to find a parameter in SpecsFor to see which version of MSBuild it is invoking. Probably if it uses the version in Program Files\v12, it should work.