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
I'm getting this error when running the sample project.
I upgraded to ExcelDna 1.6.0 as well with no luck.
When running the packed version it seems to work fine.
However, while debugging, launching the unpacked version I get the error below.
ExcelDna.Integration Warning: 1 : Assembly SYSTEM.RUNTIME.COMPILERSERVICES.UNSAFE could not be loaded from resources.
ExcelDna.Integration Error: 1 : DnaLibrary AutoOpen Error : TargetInvocationException - Exception has been thrown by the target of an invocation.
Also, when running the packed version, I get this error when closing excel:
Managed Debugging Assistant 'LoaderLock'
Attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang.
To be honest I'm not really sure if this is an ExcelDna issue or an issue that is caused by this package.
This is my csproj:
<ProjectSdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<ExcelAddInExplicitRegistration>true</ExcelAddInExplicitRegistration>
<ExcelDnaAllowPackageReferenceProjectStyle>true</ExcelDnaAllowPackageReferenceProjectStyle>
<!-- We don't need the extra 'ref' directory and reference assemblies for the Excel add-in -->
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<!-- We need all dependencies to be copied to the output directory, as-if we are an 'application' and not a 'library'. This property also sets the CopyLockFileAssemblies property to true. -->
<EnableDynamicLoading>true</EnableDynamicLoading>
<!-- Enables cross-platform resource packing implementation when executing on Windows. --><!-- Default value: false -->
<ExcelDnaPackManagedResourcePackingOnWindows>true</ExcelDnaPackManagedResourcePackingOnWindows>
<!-- Enables packing native libraries from .deps.json. --><!-- Default value: true -->
<ExcelDnaPackNativeLibraryDependencies>true</ExcelDnaPackNativeLibraryDependencies>
<!-- Enables packing managed assemblies from .deps.json. --><!-- Default value: true -->
<ExcelDnaPackManagedDependencies>true</ExcelDnaPackManagedDependencies>
</PropertyGroup>
<ItemGroup>
<PackageReferenceInclude="ExcelDna.AddIn"Version="1.6.0" />
<PackageReferenceInclude="ExcelDna.Integration"Version="1.6.0" />
<PackageReferenceInclude="ExcelDna.IntelliSense"Version="1.6.0" />
<PackageReferenceInclude="ExcelRna.Extensions.Hosting"Version="1.0.5" />
<PackageReferenceInclude="Microsoft.Extensions.Hosting"Version="7.0.1" />
<PackageReferenceInclude="Microsoft.Extensions.Logging.TraceSource"Version="7.0.0" />
<PackageReferenceInclude="System.Runtime.CompilerServices.Unsafe"Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<ReferenceInclude="System.Windows.Forms" />
</ItemGroup>
<TargetName="ExcelDnaIncludeReferences"DependsOnTargets="ExcelDnaBuild"BeforeTargets="ExcelDnaPack">
<!-- read existing content -->
<XmlPeekXmlInputPath="%(ExcelDnaFilesToPack.OutputDnaFileName)"Query="//*[local-name()="DnaLibrary"]/*">
<OutputTaskParameter="Result"PropertyName="Peeked" />
</XmlPeek>
<!-- find all dependencies -->
<ItemGroup>
<ExcelDnaReferencesInclude="@(ReferenceCopyLocalPaths->'<Reference Path="%(Filename)%(Extension)" Pack="true" />')"Condition="'%(Extension)' == '.dll'" />
</ItemGroup>
<!-- combine existing content with the required dependencies -->
<PropertyGroup>
<ExcelDnaReferencesXml>@(ExcelDnaReferences)</ExcelDnaReferencesXml>
<ConcatenatedNodes>$(Peeked.Replace(";",""))$(ExcelDnaReferencesXml.Replace(";",""))</ConcatenatedNodes>
</PropertyGroup>
<!-- update .dna file -->
<XmlPokeValue="$(ConcatenatedNodes)"XmlInputPath="%(ExcelDnaFilesToPack.OutputDnaFileName)"Query="//*[local-name()="DnaLibrary"]">
</XmlPoke>
<MessageText="Patched %(ExcelDnaFilesToPack.OutputDnaFileName)."Importance="High" />
</Target>
</Project>
The text was updated successfully, but these errors were encountered:
I haven't tested with ExcelDna 1.6 yet, so it's possible that some things may not work as expected.
I can confirm the issue related to SYSTEM.RUNTIME.COMPILERSERVICES.UNSAFE. As a workaround I am using packed version for debugging, but I never encountered LoaderLock errors before. Does it happen with 1.5.x as well?
I'm getting this error when running the sample project.
I upgraded to ExcelDna 1.6.0 as well with no luck.
When running the packed version it seems to work fine.
However, while debugging, launching the unpacked version I get the error below.
Also, when running the packed version, I get this error when closing excel:
To be honest I'm not really sure if this is an ExcelDna issue or an issue that is caused by this package.
This is my csproj:
The text was updated successfully, but these errors were encountered: