Jump to content
RJ90

Bing Maps (Bibliotecas Microsoft)

Recommended Posts

RJ90

Boas pessoal!

Estou a tentar apresentar o mapa mundial através do Bing Maps. Só que estou aqui com um problema.

<Window x:Class="theBingMicro.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:m="clr-namespace:Microsoft.Maps.MapControl;assembly=Microsoft.Maps.MapControl"
        Title="MainWindow" Height="350" Width="525">    
    <Grid x:Name="LayoutRoot" Background="White">
        <m:Map CredentialsProvider="A MINHA KEY DO BINGMAPSPORTAL" />
    </Grid>
</Window>

O código devia ser tão simples como isto, mas dá-me os seguintes erros.

Error	1	Unknown build error, 'Cannot resolve dependency to assembly 'System.Windows, Version=2.0.5.0, 
Culture=neutral, PublicKeyToken=7cec85d7bea7798e' because it has not been preloaded. When using the ReflectionOnly 
APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event. 
Line 7 Position 10.' 	C:\Users\Ricardo\Desktop\theBingMicro\theBingMicro\MainWindow.xaml	7	10	theBingMicro

E ainda:

System.IO.FileNotFoundException
Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'
or one of its dependencies. O sistema não conseguiu localizar o ficheiro especificado.

Alguém me pode ajudar?


Samsung 700Z5A-S01PT Samsung Ominia W

ᥡ What Else? ᥡ

Share this post


Link to post
Share on other sites
RJ90

Continua na mesma.

Usei o ficheiro System.Windows.dll que se encontra em C:/Program Files/Reference Assemblies/Microsoft/Framework/Silverlight/v4.0

Depois, pedia a Microsoft.Maps.MapControl.Common.dll, fiz load, passou a pedir o o System.Windows.Browser.dll, adicionei... e... 6 erros.  😡

Error	1	The type 'System.Windows.Controls.Grid' exists in both 'c:\Program Files\Reference Assemblies\Microsoft
\Framework\Silverlight\v4.0\System.Windows.dll' and 'c:\Program Files\Reference Assemblies\Microsoft\Framework
\.NETFramework\v4.0\Profile\Client\PresentationFramework.dll'	C:\Users\Ricardo\Desktop\theBingMicro\theBingMicro
\MainWindow.xaml	7	42	theBingMicro

Error	2	The type 'System.Windows.Application' exists in both 'c:\Program Files\Reference Assemblies\Microsoft\Framework
\Silverlight\v4.0\System.Windows.dll' and 'c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework
\v4.0\Profile\Client\PresentationFramework.dll'	C:\Users\Ricardo\Desktop\theBingMicro\theBingMicro\App.xaml.cs	13	32	theBingMicro

Error	3	'theBingMicro.MainWindow': cannot derive from sealed type 'System.Windows.Window'	C:\Users\Ricardo\Desktop
\theBingMicro\theBingMicro\MainWindow.xaml.cs	21	26	theBingMicro

Error	4	The type 'System.Windows.Window' exists in both 'c:\Program Files\Reference Assemblies\Microsoft\Framework
\Silverlight\v4.0\System.Windows.dll' and 'c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework
\v4.0\Profile\Client\PresentationFramework.dll'	C:\Users\Ricardo\Desktop\theBingMicro\theBingMicro\MainWindow.xaml.cs
21	39	theBingMicro

Error	5	The type 'System.Windows.Application' exists in both 'c:\Program Files\Reference Assemblies\Microsoft\Framework
\Silverlight\v4.0\System.Windows.dll' and 'c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework
\v4.0\Profile\Client\PresentationFramework.dll'	C:\Users\Ricardo\Desktop\theBingMicro\theBingMicro\obj\x86\Debug
\App.g.cs	41	47	theBingMicro

Error	6	The type 'System.Windows.Window' exists in both 'c:\Program Files\Reference Assemblies\Microsoft\Framework
\Silverlight\v4.0\System.Windows.dll' and 'c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework
\v4.0\Profile\Client\PresentationFramework.dll'	C:\Users\Ricardo\Desktop\theBingMicro\theBingMicro\obj\x86\Debug
\MainWindow.g.cs	42	54	theBingMicro

Já me estou a passar com isto.  :wallbash:


Samsung 700Z5A-S01PT Samsung Ominia W

ᥡ What Else? ᥡ

Share this post


Link to post
Share on other sites
Tiago Salgado

Mas adicionaste a referencia do Microsoft.Maps.MapControl.Common.dll e Microsoft.Maps.MapControl.dll ??

Share this post


Link to post
Share on other sites
saramgsilva

Continua na mesma.

Usei o ficheiro System.Windows.dll que se encontra em C:/Program Files/Reference Assemblies/Microsoft/Framework/Silverlight/v4.0

Depois, pedia a Microsoft.Maps.MapControl.Common.dll, fiz load, passou a pedir o o System.Windows.Browser.dll, adicionei... e... 6 erros.  😡

Error	1	The type 'System.Windows.Controls.Grid' exists in both 'c:\Program Files\Reference Assemblies\Microsoft
\Framework\Silverlight\v4.0\System.Windows.dll' and 'c:\Program Files\Reference Assemblies\Microsoft\Framework
\.NETFramework\v4.0\Profile\Client\PresentationFramework.dll'	C:\Users\Ricardo\Desktop\theBingMicro\theBingMicro
\MainWindow.xaml	7	42	theBingMicro

Error	2	The type 'System.Windows.Application' exists in both 'c:\Program Files\Reference Assemblies\Microsoft\Framework
\Silverlight\v4.0\System.Windows.dll' and 'c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework
\v4.0\Profile\Client\PresentationFramework.dll'	C:\Users\Ricardo\Desktop\theBingMicro\theBingMicro\App.xaml.cs	13	32	theBingMicro

Error	3	'theBingMicro.MainWindow': cannot derive from sealed type 'System.Windows.Window'	C:\Users\Ricardo\Desktop
\theBingMicro\theBingMicro\MainWindow.xaml.cs	21	26	theBingMicro

Error	4	The type 'System.Windows.Window' exists in both 'c:\Program Files\Reference Assemblies\Microsoft\Framework
\Silverlight\v4.0\System.Windows.dll' and 'c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework
\v4.0\Profile\Client\PresentationFramework.dll'	C:\Users\Ricardo\Desktop\theBingMicro\theBingMicro\MainWindow.xaml.cs
21	39	theBingMicro

Error	5	The type 'System.Windows.Application' exists in both 'c:\Program Files\Reference Assemblies\Microsoft\Framework
\Silverlight\v4.0\System.Windows.dll' and 'c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework
\v4.0\Profile\Client\PresentationFramework.dll'	C:\Users\Ricardo\Desktop\theBingMicro\theBingMicro\obj\x86\Debug
\App.g.cs	41	47	theBingMicro

Error	6	The type 'System.Windows.Window' exists in both 'c:\Program Files\Reference Assemblies\Microsoft\Framework
\Silverlight\v4.0\System.Windows.dll' and 'c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework
\v4.0\Profile\Client\PresentationFramework.dll'	C:\Users\Ricardo\Desktop\theBingMicro\theBingMicro\obj\x86\Debug
\MainWindow.g.cs	42	54	theBingMicro

Já me estou a passar com isto.  :wallbash:

Tens que ter calma, devem falar referência e tens que ver a dependência entre elas. Assim como verificar quais as dll que estão em falta e adicioná-las.

Cuidado que pode haver confusão entre a dll

Usei o ficheiro System.Windows.dll que se encontra em C:/Program Files/Reference Assemblies/Microsoft/Framework/Silverlight/v4.0

e a dll System.Windows.dll que está na GAC....

Share this post


Link to post
Share on other sites
Tiago Salgado

Verifica se não estar a fazer referencia à DLL para Silverlight na tua aplicação em WPF. Também é uma possivel razão para teres esse problema.

edit: acabei de testar adicionar as DLLs para SL numa WPF App e pimba...o erro igualzinho ao que tens :thumbsup:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.