-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scenario: enable references to any assembly on disk #120
Comments
We should get this fixed when we are ready to support .NET Standard 2.0. People will want to reference lots of libraries that shipped well before NuGet was a thing and we should get out of their way :) |
It needs to happen sooner than that. People already want to reference .net standard 1.3 dlls in .net core web apps. The use case is an internal library of utilities or a client library for a rest service that is used in multiple client libraries and websites. You don't want the actual projects cross loaded across repos because that causes continuous deploy issues. Instead you'll use a libs folder in each project and reference them. (And this is still broken in the latest VS.net 2017 RC with csproj in all but the trivial case. As soon as there are any nuget dependencies like json.net it fails) |
This is still broken in VS.NET 2017 RC3 FYI. |
This scenario breaks MVC applications. Aka, if a user attempts to utilize a referenced assembly from disk in their View the view fails to compile because the deps.json doesn't have an entry for the referenced assembly. Looks like there's a decent amount of feedback from the community around this: https://developercommunity.visualstudio.com/content/problem/17274/razor.html |
While I do appreciate the need for AssemblyReferences for backwards compatibility, I hope we're able to do something that discourages usage moving forward. It's really hard to figure out what flavor of a given assembly to use in a lot of cases [consider multiple RIDs, multiple TFMs] and I'm very nervous that folks will get really frustrated when trying to carry over their already-well-known usage patterns. |
Its not just backwards compatibility. We can't expect that everything is going to be put into a nuget package to be shared. For pure IL .NET Standard libraries, there shouldn't be any RID/TFM concerns. For people that just want to ship a flat folder of assemblies in an sdk, they should be able to tell people to reference them. |
Adding <Reference> items to existing assemblies into the .deps.json file so the host knows to read these assemblies at runtime. Fix dotnet#120
I'm getting this problem, but only when trying to run unit tests in Visual Studio that exercise code paths that render views such as described under Accessing Views in this testing documentation. |
Turns out the simple fix was to set |
Will a fix be ready for your shipment of VS 2017 in early march?! |
Unfortunately, no. The fix will come as part of ".NET Core 2.0", which is after VS 2017 RTMs. |
Thank you @eerhardt , for the reply. When you write ".NET Core 2.0", does that mean we are forced to upgrade our projects that are co-compatible with .NET 4.6.1 and .NET Platform Standard 1.4? Because that is a no-go for me :-/ |
No, this doesn't mean you will have to upgrade to 2.0. The reason this feature comes as part of ".NET Core 2.0" is because:
|
Thank you for the excellent news, @eerhardt. Keep up the good work 👍 |
Nearly everyone I talked to (mostly on slack) who wanted to "just reference an assembly" would run into type-forwarder/facade-hell without having the right packages in the graph to resolve conflicts. So I agree with @piotrpMSFT that the use of assembly references should be discouraged.
Maybe it is enough to just document how to make use of that to wrap dlls into local nuget packages that live in the same GIT repository and don't require to set up a nuget server/feed. |
Adding <Reference> items to existing assemblies into the .deps.json file so the host knows to read these assemblies at runtime. Fix dotnet#120
So, is the problem fixed? I still sometimes get runtime errors like: "System.IO.FileNotFoundException: Could not load file or assembly '...'. The system cannot find the file specified" for the DLLs that I reference directly from the disk. |
@Metamorphus - yes this problem is fixed. If you are having problems, please open a new issue with your .csproj and which version of the .NET Core SDK you are using (by copying the output of |
Also, please set |
Please re-open this as dotnet pack does not work |
@rohit21agrawal - is there an existing issue for this scenario? or should @los93sol open a new one in NuGet/Home? |
what about dotnet pack does not work? could you please elaborate? |
remove internal from GetSupportedAttributes
Moving the Regex escape logic to CreateParameters
* Add support for Labels in metadata, fixes dotnet#95 Co-authored-by: Chet Husk <chusk3@gmail.com>
.NET Core projects never supported referencing an assembly sitting on disk. MSBuild support this more naturally.
To enable this we need to ensure:
The text was updated successfully, but these errors were encountered: