Skip to content
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

Problem referencing Microsoft.Web.Infrastructure #1393

Closed
dcorriveau-omniscient opened this issue Jan 15, 2016 · 4 comments
Closed

Problem referencing Microsoft.Web.Infrastructure #1393

dcorriveau-omniscient opened this issue Jan 15, 2016 · 4 comments

Comments

@dcorriveau-omniscient
Copy link
Contributor

That package is very peculiar. I believe it is a dependency for SimpleInjector.Integration.Web. In my project file, I get this :

<Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1')">
      <ItemGroup>
        <Reference Include="SimpleInjector.Integration.Web">
          <HintPath>..\packages\SimpleInjector.Integration.Web\lib\net40\SimpleInjector.Integration.Web.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="Microsoft.Web.Infrastructure">
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>

But in VS, if I look at the references, that one isn't linked to any assembly (path is empty) and there is the yellow triangle next to the reference. I also get the warnings in the Error List pane:
The referenced component 'Microsoft.Web.Infrastructure' could not be found.

The package / assembly (Microsoft.Web.Infrastructure.dll) exists in packages\Microsoft.Web.Infrastructure\lib\net40.

When I run the paket update command, if im on Nuget v2 api it tries to download
Downloading Microsoft.Web.Infrastructure 1.0.0.0
However if im on v3, it
Downloading Microsoft.Web.Infrastructure 1.0.0
(not sure if it's a hint or not).

Even if I manually paket add Microsoft.Web.Infrastructure to my projects, it does the same things. It does add the Microsoft.Web.Infrastructure (1.0.0) in the lock file after the update command. Do you think it's paket related, I'm pretty sure I managed to add that reference using Nuget before ?

@forki
Copy link
Member

forki commented Jan 15, 2016

the behaviour is as specified in the nuspec:

<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
  <metadata>
    <version>3.1.2</version>
    <authors>Simple Injector Contributors</authors>
    <owners>Simple Injector Contributors</owners>
    <licenseUrl>https://simpleinjector.codeplex.com/license</licenseUrl>
    <projectUrl>https://simpleinjector.readthedocs.org/en/latest/lifetimes.html#per-web-request</projectUrl>
    <iconUrl>https://simpleinjector.org/simpleinjector.ico</iconUrl>
    <dependencies>
      <dependency id="SimpleInjector" version="3.1.2" />
    </dependencies>
    <frameworkAssemblies>
      <frameworkAssembly assemblyName="Microsoft.Web.Infrastructure" targetFramework=".NETFramework4.0" />
    </frameworkAssemblies>
    <id>SimpleInjector.Integration.Web</id>
    <title>Simple Injector ASP.NET Integration</title>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>The Simple Injector ASP.NET Integration package adds a lifestyle to the Simple Injector called 'Per Web Request', which allows instances to live within a single HTTP request and get disposed when the request ends.</description>
    <summary>ASP.NET integration for Simple Injector. General integration package for web applications such as Web Forms, MVC and IIS hosted Web API projects.</summary>
    <copyright>Simple Injector Contributors 2012 - 2014</copyright>
    <language>en-US</language>
    <tags>simpleinjector architecture dependency-injection DI easy easy-to-use Inversion-of-Control IOC per-web-request web integration</tags>
  </metadata>
</package>

@dcorriveau-omniscient
Copy link
Contributor Author

I believe Microsoft.Web.Infrastructure was previously installed in GAC from "something", but is now a Nuget package. Does it make sense ?

@forki
Copy link
Member

forki commented Jan 15, 2016

Yep, but the package is not respecting that changes. You need to contact
the package author
On Jan 15, 2016 16:05, "dcorriveau-omniscient" notifications@github.com
wrote:

I believe Microsoft.Web.Infrastructure was previously installed in GAC
from "something", but is now a Nuget package. Does it make sense ?


Reply to this email directly or view it on GitHub
#1393 (comment).

@dcorriveau-omniscient
Copy link
Contributor Author

As stated previously, this is not an issue with Paket so you can close this ticket.
However, if anybody stumbles on this page, one possible solution is to install the Assembly in GAC. Here's how you can list the Assemblies registered in GAC:

  1. Run the following command from a Developer Command Prompt (run as admin):
gacutil -l > c:\gac.txt

If you don't see a line that looks like this in the output file (gac.txt) then it means it's not registered:

Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL

To register it, find the file Microsoft.Web.Infrastructure.dll on your computer (you might need to install some components to get it, you can search the Web to see what installers have it). Then run this:

gacutil -i Microsoft.Web.Infrastructure.dll

@forki forki closed this as completed Jan 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants