Error while importing visual studio application - Advanced Installer Community
idbgr
Posts: 3
Joined: Fri Oct 30, 2020 9:21 pm

Error while importing visual studio application

I tried to import a visual studio project made with C# for the trial application and I get an error message while importing the visual studio solution.
It says "Could not load file or assembly System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0 while importing visual studio project"

I am using VS 2019 Community and AdvancedInstaller 2020 R1. Here is the list of packages for VS:

ASP.NET and web development
.NET desktop development
Desktop developing with C++
Visual Studio extension development
.NET Core cross-platform development

I saw people resolve the issue by adding bindings. But it didn't work for me. Here is my App.config file.

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
    </startup>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe"
                                  publicKeyToken="b03f5f7f11d50a3a"
                                  culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-4.0.4.1"
                                 newVersion="4.0.4.1"/>
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>
I got the trial c# code from youtube. https://www.youtube.com/watch?v=QbDviXKCFS4 Please let me know what to do to resolve the error.
Attachments
error.PNG
error.PNG (56.68 KiB) Viewed 3360 times
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Error while importing visual studio application

Hello and welcome to our forums,

Could you please follow the steps presented by my colleague Eusebiu in the following thread:

Import Visual Studio Project Exception calling

and let me know if everything works as expected?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
idbgr
Posts: 3
Joined: Fri Oct 30, 2020 9:21 pm

Re: Error while importing visual studio application

Thank you so much!! It worked!
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Error while importing visual studio application

You are always welcome!

I am glad the solution worked.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”