0

I am having a few issues at the moment building my application. I can run dotnet restore, but once I run dotnet build or run it mentions:-

The current project is not valid because of the following errors:- dir/project.json(35, 15): error DOTNET1012: The reference assemblies directory was not specified. You can set the location using the DOTNET_REFERENCE_ASSEMBLIES_PATH environment variable.

Does anybody know how to set this or have they seen this issues before?

Thanks in advance!

Project.Json

{
"dependencies": {
"Bitly.Net": "0.0.6",
"BitlyAPI": "1.0.3",
"BundlerMinifier.Core": "2.2.281",
"Common.Logging": "3.4.0-Beta2",
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.1",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.AspNetCore.Routing": "1.0.1",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
"Parse": "1.7.0",
"Spring.Social.Twitter": "2.0.0-M1",
"Stormpath.AspNetCore": "0.7.0"
  },

 "tools": {
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
  },

 "frameworks": {
"net452": {
"dependencies": {
}
}
},

"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},

"publishOptions": {
"include": [
"wwwroot",
"**/*.cshtml",
"appsettings.json",
"web.config"
]
  },

"scripts": {
"prepublish": [ "bower install", "dotnet bundle" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% -    -framework %publish:FullTargetFramework%" ]
  },
  "userSecretsId": "aspnet-ParseAppDashboard-201610080811**"
   }

Environment Details

.Net Command Line Tools (1.0.0-preview2-003131)

Product Information: Version 1.0.0-preview2-003131

Runtime Environment: OS Name: ubuntu OS Version: 14.04 OS Platform: Linux RID: ubuntu.14.04-x64

Phill Wiggins
  • 2,577
  • 4
  • 28
  • 33

1 Answers1

0

Because you use .net framework 4.5.2 on Linux, so you will need to install Mono first, and then set the DOTNET_REFERENCE_ASSEMBLIES_PATH environment variable to /usr/lib/mono/xbuild-frameworks.

  • Is Kestrel not a suitable option for this? – Phill Wiggins Oct 14 '16 at 13:47
  • Sorry, just figured that it is installed. How do I actaully set DOTNET_REFENCE_ASSEMBLIES_PATH - Is that a field in Project.Json or? Sorry I'm very new to ASP.NET – Phill Wiggins Oct 14 '16 at 13:49
  • Kestrel is used by asp.net core. However, in your Project.Json, you use "frameworks": { "net452" } due to dependencies like Bitly.Net which does not support asp.net core yet. – Infini Axis Oct 14 '16 at 13:50
  • 1
    First of all, find out where Mono is installed, is it /usr/lib/mono/xbuild-frameworks? Setting an environment variable is done by editing `~/.profile`. Or in bash you can set variables like this: `export DOTNET_REFENCE_ASSEMBLIES_PATH=/usr/lib/mono/xbuild-frameworks`. You can check [here](http://askubuntu.com/questions/730/how-do-i-set-environment-variables) or [here](https://help.ubuntu.com/community/EnvironmentVariables). – Infini Axis Oct 14 '16 at 13:56
  • So that did get rid of that error. I'm just receiving an error saying framework 4.5.2 is missing but I'm sure I'll find something online for that. Thanks for your help! – Phill Wiggins Oct 14 '16 at 17:55