I want to add "Stimulsoft.Report.dll" as an assembly in my Visual Studio 2015 ASP.Net 5 project.
But the reference manager does not contain the assemblies section with the extentions area(as it is in VS 2013), where i could select "Stimulsoft.Report" and add this to my references.
Is there any solution adding these reference to my ASP.NET 5 project?
you can add the assembly if it available in GAC like below code
"frameworks": {
"aspnet50": {
"frameworkAssemblies": {
"Stimulsoft.Report": ""
}
}
}
in the second part, you can give the version and type of the assembly
In your project.json you can do:
"frameworks": {
"aspnet50": {
"bin": {
"assembly": "<path to dll>",
"pdb": "<path to pdb if needed>"
}
}
}
One workaround is to create a class library project with your 3rd party library reference. Then use a project reference from your website to the class library project.
Edit: Use a traditional class library, not an ASP.Net 5 class library.
(1) Package your assembly with nuget
(2) Follow the #AndersNS answer talking about nuget repository
Related
I am migrating a .Net Framework library to .Net standard and the compiler cannot find the core builders from System.Reflection.Emit.
If I am in the right place then the API documentation states that these builders (MethodBuilder, ModuleBuilder and AssemblyBuilder) are part of System.Reflection.Emit.
This is the project.json for my library:
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable"
},
"dependencies": {},
"frameworks": {
"netstandard1.6": {
"dependencies": {
"NETStandard.Library": "1.6.0"
}
}
}
}
Do I need any additional reference?
You can find them in "System.Reflection.Emit": "4.3.0" nugget package for the netstandard1.6 framework.
The "animalito maquina" answer also worked for me but I have investigated the problem a little bit using netstandard2.0. It might not be relevant to this question but I wanted to share this with you since it still might help others :).
I generated two projects(dotnet new):
"classlib" which uses netstandard2.0 on default
...and "console" which uses the netcoreapp2.0
I added references to AssemblyBuilder class in both projects. The AssemblyBuilder was missing in "classlib" project that has been using netstandard2.0 but was available in "console" project - netcoreapp2.0.
The "problem" is caused by the fact that .NET Core Libraries are actually always a superset of the APIs defined in the corresponding version of the .NET Standard. There are always types and members available in the .NET Core Libraries, which are not (yet?) part of the .NET Standard.
These links might be helpful:
https://github.com/dotnet/standard/tree/master/docs/comparisons
Advantages of netcoreapp2.0 vs netstandard2.0 for a library project
https://github.com/dotnet/standard/blob/master/docs/comparisons/netstandard2.0_vs_netcoreapp2.0/README.md
https://github.com/dotnet/cli/issues/7335
I have a .Net Core Class Library which can be nicely referenced successfully from a .Net Core Console App.
I am trying to reference the class library from a .Net 4.6.2 console app now, and it seems to reference ok, but when I try to instantiate an object from the .Net Core Lib, it can't find it. Oddly enough if I try to add a reference to the DLL directly using the /bin/Debug folder of the .Net Core Class Lib it works...
It also works if I package it up as a nuget package and add it that way. My .Net Core Class Library's project.json is below. You can see the whole solution in ObjectHydrator at https://github.com/PrintsCharming/ObjectHydrator/tree/v2-alpha-1
{
"version": "2.0.0-*",
"dependencies": {
},
"frameworks": {
"net46": {
"dependencies": {
},
"frameworkAssemblies": {
"System.ComponentModel.DataAnnotations": "4.0.0.0"
}
},
"netcoreapp": {
"dependencies": { "System.ComponentModel.Annotations": "4.1.0" },
"imports": "dnxcore50"
}
}
}
Right now it is possible to add dependency to .Net Core Class Library only via Nuget. This is cause the new project templates/.xproj works a bit differently.
Assembly references should be supported directly again with the move to use csproj projects for .NET Core (referencing third party dll's issue)
so i started trying out the new ASP.NET 5 Platform and have the following dependencies in my Project.json
"dependencies": {
"System.Collections": "4.0.10-beta-23019",
"System.Linq": "4.0.0-beta-23019",
"System.Threading": "4.0.10-beta-23019",
"System.Runtime": "4.0.10-beta-23019",
"Microsoft.CSharp": "4.0.0-beta-23019",
"PetaPoco.Core": "5.1.141-beta"
},
"frameworks": {
"dnx451": { "dependencies": { "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta5" } },
"dnxcore50": { "dependencies": { "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta5" } }
}
Everything builds fine but when i try to access anything from the PetaPoco namespace. Everything fails with the message.
The type or namespace PetaPoco could not be found, are you missing a using directive or an assembly reference.
I know what this means but even trying to import the namespace causes the same issue and I can see the library right there in the DNX4.5.1 AND DNX5.0 References
Please what Am i missing here
Thanks in advance
You should be able to use PetaPoco with dnx451. However, you'll need to use the compiled nuget package, as the project structure has changed and the single file deploy won't be copying the source file to a valid location (My guess).
In addition and as per my comment, dnxcore50 (now .Net Core 1.0) is missing a component or two from the ado stack, which means PetaPoco won't work. However, targeting dnx451 should work.
Lastly, we'll mostly likely see PetaPoco builds for .NET/Asp.Net Core 1.0 after they release the RC2.
You are missing that PetaPoco won't work with dnxcore50. Remove the following line to try out ASP.NET5 (or asp.net core as the new name is):
"dnxcore50": { "dependencies": { "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta5
https://github.com/JCKodel/Core.ORM
In the folder __PETAPOCO/XCore there is a functional PetaPoco version that runs on dnxCore. All tests pass.
I've a new asp 5 MVC project wiht rc1- final. It is working. Then I change the framework from
"frameworks": {
"dnx451": { },
to
"frameworks": {
"dnx461": { },
as a result I got the following exception
The current runtime target framework is not compatible with project
I can also see that the current version is 4.5.1
Isn't currently .net4.6.1 supported?
Before the Rc-Final release I was at least able to use .net 4.6.0
?
Is there a way to force the runtimeversion do 4.6.1 ?
Is there anything i'm doing wrong?
It seems it is currently not yet possible to use dnx461. I get the same error with that version. dnx46 and prior versions are working fine.
Before the Rc-Final release I was at least able to use .net 4.6.0 ?
You can target to .net 4.6 now.
For that use:
"frameworks": {
"dnx46": { }
}
About target frameworks we can read here and here
We have to use DNX core 5 and OpenXml, for XLS export, in our app.
It seems like the OpenXml dependency is not supported, according to the error message I got:
Error NU1002 The dependency DocumentFormat.OpenXml 2.5.0 in project does not support framework DNXCore,Version=v5.0. project.json
Here is the part of the project.json associated with the problem:
"frameworks": {
"dnx451": {
"dependencies": { },
"frameworkAssemblies": {
"WindowsBase": "4.0.0.0"
}
},
"dnxcore50": {
"dependencies": {
}
}},
Adding manually the same frameworkAssemblies element to the "dnxcore50" node does not seem to fix the problem.
Removing the "dnxcore50" node makes the app to compile, but this compromises the benefits of dnx Core 5.0 advantages.
This similar question did not properly answer my question :
Open XML in dnx5.0 / aspnext
Does anyone have a solution ?
Unfortunately there is currently no nuget package for the Open Xml SDK.
However, some people are already working on creating such a package:
https://github.com/OfficeDev/Open-XML-SDK/issues/65
Update 24th May.
The community worked for .NET Standard support 😊.
It should work for .NET Core, if not it will be very soon.
Follow the evolution here:
https://dotnet.myget.org/gallery/open-xml-sdk