You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PackageReferences, like other kinds of References, point towards one or more underlying assemblies. Publicizing these assemblies is just a matter of finding out what the underlying assemblies are called, and then specify them the same way as above.
58
+
59
+
Below is an example of publicizing two assemblies from the package [Krafs.Rimworld.Ref](https://www.nuget.org/packages/Krafs.Rimworld.Ref/):
You can use this shorthand property to publicize all assemblies referenced by the project:
@@ -62,13 +76,16 @@ You can use this shorthand property to publicize all assemblies referenced by th
62
76
</PropertyGroup>
63
77
```
64
78
65
-
Save the project file and the changes should take effect shortly.
79
+
Save the project file and the changes should take effect shortly. If not, try performing a _Restore_.
66
80
67
81
## How Publicizer works
68
82
Publicizer works by copying the referenced assemblies into memory, rewriting the access modifiers to public, and feeding those assemblies to the compiler instead of the real ones.
83
+
Publicized assemblies are cached in _obj_ for future builds.
69
84
70
85
Additionally, the project's assembly is compiled as [unsafe](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/unsafe-code/). Among other things, this tells the runtime to not enforce access checks. Without this, accessing an unpermitted member at runtime throws a [MemberAccessException](https://docs.microsoft.com/en-us/dotnet/api/system.memberaccessexception/).
71
86
87
+
This means that you do **NOT** have to specify _AllowUnsafeBlocks=true_ in your project file. Publicizer does this for you under the hood.
88
+
72
89
By default, Publicizer additionally creates the new assemblies as [reference assemblies](https://docs.microsoft.com/en-us/dotnet/standard/assembly/reference-assemblies/).
73
90
This reduces build times and memory usage. However, if you use your IDE's decompilation feature to inspect code, you may want to turn that off, or you will just see empty methods.
74
91
Do that by specifying this property:
@@ -78,7 +95,7 @@ Do that by specifying this property:
78
95
</PropertyGroup>
79
96
```
80
97
## Acknowledgements
81
-
Project builds upon rwmt's [Publicise](https://github.com/rwmt/Publicise), simplyWiri's [TaskPubliciser](https://github.com/simplyWiri/TaskPubliciser), and [this gist](https://gist.github.com/Zetrith/d86b1d84e993c8117983c09f1a5dcdcd) by Zetrith
98
+
This project builds upon rwmt's [Publicise](https://github.com/rwmt/Publicise), simplyWiri's [TaskPubliciser](https://github.com/simplyWiri/TaskPubliciser), and [this gist](https://gist.github.com/Zetrith/d86b1d84e993c8117983c09f1a5dcdcd) by Zetrith.
0 commit comments